Room File Structure
Each room must be defined in its own file. The name of the file (without the extension)
determines the name of the room as referenced by the engine and by effects such as
+GOTO. For example, a file named secret_room.room will be
registered as a room called secret_room.
The general structure of a single room file is as follows:
The @ENTER tag is mandatory and should (aside from comments) be the first line in the room
file.
It indicates the start of the room's content. The @EXIT block is optional
and can be used to define effects that occur when leaving the room. Room files do not necessarily need to
include choices if the @ENTER event forwards
the player to another room.
Upon reaching the end of a block, the engine will await input from the player. The player can then input their choice, which then triggers the corresponding choice. In case the input does not match any available choices, an "Unknown option" message will be displayed, and the engine will prompt the player to try again.
Using the +GOTO effect, the game can transition to another room file. In this case,
the current room's @EXIT effect will be executed (if present), followed by the
@ENTER block of the new room.
Comments can be written using the prefix // and can be placed anywhere in the file
except in text blocks, where they will be interpreted as part of the text.
Example
Special Characters
The following characters have special meanings in room files when placed at the start of a line:
@Denotes the start of a room event block (such as@ENTERor@EXIT).+Denotes an effect to be executed.>Denotes the start of a choice block.//Denotes a comment. Comments are not processed in any way and have no effect on the output.IFDenotes the start of an IF block. Must be closed by anENDIForELSEblock.ELSEDenotes the start of an ELSE block. Must be preceded by anIFblock and closed by anENDIFblock.ENDIFDenotes the end of an IF block.
Choices
Choices represent the different options a player can pick in a room. Each choice has its own effects and may forward the player to another room. If the player is not sent to another room, they will be prompted to make a choice again. Choices are case-insensitive and leading and trailing spaces are ignored, which means that "gold", "GOLD", and " Gold " all refer to the same choice.
Anti-Choice
The Anti-Choice >! is a special type of choice that executes
when the player performs an input that does not match any of the defined choices in the room file.
The user's choice is stored in the string variable input,
which contains the text of the last given input.