Difference between revisions of "AGI Command Reference - Inventory Item Management Commands"

From AGI Wiki
Jump to navigationJump to search
Line 11: Line 11:
 
[[AGI Command Reference - Object Motion Control Commands|6]] |  
 
[[AGI Command Reference - Object Motion Control Commands|6]] |  
 
[[AGI Command Reference - Inventory Item Management Commands|7]] |  
 
[[AGI Command Reference - Inventory Item Management Commands|7]] |  
[[AGI Command Reference - PIC Resource Management Commands|8]] |  
+
[[AGI Command Reference - Picture Resource Management Commands|8]] |  
 
[[AGI Command Reference - Sound Resource Management Commands|9]] |  
 
[[AGI Command Reference - Sound Resource Management Commands|9]] |  
 
[[AGI Command Reference - Text Management Commands|10]] |  
 
[[AGI Command Reference - Text Management Commands|10]] |  
Line 64: Line 64:
 
[[AGI Command Reference - Object Motion Control Commands|6]] |  
 
[[AGI Command Reference - Object Motion Control Commands|6]] |  
 
[[AGI Command Reference - Inventory Item Management Commands|7]] |  
 
[[AGI Command Reference - Inventory Item Management Commands|7]] |  
[[AGI Command Reference - PIC Resource Management Commands|8]] |  
+
[[AGI Command Reference - Picture Resource Management Commands|8]] |  
 
[[AGI Command Reference - Sound Resource Management Commands|9]] |  
 
[[AGI Command Reference - Sound Resource Management Commands|9]] |  
 
[[AGI Command Reference - Text Management Commands|10]] |  
 
[[AGI Command Reference - Text Management Commands|10]] |  
Line 78: Line 78:
 
[[AGI Command Reference|AGI Command Reference Index]]
 
[[AGI Command Reference|AGI Command Reference Index]]
  
<span style="float: left">[[AGI Command Reference - Object Motion Control Commands|&lt; Previous: Object Motion Control Commands]]</span><span style="float: right">[[AGI Command Reference - PIC Resource Management Commands|Next: PIC Resource Management Commands &gt;]]</span>
+
<span style="float: left">[[AGI Command Reference - Object Motion Control Commands|&lt; Previous: Object Motion Control Commands]]</span><span style="float: right">[[AGI Command Reference - Picture Resource Management Commands|Next: Picture Resource Management Commands &gt;]]</span>
  
 
&nbsp;
 
&nbsp;

Revision as of 14:52, 28 December 2013

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 >