A.G.S. v2.21
Text Script Commands Manual by Spyros

Main Page
Character

Cursor
Dialogue
Display
File
Game
GUI
Inventory
Music,Sound,Flic

Palette
Object

Room
Screen
String

 

AddInventory (int what)
Adds inventory index WHAT to the current player character's inventory. This is the same as doing character[EGO].inv[WHAT]+=1; It is possibly useful in a game where the player can control more than one character, since it will add the inventory to the current player character.
Example:
AddInventory(12);

GetInvName (int item, string buffer)

Fills in BUFFER with the name of inventory item index ITEM. This is the name which the item is given under the Game tab, Inventory mode of the Room Editor.
This function is mainly useful for a lucasarts-style status line:
Example:
GetInvName (player.activeinv, buffer);

InventoryScreen ()
Brings up the Sierra-style inventory window which allows the player to select and manipulate inventory items. If they select one, the cursor mode will be set to inventory-use (mode 4), and character[EGO].activeinv will be set to the inventory item selected.
NOTE: This function does not actually bring up the window immediately; instead, it will show the window when the current script function finishes executing.
NOTE: If the player has no inventory items, global message 996 will be displayed.
Example:
InventoryScreen();

LoseInventory (int what)

Removes inventory item WHAT from the current player character's inventory. If they do not have the item, nothing happens.
Example:
LoseInventory(12);

SetActiveInventory (int inv_item)

Sets the current active inventory item for the current player character to INV_ITEM. This function changes the player.activeinv variable, and also sets up the mouse cursor as necessary.
To deselect the current inventory, pass INV_ITEM as -1.
Example:
SetActiveInentory(13);

SetInvDimensions (int width, int height)
Allows you to change the default width and height of the inventory item picture slots used by the Lucasarts-style inventory window. By default,
the LEC inv window is made up of 40x22 pixel cells, but if all your inventory item pictures are bigger or smaller than this, you can use this
function to adjust them.
Example: (Set inventory Dimension to 80x40 pixels)
SetInvDimensions (80,40);

SetInvItemPic (int inv, int sprite_slot)
Changes inventory item INV's graphic to be slot number SPRITE_SLOT from the Sprite Manager. This allows you to dynamically adjust an item's picture in the inventory window during the game.
Example:
SetInvItemPic (13,234);

GLOBAL VARIABLES

character[CHARID].activeinv
The currently selected inventory item (or -1)
Example:
if (character[NAME].activeinv==12);
Checks if the character is currently using inv number 12


character[CHARID].inv[x]
 Whether the character is carrying inventory X
if (character[NAME].inv[5]==12);
Checks if the character is carrying inv number 12