-
Notifications
You must be signed in to change notification settings - Fork 3
Gameflow2
Adalid Claure edited this page Sep 17, 2025
·
1 revision
This scripting language defines low-level commands to control NPC behavior in a survival-horror strategy game. It is stack-based, flag-driven, and uses CLI-style flow control with jump labels. This language is primarily intended as an internal backend for a Visual Programming Language (VPL) interface and content authoring.
-
PUSHβ Push a value onto the stack (e.g.,$CURRENT_LOCATION) -
POPβ Pop the top of the stack into a register or discard -
SETβ Assign a value to a register (e.g.,SET $R0 1) -
CLEARβ Clear/reset a register or flag -
ADDβ Add two values and store the result (e.g.,ADD $R0 1 -> $R0) -
INCRβ Increment a value (syntactic sugar forADD)
-
LABELβ Define a jump target (e.g.,LABEL:retry) -
JUMPβ Unconditional jump to label (e.g.,JUMP retry) -
JUMP_IFβ Jump to label if a flag/register is truthy (e.g.,JUMP_IF $FLAG0 success) -
JUMP_UNLESSβ Jump to label unless a flag/register is truthy -
JUMP_IF_NULLβ Jump to label if a register is null or empty -
GOTOβ Move NPC to a location or point in the world
-
CALLβ Invoke a method on a system variable or item (e.g.,CALL $EQUIPPED_ITEM "pull_pin") -
EQUIPβ Equip a specific item from inventory (e.g.,EQUIP [Grenade]) -
DROPβ Drop a held or equipped item -
FINDβ Search for an item in the environment (sets$FOUND,$FOUND_LOCATION)
-
DEFINE_LISTβ Define a named list of strings (e.g.,DEFINE_LIST $SEARCH_POINTS "Point1" "Bathroom") -
GET_FROM_LISTβ Get an entry at index from list (e.g.,GET_FROM_LIST $SEARCH_POINTS $R0 -> $R1) -
POP_FROM_LISTβ Pop and retrieve the top of a list (LIFO-style) -
LOAD_SEARCH_POINTβ Retrieve a search point by index (optional legacy op)
-
$R0,$R1, ... β General-purpose registers -
$FLAG0,$FLAG1β Boolean flags -
$FOUNDβ Boolean, set byFIND -
$FOUND_LOCATIONβ Position set by successfulFIND -
$RETβ Return label for simulated call-return flow
PUSH $CURRENT_LOCATION
DEFINE_LIST $SEARCH_POINTS "Point1" "PointB" "Bathroom"
SET $R0 0
SET $RET end_search
JUMP search_loop
LABEL:search_loop
GET_FROM_LIST $SEARCH_POINTS $R0 -> $R1
JUMP_IF_NULL $R1 end_search
GOTO $R1
FIND [Grenade]
JUMP_IF $FOUND found_grenade
ADD $R0 1 -> $R0
JUMP search_loop
LABEL:found_grenade
GOTO $FOUND_LOCATION
EQUIP [Grenade]
CALL $EQUIPPED_ITEM "pull_pin"
GOTO "Enemy Camp"
CALL $EQUIPPED_ITEM "throw"
DROP $EQUIPPED_ITEM
POP -> $R1
GOTO $R1
LABEL:end_search
GOTO "Home"
0