AGI Command Reference - Inventory Item Management Commands
By Chris Cromer
OBJECT resources, stored in a separate file OBJECT, are most often used to represent inventory items. An item is a structure which consists of a one-byte field called room and a string of text, the item name. If the room field of an item is 255, the item belongs to the player. Otherwise the item is considered to be in the room with the corresponding ID number.
Let us consider item management commands.
Stores 255 in room field of an object n, which means the player owns it.
Stores 0 in the room field of object n.
put(n, m); put.v(n, m);
Stores the value m (or Var(m)) in the room field of the object n.
Stores the value of the room field of object Var(n) in Var(m).
The screen is switched to text mode; the top line displays "You are carrying:", then the names of the object with room field equal to 255 are listed. If there are no such objects, the word "nothing" is displayed.
If Flag(13) = 1 (allow item selection), a highlight appears which allows the player to select an item name. When Enter is pressed, the selected object number is stored in Var(25). When Esc is pressed, 255 is stored in Var(25).