Walk: Difference between revisions
Jump to navigation
Jump to search
Formatting, links |
Clarification |
||
| Line 2: | Line 2: | ||
'''#walk''' is a [[ZZT-OOP]] command that makes an [[object]] move automatically, independent of conventional [[movement]] commands (<code>[[go|#go]]</code>, <code>[[try|#try]]</code>). | '''#walk''' is a [[ZZT-OOP]] command that makes an [[object]] move automatically, independent of conventional [[movement]] commands (<code>[[go|#go]]</code>, <code>[[try|#try]]</code>). | ||
Once <code>#walk</code> is executed, the object will move in the specified direction on every cycle [[tick]]. If a walking object is blocked by an obstacle, it will send a [[thud]] message to itself, unless it's [[lock|locked]]. | Once <code>#walk</code> is executed, the object will move in the specified direction on every cycle [[tick]] after the object's code has finished executing. If a walking object is blocked by an obstacle, it will send a [[thud]] message to itself, unless it's [[lock|locked]]. | ||
To stop walking, use <code>#walk [[idle]]</code> or <code>#walk [[idle|i]]</code>. | To stop walking, use <code>#walk [[idle]]</code> or <code>#walk [[idle|i]]</code>. | ||
Latest revision as of 16:43, 22 February 2026
#walk is a ZZT-OOP command that makes an object move automatically, independent of conventional movement commands (#go, #try).
Once #walk is executed, the object will move in the specified direction on every cycle tick after the object's code has finished executing. If a walking object is blocked by an obstacle, it will send a thud message to itself, unless it's locked.
To stop walking, use #walk idle or #walk i.
Syntax
#walk <direction>
Notes
- Objects will not push other entities as a result of walking.
#walkoperates independently of other movement commands, so an object can appear to move diagonally by walking along one axis and using#goor#tryon the other.- flow refers to an object's current walking direction, and can be used in conjunction with direction modifiers to steer it. For example,
#walk cw flowwill make an object turn clockwise. - Internally, ZZT object walking is implemented with two delta variables. Modifying these variables with an enhanced editor beyond the ranges of -1 to +1 will cause the object to skip across terrain.
| ZZT-OOP | |
|---|---|
| Prefixes |
|
| Messages | |
| Directions | |
| Flags | |
| Commands | |