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:
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
Hyperlinks can be used with any ZZT-OOP command that accepts another command as an argument, and will only appear if a command in their place would have been executed. Thus, the following code is valid ZZT-OOP:
#if contact then !fooA;Test A #take gems 1000 !fooB;Test B #try n !fooC;Test C
▶Test A ▶Test C