AGI Command Reference - Inventory Item Management Commands

From AGI Wiki
Revision as of 14:52, 28 December 2013 by Andrew Branscom (talk | contribs)
Jump to navigationJump to search

Tutorials and Guides Table of Contents
AGI Command Reference Index

Page: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16


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.

get(n); get.v(n);

Stores 255 in room field of an object n, which means the player owns it.

drop(n);

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.

get.room.v(n, m);

Stores the value of the room field of object Var(n) in Var(m).

status();

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).

 

Page: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16


Tutorials and Guides Table of Contents
AGI Command Reference Index

< Previous: Object Motion Control CommandsNext: Picture Resource Management Commands >