Walk: Difference between revisions

From Wiki of ZZT
Jump to navigation Jump to search
(Created page with "{{DISPLAYTITLE:walk}} '''walk''' is a ZZT-OOP command that makes an object move automatically, independent of conventional movement commands (<code>#go</code>,...")
 
(Formatting, links)
 
Line 1: Line 1:
{{DISPLAYTITLE:walk}}
{{DISPLAYTITLE:walk}}
'''#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. 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>.


== Syntax ==
== Syntax ==
<code>#walk <direction></code>
<code>#walk <direction></code>


== Notes ==
== Notes ==
* Objects will not push other entities as a result of walking.
* Objects will not push other entities as a result of walking.
* <code>#walk</code> operates independently of other movement commands, so an object can appear to move diagonally by walking along one axis and using <code>#go</code> or <code>#try</code> on the other.
* <code>#walk</code> operates independently of other movement commands, so an object can appear to move diagonally by walking along one axis and using <code>#go</code> or <code>#try</code> on 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, <code>#walk cw flow</code> will make an object turn clockwise.
* [[flow]] refers to an object's current walking direction, and can be used in conjunction with [[direction modifiers]] to steer it. For example, <code>#walk cw flow</code> will 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.
* 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 navbox}}
{{ZZT-OOP navbox}}

Latest revision as of 05:22, 14 February 2021

#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. 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.
  • #walk operates independently of other movement commands, so an object can appear to move diagonally by walking along one axis and using #go or #try on 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 flow will 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.