Actions
Actions are a basic element of the Mage Game Engine (MGE).
Actions are individual units of script behavior, such as a logic check or state management, given one after the other within a single script. They each have predefined arguments, and their names are written in "SCREAMING_SNAKE_CASE." In the final encoded data, they are 8 bytes apiece.
Through MGS Natlang, they can be written as one or more "natural language" patterns.
Game Management
Handle the general state of the game, such as loading maps, timing game actions, enabling and disabling player input, and managing save states.
- BLOCKING_DELAY
- NON_BLOCKING_DELAY
- SET_PLAYER_CONTROL
- LOAD_MAP
- SLOT_SAVE
- SLOT_LOAD
- SLOT_ERASE
- SHOW_DIALOG
- CLOSE_DIALOG
- SET_LIGHTS_CONTROL
- SET_LIGHTS_STATE
Hex Editor
Enable or disable player control of specific game features, and otherwise manage the hex editor state.
- SET_HEX_EDITOR_STATE
- SET_HEX_EDITOR_DIALOG_MODE
- SET_HEX_EDITOR_CONTROL
- SET_HEX_EDITOR_CONTROL_CLIPBOARD
Serial Console
Manage serial features and create serial output.
- SET_SERIAL_DIALOG_CONTROL
- SHOW_SERIAL_DIALOG
- CLOSE_SERIAL_DIALOG
- SET_CONNECT_SERIAL_DIALOG
- REGISTER_SERIAL_DIALOG_COMMAND
- UNREGISTER_SERIAL_DIALOG_COMMAND
- REGISTER_SERIAL_DIALOG_COMMAND_ARGUMENT
- UNREGISTER_SERIAL_DIALOG_COMMAND_ARGUMENT
- SET_SERIAL_DIALOG_COMMAND_VISIBILITY
- REGISTER_SERIAL_DIALOG_COMMAND_ALIAS
- UNREGISTER_SERIAL_DIALOG_COMMAND_ALIAS
Camera Control
Manipulate the camera's position or perform tricks like shaking the camera or fading the screen in and out to an arbitrary color.
- SET_CAMERA_TO_FOLLOW_ENTITY
- TELEPORT_CAMERA_TO_GEOMETRY
- PAN_CAMERA_TO_ENTITY
- PAN_CAMERA_TO_GEOMETRY
- PAN_CAMERA_ALONG_GEOMETRY
- LOOP_CAMERA_ALONG_GEOMETRY
- SET_SCREEN_SHAKE
- SCREEN_FADE_OUT
- SCREEN_FADE_IN
Script Control
Set a specific on_tick
or on_interact
script, run another script, or recursively copy the actions inside another script.
- RUN_SCRIPT
- GOTO_ACTION_INDEX
- COPY_SCRIPT
- SET_MAP_TICK_SCRIPT
- SET_ENTITY_INTERACT_SCRIPT
- SET_ENTITY_TICK_SCRIPT
- SET_ENTITY_LOOK_SCRIPT
- SET_SCRIPT_PAUSE
Entity Choreography
Move entities around the map using vector objects placed with Tiled.
NOTE: These actions can behave erratically if any of the vertices in the geometry object are subject to coordinate underflow.
- SET_ENTITY_PATH
- TELEPORT_ENTITY_TO_GEOMETRY
- WALK_ENTITY_TO_GEOMETRY
- WALK_ENTITY_ALONG_GEOMETRY
- LOOP_ENTITY_ALONG_GEOMETRY
Entity Appearance
Many of these actions (the ones that don't have an explicit duration) will happen instantly. Therefore, if several are used back-to-back, they will all resolve on the same frame. If this is not intended behavior, you should pad them with non-blocking delay.
- PLAY_ENTITY_ANIMATION
- SET_ENTITY_CURRENT_ANIMATION
- SET_ENTITY_CURRENT_FRAME
- SET_ENTITY_DIRECTION
- SET_ENTITY_DIRECTION_RELATIVE
- SET_ENTITY_DIRECTION_TARGET_ENTITY
- SET_ENTITY_DIRECTION_TARGET_GEOMETRY
- SET_ENTITY_MOVEMENT_RELATIVE
- SET_ENTITY_GLITCHED
Set Entity Properties
Set a specific property on a specific entity.
- SET_ENTITY_NAME
- SET_ENTITY_X
- SET_ENTITY_Y
- SET_ENTITY_TYPE
- SET_ENTITY_PRIMARY_ID
- SET_ENTITY_SECONDARY_ID
- SET_ENTITY_PRIMARY_ID_TYPE
Set Variables
Manipulate MGE variables or set them to an arbitrary value.
Check Entity Properties
These actions check whether one of an entity's properties matches a specific state. If the condition is met (or not met), then the script will jump: either to a specific point in the same script or the top of an entirely different script.
You can use %SELF%
to target the entity running the script and %PLAYER%
to target the player entity. Otherwise, you must use the entity's given name (its name in Tiled).
You can use the condition portion of these following actions with if and else.
- CHECK_ENTITY_NAME
- CHECK_ENTITY_X
- CHECK_ENTITY_Y
- CHECK_ENTITY_INTERACT_SCRIPT
- CHECK_ENTITY_TICK_SCRIPT
- CHECK_ENTITY_LOOK_SCRIPT
- CHECK_ENTITY_TYPE
- CHECK_ENTITY_PRIMARY_ID
- CHECK_ENTITY_SECONDARY_ID
- CHECK_ENTITY_PRIMARY_ID_TYPE
- CHECK_ENTITY_CURRENT_ANIMATION
- CHECK_ENTITY_CURRENT_FRAME
- CHECK_ENTITY_DIRECTION
- CHECK_ENTITY_GLITCHED
- CHECK_ENTITY_PATH
- CHECK_IF_ENTITY_IS_IN_GEOMETRY
Check Variables
Check whether one of the MGE variables matches a specific value. If the condition is met (or not met), then the script will jump: either to a specific point in the same script or the top of an entirely different script.
You can use the condition portion of these following actions with if and else.