Scripting
Your Turn To Thrive ships with the following mechanics built in.
Backgrounds & CGs
bg (name: string)
filter?: "gaus"
speed?: number
daemon?: &
Ex. bg background filter=gaus speed=1 &
Displays a background.
cg (name: string)
filter?: "gaus"
speed?: number
daemon?: &
Shows a cg and "unlocks" it.
place (name: string)
x: number
y: number
Ex. place Door x=200, y=200
Places an object at x, y.
Objects
onclick (name: string)
Adds an onclick listener to a background object or character to use in branching dialogue paths.
delclick (name: string)
Removes an onclick listener off an object of name string.
set (variable: string, to: string)
Sets a variable to a string. Numbers etc. are turned into strings.
UI & Characters
show ui
topbar?
namebox?
heart?
speed: number
Shows UI at speed n (n0 = instant) with optional toggles for topbar, namebox, and heart.
show (name: string)
hide (name: string)
Music
sfx or music (name: string)
rate: number
vol: number
loop?
Starts song/sfx.
stop (name: string)
Stops song/sfx.
Runtime
wait (seconds: number)
Waits n number of seconds for next command.
health
set: number
change: number
tick: number
label (name: string)
Sets a label of name string.
tutorial (name: string)
Calls an on-screen tutorial, for example an arrow pointing to perception.
call (name: string)
Ex. call Panic
Calls a minigame.
jump (type: string, to: string)
type: string | "label" | "return" | "continue"
Jumps to a predefined label, otherwise jump to scene of name string.
if & else if
if variable1=string1 variable2=string2
else
Inventory
inventory add | sub (label: string)
Adds or subtracts an item from the inventory.