This page presents all the instructions that can be performed in Wyrd. Instructions do not return values. With one exception, all instructions increase the Program Counter by 1.
(add_choice [TEXT])
Adds a new option for the next resolve_choices
instruction. The new option
presents the player with [TEXT]
.
(prompt_integer [INT REFERENCE] [MIN = INT] [MAX = INT] [TEXT])
Prompts the user for an integer between [MIN]
and [MAX]
by displaying the
message [TEXT]
. The result is stored in [INT REFERENCE]
.
(prompt_string [STRING REFERENCE] [MIN = INT] [MAX = INT] [TEXT])
Prompts the user for a string of size between [MIN]
and [MAX]
by displaying
the message [TEXT]
. The result is stored in [STRING REFERENCE]
.
(assert [BOOL] [TEXT])
If [BOOL]
isn’t true, raise a runtime error containing [TEXT]
.
(display [TEXT])
Displays [TEXT]
to the player.
(end)
Marks the end of the narration. Interrupts the execution.
(event_call {string} [C0 = COMPUTATION] ... [CN = COMPUTATION])
Interrupts execution, informs the interpreter that the given event {String}
was triggered with the parameters C0 ... CN
.
(remove [ADDRESS])
The memory at [ADDRESS]
is freed.
(resolve_choices)
Present the player with all options that where added using add_choice
since
the last resolve_choices
. The execution is paused and should be resumed by
the interpreter setting the Program Counter according to the chosen option.
(set_pc [INT])
Sets the Program Counter to [INT]
. The program counter is not automatically
increased by 1 in this case.
(set_value [ADDRESS] [COMPUTATION])
Sets the memory pointed by [ADDRESS]
to [COMPUTATION]
.
[COMPUTATION]
is passed by value, not reference (i.e. no aliasing can occur
without it being done explicitly through pointers).
(initialize [ADDRESS] [TYPE])
Initializes a memory element at [ADDRESS]
with the default value for the type
[TYPE]
.