Skip to content
On this page

All commands list

Commands list

Dialog

CommandExampleDescription
talktalk player idle "Hello everyone"Makes a character talk in a specific pose
thinkthink player idle "I wonder if they like me"Makes a character think in a specific pose (think is the same as talk but without quotes around)
text command (Empty command)"Hello world"Writing text without a command will print that text as if it was said "by the game", without a character

Basic program flow

CommandExampleDescription
jumpjump myLabelJumps to a label (stops current script)
runrun myLabel [arg1] [arg2] [...] // Returns whatever the label returned, if anythingRuns a label as a function with optional arguments passed to it, then continues back where the script was
returnreturn $testReturns a value. Exits the current label and returns the first argument
if


if $data.hasFood:
"I have food, so we can eat a meal!"
else:
"We have nothing to eat"

Runs a condition on the passed value. If the condition is true, the first branch is run. Otherwise, an optional else: branch can be provided for what to run when the condition fails

Choices

CommandExampleDescription
choice


choice:
"Would you like tea?"
"Yes":
"Your friend serves you a cup of tea"
"No":
"Your friend makes tea for themselves"

Lets the player choose between two or more options. See the linked documentation for more info.
text_fieldtext_field "A prompt text""Creates a text field for the player to enter text with a prompt. Returns the text entered

Logic operators and conditions

CommandExampleDescription
== ,>, <, <=, >=, !=== 5 5 // Returns trueComparison operators to check if things are equal/unequal/lower than/etc
!

if (! $data.doorOpen):
"The door is closed"

Negates a value
&&, ||if (|| $data.doorOpen $data.hasKey):And and Or logical operators
?var isDead (? (<= $data.life 0) true : false)Ternary operator

Math and arithmetic

CommandExampleDescription
++ 1 2 // Returns 3Adds numbers passed as arguments
-- 2 1 // Returns 1Substracts the first number passed with the others
** 2 3 // Returns 6Multiplies the numbers together
// 1 2 // Returns 0.5Divides the first number by the others, in sequence
minmin 100 50 // Returns 50Returns the smallest value passed
maxmax 50 100 // Returns 100Returns the highest value passed
clampclamp 0 100 $data.playerHealth If playerHealth is below 0, return 0. If playerHealth is between 0 and 100, returns it. If playerHealth is over 100, returns 100Returns the third value passed, constrained between a minimum and maximum value passed as the first two parameters
floorfloor 0.75 // Returns 0Rounds a number, rounding down
ceilceil 0.25 // Returns 1Rounds a number, rounding up
roundround 0.5 // Returns 1Rounds a number to the nearest integer
sqrtsqrt 4 // Returns 2Returns the square root of a number
^^ 3 2 // Returns 4Returns the first number to the power of the second number

Audio

CommandExampleDescription
playplay music myMusic [channel]Plays the music myMusic in the mode music (possible modes: music, ambiance, sound), with an optional channel number
pausepause music [channel]Pauses a music mode with an optional channel number
stopstop music [channel]Same as pause but stops

Items

CommandExampleDescription
add_itemadd_item bread 1Adds an amount of an item to the player
remove_itemremove_item bread 1Removes an amount of an item
has_item?


if (has_item? bread 1):
"Let's eat bread!"

Returns true if there is enough of the item
item_amount?item_amount? bread // returns the amount of breadReturns the amount of an item the player has
enable_interactionenable_interaction mytagEnables an interaction tag (see docs)
disable_interactiondisable_interaction mytagDisables an interaction tag (see docs)

Notifications

CommandExampleDescription
notifynotify "Hello world"Adds a notification to the game
disable_notificationsdisable_notificationsDisables all notifications
enable_notificationsenable_notificationsEnables notifications

Quests

CommandExampleDescription
start_queststart_quest myQuestStarts a quest
complete_questcomplete_quest myQuestCompletes a quest
[`start_objective`](../features/quests.md)start_objective myQuest myObjectiveStarts an objective in a quest (useful for quests with hidden objectives)
complete_objectivecomplete_objective myQuest myObjectiveCompletes an objective
quest_completed?quest_completed? myQuest returns true or falseCheck if a quest is completed
objective_completed?objective_completed? myQuest myObjective returns true or falseCheck if a quest objective is completed
quest_started?quest_started? myQuest // Returns true or falseCheck if a quest is started
objective_started?objective_started? myQuest myObjective // Returns true or falseCheck if a quest objective is started

Random

CommandExampleDescription
randomrandom 0 100 // Returns a random integer between 0 and 100Returns a random integer between two numbers passed (inclusive)
random_floatrandom_float 0 100 // Returns a random float between 0 and 100Returns a random float between two numbers passed (inclusive)
random_from_argsrandom_from_args 1 2 3 4 5 // Returns a random argument passedReturns a random argument passed
random_from_arrayrandom_from_array $data.myArray // Returns a random element from the arrayReturns a random element from an array

