Stat: Difference between revisions
Jump to navigation
Jump to search
(Created page with "A stat is a bundle of additional information attached to a location on the ZZT board; each element processes these values differently. == Contents == Stat values whose interpretation is dependent on the element type are marked in ''italic''. * '''X/Y''': The location on the board, 1-indexed. * '''''Step X/Step Y''''': Typically a direction or movement delta. * '''Cycle''': The period of ticking for the stat; for example, a stat with a cycle of 3 will...") |
No edit summary |
||
| Line 2: | Line 2: | ||
== Contents == | == Contents == | ||
Stat values whose interpretation is dependent on the element type are marked in ''italic''. | Stat values whose interpretation is dependent on the element type are marked in ''italic''. | ||
| Line 11: | Line 12: | ||
* '''Under''': The tile "under" the stat. Used to preserve walkable elements the stat walks onto, such as [[Fake|fakes]]. | * '''Under''': The tile "under" the stat. Used to preserve walkable elements the stat walks onto, such as [[Fake|fakes]]. | ||
* '''Data''': The [[ZZT-OOP]] code used by the stat. | * '''Data''': The [[ZZT-OOP]] code used by the stat. | ||
== Dummy stat == | |||
If a typically statful element exists in the board without a stat, it will try to access the stat index <code>-1</code>, which points into an area of memory occupied by the bottom row of [[edge|board edges]]. This is typically benign, as values most likely to be affected in this way (in particular, the internal state variable P1) point at the ''colors'' of these board edges, which are never displayed. | |||
== Bugs/Quirks == | == Bugs/Quirks == | ||
Latest revision as of 11:24, 24 December 2025
A stat is a bundle of additional information attached to a location on the ZZT board; each element processes these values differently.
Contents
Stat values whose interpretation is dependent on the element type are marked in italic.
- X/Y: The location on the board, 1-indexed.
- Step X/Step Y: Typically a direction or movement delta.
- Cycle: The period of ticking for the stat; for example, a stat with a cycle of 3 will generally only be processed on every third game tick.
- P1/P2/P3: Typically parameters or state variables controlling the stat's behavior.
- Follower/Leader: The index of the next and previous stat. Used by centipedes.
- Under: The tile "under" the stat. Used to preserve walkable elements the stat walks onto, such as fakes.
- Data: The ZZT-OOP code used by the stat.
Dummy stat
If a typically statful element exists in the board without a stat, it will try to access the stat index -1, which points into an area of memory occupied by the bottom row of board edges. This is typically benign, as values most likely to be affected in this way (in particular, the internal state variable P1) point at the colors of these board edges, which are never displayed.
Bugs/Quirks
- As the location of a stat is part of its contents, multiple stats in the list may technically point to the same location.
- Stats are often referenced by their index on the stat list, but removing stats affects the index of all following stats. Not taking this into account causes a class of engine bugs known as diemove.