Put

From AGI Wiki
Jump to: navigation, search

The put command sets the room number value for an inventory item.

Syntax

put(itm iA, var vROOMNUM);
put("item", var vROOMNUM);

Remarks

The room number for inventory item iA is changed to B, where B = vROOMNUM. If the new room number value is 255, it signifies the item being in the player's 'inventory'; you could use the get command instead.

Changing an inventory item's room number does not actually 'move' the item.

Possible Errors

If the inventory item is not valid (the number exceeds the total number of inventory items in the OBJECT file), AGI will raise trappable error #23.

Example

Code:
v100 = 30;
put("dagger", v100); [ the dagger's room number is now 30
v100 = 255;
put("dagger", v100); [ now the dagger is in player's 'inventory'
get("dagger"); [ simpler way to set room number to 255

Technical Information

Required Interpreter Version: Available in all AGI versions.
Byte-Code Value: 95 (0x5F hex)

See Also

Inventory Item Commands
put.v
get