Hyperlink

From Wiki of ZZT
Revision as of 02:55, 9 February 2021 by RT-55J (talk | contribs) (▶Hyperlinks!)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

A hyperlink is a button that the player can press in a text window. Pressing a hyperlink can lead to another label in an object's code or to an external file. In-game, a hyperlink appears as a line of text in a text window beginning with a purple triangle, and can be selected by the player pressing Enter. Hyperlinks are very useful for giving the player the ability to make choices.

The syntax for hyperlinks in ZZT-OOP is as follows:

!label;text
!-filename;text

Note that for a hyperlink to work, the exclamation point ! must be the first character of the line (with exceptions listed below). Also, hyperlinks only work in text windows, and not with the single-line messages that appear on the bottom of the screen.

If a file extension is not provided for the filename, then the extension defaults to .HLP.

Conditional Hyperlinks

Hyperlinks can be used with any ZZT-OOP command that accepts another command as an argument, and only appear if a command in their place would have been executed. Thus, the following is valid ZZT-OOP:

#if contact then !fooA;Test A
#take gems 1000 !fooB;Test B
#try n !fooC;Test C

Assuming this object was in contact with the player and blocked to the north, but the player had more than 1000 gems, then the text window would display the following choices:

▶Test A
▶Test C