Give
Jump to navigation
Jump to search
#give and #take are ZZT-OOP commands for adding and subtracting to counters.
The syntax for the commands is:
#give <counter> <amount> [<command>]
#take <counter> <amount> [<command>]
The following counters can be modified with #give and #take:
- Health
- Ammo
- Gems
- Torches (ZZT only)
- Score
- Time
- Z (Super ZZT only)
If the result of the command would result in the counter having a value less than 0 or greater than 32767, then the result of the #give or #take operation is not stored, and the command is executed instead (if present). The command is usually the name of a label to jump to, but can also be any other ZZT-OOP operation if desired.
@GemsForHealth
- end
- touch
- take gems 10 tooPoor
- give health 50
- end
- tooPoor
You're to poor to buy health!
The command argument is rarely used with #give, though it is available to use
Bugs and Quirks
[TODO: Verify and explain these]
- The time counter is weird.
- Visual glitches can occur when taking sufficiently large values.
ZZT-OOP | |
---|---|
Prefixes |
|
Messages | |
Directions | |
Flags | |
Commands |