![]() |
dsekai
World engine for retrocomputers.
|
Overview of the mobile scripting language. More...
Macros | |
#define | SCRIPT_CB_TABLE_24(f) |
#define | SCRIPT_CB_TABLE_23(f) |
DISABLE: Disable Scripting Interactions with the MOBILE running this script, while still executing script instructions. | |
#define | SCRIPT_CB_TABLE_22(f) |
WARP: Warp to a tilemap identified by the string at the arg index in current TILEMAP::strpool. | |
#define | SCRIPT_CB_TABLE_21(f) |
#define | SCRIPT_CB_TABLE_20(f) |
#define | SCRIPT_CB_TABLE_19(f) |
#define | SCRIPT_CB_TABLE_18(f) |
EQJMP: Move script execution to a label defined by START if the last value pushed to MOBILE::script_stack is EQUAL TO the value pushed before it. | |
#define | SCRIPT_CB_TABLE_17(f) |
GTJMP: Move script execution to a label defined by START if the last value pushed to MOBILE::script_stack is GREATER THAN the value pushed before it. | |
#define | SCRIPT_CB_TABLE_16(f) |
LTJMP: Move script execution to a label defined by START if the last value pushed to MOBILE::script_stack is LESS THAN the value pushed before it. | |
#define | SCRIPT_CB_TABLE_15(f) |
ADD: Add the argument to the last value pushed to the stack, and push the result back onto the stack. | |
#define | SCRIPT_CB_TABLE_14(f) |
SUB: Subtract the argument from the last value pushed to the stack, and push the result back onto the stack. | |
#define | SCRIPT_CB_TABLE_13(f) |
GIVE: Give an ITEM to DSEKAI_STATE::player based on ITEM::gid from TILEMAP::item_defs. | |
#define | SCRIPT_CB_TABLE_12(f) |
TAKE: Give an ITEM to DSEKAI_STATE::player based on ITEM::gid from TILEMAP::item_defs. | |
#define | SCRIPT_CB_TABLE_11(f) |
DIE: Trigger death animation for MOBILE running this script and then vanish, becoming inactive. | |
#define | SCRIPT_CB_TABLE_10(f) |
GGET: Push a copy of a value from the global table at onto MOBILE::script_stack. | |
#define | SCRIPT_CB_TABLE_9(f) |
GSET: Pop a value from MOBILE::script_stack into the global table, overriding any previous value at that index. | |
#define | SCRIPT_CB_TABLE_8(f) |
FACE: Set the actor to face one of the Cardinal Directions. | |
#define | SCRIPT_CB_TABLE_7(f) |
RETURN: Return from an interaction subroutine to the main script. | |
#define | SCRIPT_CB_TABLE_6(f) |
SPEAK: Display a dialog window with the actor's MOBILE::sprite_id and a line of text from TILEMAP::strpool. | |
#define | SCRIPT_CB_TABLE_5(f) |
GOTO: Move script execution to a label defined by START. | |
#define | SCRIPT_CB_TABLE_4(f) |
START: Define a label index that can be jumped to. | |
#define | SCRIPT_CB_TABLE_3(f) |
SLEEP: Don't do anything for arg number of frames. | |
#define | SCRIPT_CB_TABLE_2(f) |
WALK: The actor walks in the direction specified on the stack. | |
#define | SCRIPT_CB_TABLE_1(f) |
INTERACT: Define a Scripting Interactions callback label. | |
#define | SCRIPT_CB_TABLE(f) |
NOOP: Not a valid instruction. Beginning of the script callback table, used to implement script parsing. | |
Overview of the mobile scripting language.
All statements take a single numerical argument.
Args can range from 0 to SCRIPT_ARG_MAX. See scripting_args for more information on special arguments.
A script executed by a MOBILE also has access to MOBILE::script_stack, which can hold up to SCRIPT_STACK_DEPTH items.
Items on MOBILE::script_stack can range from 0 to SCRIPT_STACK_MAX in value.
#define SCRIPT_CB_TABLE | ( | f | ) |
NOOP: Not a valid instruction. Beginning of the script callback table, used to implement script parsing.
#define SCRIPT_CB_TABLE_1 | ( | f | ) |
INTERACT: Define a Scripting Interactions callback label.
Arguments
This statement does nothing by itself, but it defines a point in the code that will be jumped to when a player interacts with the MOBILE running this SCRIPT.
Please see the section on Scripting Interactions for details on this instruction.
#define SCRIPT_CB_TABLE_10 | ( | f | ) |
GGET: Push a copy of a value from the global table at onto MOBILE::script_stack.
Arguments
Stack Values Pushed
#define SCRIPT_CB_TABLE_11 | ( | f | ) |
DIE: Trigger death animation for MOBILE running this script and then vanish, becoming inactive.
See Mobile MP/HP for more information on mobile death.
#define SCRIPT_CB_TABLE_12 | ( | f | ) |
TAKE: Give an ITEM to DSEKAI_STATE::player based on ITEM::gid from TILEMAP::item_defs.
Arguments
#define SCRIPT_CB_TABLE_13 | ( | f | ) |
GIVE: Give an ITEM to DSEKAI_STATE::player based on ITEM::gid from TILEMAP::item_defs.
Arguments
#define SCRIPT_CB_TABLE_14 | ( | f | ) |
SUB: Subtract the argument from the last value pushed to the stack, and push the result back onto the stack.
Arguments
Stack Values Popped
Stack Values Pushed
#define SCRIPT_CB_TABLE_15 | ( | f | ) |
ADD: Add the argument to the last value pushed to the stack, and push the result back onto the stack.
Arguments
Stack Values Popped
Stack Values Pushed
#define SCRIPT_CB_TABLE_16 | ( | f | ) |
LTJMP: Move script execution to a label defined by START if the last value pushed to MOBILE::script_stack is LESS THAN the value pushed before it.
Arguments
Stack Values Pushed
#define SCRIPT_CB_TABLE_17 | ( | f | ) |
GTJMP: Move script execution to a label defined by START if the last value pushed to MOBILE::script_stack is GREATER THAN the value pushed before it.
Arguments
Stack Values Pushed
#define SCRIPT_CB_TABLE_18 | ( | f | ) |
EQJMP: Move script execution to a label defined by START if the last value pushed to MOBILE::script_stack is EQUAL TO the value pushed before it.
Arguments
Stack Values Pushed
#define SCRIPT_CB_TABLE_19 | ( | f | ) |
#define SCRIPT_CB_TABLE_2 | ( | f | ) |
WALK: The actor walks in the direction specified on the stack.
Arguments
Stack Values Popped
#define SCRIPT_CB_TABLE_20 | ( | f | ) |
#define SCRIPT_CB_TABLE_21 | ( | f | ) |
#define SCRIPT_CB_TABLE_22 | ( | f | ) |
WARP: Warp to a tilemap identified by the string at the arg index in current TILEMAP::strpool.
Arguments
#define SCRIPT_CB_TABLE_23 | ( | f | ) |
DISABLE: Disable Scripting Interactions with the MOBILE running this script, while still executing script instructions.
Arguments
#define SCRIPT_CB_TABLE_24 | ( | f | ) |
#define SCRIPT_CB_TABLE_3 | ( | f | ) |
SLEEP: Don't do anything for arg number of frames.
Arguments
#define SCRIPT_CB_TABLE_4 | ( | f | ) |
START: Define a label index that can be jumped to.
Arguments
Labelled indexes defined with START may be jumped to later by GOTO or JMP instructions.
#define SCRIPT_CB_TABLE_5 | ( | f | ) |
GOTO: Move script execution to a label defined by START.
Arguments
Stack Values Pushed
#define SCRIPT_CB_TABLE_6 | ( | f | ) |
SPEAK: Display a dialog window with the actor's MOBILE::sprite_id and a line of text from TILEMAP::strpool.
Arguments
#define SCRIPT_CB_TABLE_7 | ( | f | ) |
RETURN: Return from an interaction subroutine to the main script.
Arguments
It is common to use this with SCRIPT_ARG_STACK_I, which uses the instruction number automatically pushed to the stack on interaction, and then increments the interaction count. This is not necessary, however, and more creative uses may be devised.
#define SCRIPT_CB_TABLE_8 | ( | f | ) |
FACE: Set the actor to face one of the Cardinal Directions.
Arguments
#define SCRIPT_CB_TABLE_9 | ( | f | ) |
GSET: Pop a value from MOBILE::script_stack into the global table, overriding any previous value at that index.
Arguments
Stack Values Popped