Viewport screen and buttons

CommandExampleDescription
set_screenset_screen myScreen [layer]Sets the screen to a screen with the given ID with an optional layer number (default 0)
empty_layerempty_layer 0Removes all items from a layer
set_buttonset_button myButton truechanges the value of a button (true, false, hidden) ID

Variables

CommandExampleDescription
setset data.playerHealth 100Sets a variable to a value
addadd data.playerHealth 10Adds a value to a variable
varvar test 3Declares a local variable with a value. The variable will only exist in the current label and will stop existing once the label is exited.

Skills

CommandExampleDescription
add_leveladd_level agility 1Adds levels to a skill
set_levelset_level agility 1Sets the level of a skill
add_xpadd_xp agility 10Adds experience to a skill
get_levelget_level agilityGets the level of a skill
get_xpget_xp agilityGets the experience of a skill
rollroll mySkillCheck agility 50 // Returns true or falseRuns a skill check with a certain difficulty against a skill dice
reset_rollreset_roll mySkillCheckResets a skill check

Stats

CommandExampleDescription
add_statadd_stat myStat 10Adds a value to a stat
set_statset_stat myStat 10Sets a stat to a value
get_stat_valueget_stat_value myStatGets the value of a stat

Arrays

Imagine $data.myArray contains an array with [25, 50, 75]

CommandExampleDescription
newset data.myArray (new Array)Creates an array
pushpush $data.myArray 100Adds a value at the end of an array
poppop $data.myArray // Returns 100Removes the last value of an array, returning it
shiftshift $data.myArray // Returns 25Removes the first value of an array, returning it
array_joinarray_join $data.myArray ", " // Returns "25, 50, 75"Joins an array into a string, with the first parameter being the separator to use
array_concatarray_concat $data.myArray $data.myArray2 // Returns [25, 50, 75, 100, 125]Concatenates two arrays
includesincludes $data.myArray 25 // Returns trueChecks if an array includes a value
reversereverse $data.myArray // Returns [75, 50, 25]Reverses an array
sliceslice $data.myArray 1 2 // Returns [50, 75]Returns a slice of an array, with the first parameter being the start index and the second being the end index
splicesplice $data.myArray 1 2 // Returns [50, 75]Removes a slice of an array, with the first parameter being the start index and the second being the number of elements to remove. Returns the sliced elements
random_from_arrayrandom_from_array $data.myArray // Returns a random element from the arrayReturns a random element from an array
shuffleshuffle $data.myArray // Returns a shuffled arrayShuffles an array

Time

CommandExampleDescription
time_nowvar now (time_now) // returns current time in msReturns the current unix timestamp in miliseconds
total_playtimevar time_played (total_playtime)Returns the current total playtime for this save file
session_playtimevar time_played (session_playtime)Returns the current session playtime
to_daysvar days (to_days 100000)Converts a time in ms to days
to_hoursvar hours (to_hours 100000)Converts a time in ms to hours
to_minutesvar minutes (to_minutes 100000)Converts a time in ms to minutes
to_secondsvar seconds (to_seconds 100000)Converts a time in ms to seconds

Strings

CommandExampleDescription
concatconcat "Hello" "World"Concatenates two or more strings
joinjoin ", " "Hello" "World"Joins x strings, with the first character being the join string between them

Screen Objects

Screen objects are new and not documented yet, basic usage is to put the result of create_sprite or create_object in a variable and then manipulate it. Example:

set data.playerSprite (create_sprite img/player.png 50 50)
wait 1000
set data.playerSprite.x 100 // moves the player to x 100
wait 1000
delete_sprite $data.playerSprite
1
2
3
4
5
CommandExampleDescription
create_spritecreate_sprite img/character.png 55 125Creates a sprite using an image at a position
create_objectcreate_object 55 125Creates an object at a position
delete_spritedelete_sprite $mySpriteDeletes a sprite (stored in a variable)

Others

commandexampledescription
clear_dialogclear_dialogClears the dialog panel
loglog "what's the value of test? %{test}" // Will print this log in the consolePrints a log in the browser developer tools. Useful for debugging or checking variable values
menu_returnmenu_returnExits the game and returns to the main menu
savesave [save file name]Opens the manual save screen for the player to save the game (optional parameter for the name of the save file, useful to pass the name of the level/chapter for example)
save_promptsave_prompt [save file name]Same as save, but asks the user if they want to save first
waitwait 500Makes the script pause for x milliseconds
load_dataset data.myData (load_data data/myDataFile.yaml)Loads data from the data file path passed and returns it