You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Zachary Perlmutter edited this page Nov 1, 2022
·
1 revision
You can store game objects in variables, allowing reuse of that game object. This is particularly useful for objects that have a specific identity and relationship with the game state; in particular, basically anything with a sprite: Actor and Item, or for objects that are hidden in an object's variable list.
All variable names start with "@".
Assigning
The three ways of assigning variables are as follows:
@<variable> <command> [args...]
where <command> is a command that generates something:
use will return the result of the method call.
spawn will return the mob that is created.
give will return the item that is created.
set will return the trap that is created.
This allows direct reuse of that object in future use commands or as a method argument, bypassing the limitation of one method per command.
@<variable> c[ell]
Typing cell or (c) will have the game prompt you to select a tile. You can store the corresponding map index of the cell, or you can store anything else that is on the cell (characters, blobs, heaps)
@<variable> i[nv]
Typing inv or i has you select an item from the bag to store in a variable.