Scroll

From Wiki of ZZT
Revision as of 05:24, 18 February 2021 by The Green Herring (talk | contribs) (Edit text of scroll)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Scroll
ZZT-OOP namescroll
Internal ID10 (0x0A)
Character#char 232 Φ (0xE8)
Default colorwhite on black (0x0F)
Categoryitem
Stats
Default cycle1
Datascroll text
Other traits
Effect on movementpushable
Uses ZZT-OOP color names?no

The scroll is one of the built-in items in ZZT. When placed in a world in the editor, the designer is prompted to write text on it. In-game, the scroll flashes all of the default ZZT colors; when collected by the player, it cues a special sound effect, displays whatever text is written in it, and is removed from play. The engine will display the text at the bottom of the screen if it is one line long, or open a text window to show it if it is two lines or longer. If there is no text in the scroll, the sound effect will play but nothing else will happen.

While the internal editor's help files only say that the scroll shows a message to the player, it does so by executing the text as a ZZT-OOP program. This makes it the only element to allow the writing and execution of ZZT-OOP commands other than the object. However, because the scroll is immediately consumed on use, this feature is best used to turn the scroll into a collectible item with special effects, such as #sending a command to an object or #setting a flag.

A scroll can be programmatically placed, but doing so will produce a scroll with no text. Using #change on a scroll will produce an element of whatever color the scroll currently is, if the element does not have a predefined color. It cannot be pushed directly by the player since they will automatically collect it on touch, but it can be moved by a player or creature pushing a boulder or slider against it, and it is affected by pushers.

Scroll crash

If the text of a scroll contains a command to #go, #try or #become, collecting the scroll will crash ZZT. This is because in processing it, the engine attempts to directly affect a stat that no longer exists.