Home
Index
index
&&, || - Logical operators
+, -, *, /, % - Math operators
+=, -=, *=, /=, |=, &=, ++, -- - Assignment operators
==, !=, <, >, <=, >= - Comparison operators
TR(text) - Translates a raw line of text
_actorArrived(actor) - Called when an actor reaches their final destination.
_addYackChoice(index, text, label) - Called for each yack choice.
_beginYackChoices() - Called before choices are displayed.
_clickedDownAt(screen_pos, flags) - Called when the screen is clicked or touched.
_clickedDragAt(screen_pos, flags) - Called when the mouse is moved with the button down.
_clickedUpAt(screen_pos, flags) - Called when the mouse button is let up.
_doneSayline(actor) - Called when the actor's sayLine is done.
_endCuscene() - Called after the cutscene code has been stopped.
_endYack() - Called when a yack conversation is ending.
_endYackChoices() - Called when yack choices need to be cleaned up.
_enterObject(object) - Called for each object when entering a room.
_enterObject(object) - Called for each actor when entering a room.
_enterRoom(room, stage) - Called when the room is entered.
_exitObject(room, stage) - Called for each object or actor when exiting a room.
_exitRoom(room, stage) - Called when exiting a room
_gameFocus(state) - Called when the game gains or looses focus.
_hoverObject(state, object, room_pos) - Called when an object is hovered over.
_initObject(object) - Called only once when the object is inited.
_initRoom(room) - Called only once when the room is inited.
_keyDown(key, flags) - Called when a key goes down.
_keyUp(key, flags) - Called when a key comes up.
_overrideCuscene(state) - Called after the cutscene is overriden.
_pauseGame(state) - Called when the game is paused by the window going out of focus
_quitGame() - Called when the game wants to quit.
_selectedActorChanged(actor) - Called when the selected actor changes
_showYackChoices() - Called after all the choices have been added and when they are ready to be displayed.
_startCutscene() - Called right before the cut-scene code is called.
_startSayline(actor, text) - Called when sayLine text needs to be displayed.
_startYack(actor1, actor2) - Called when a yack conversation is started.
_triggerCallback(trigger, actor, code, state)(actor) - Called when an actor enters or leaves a trigger.
_triggerSound(actor,sound) - Called when an actor or object animation triggers a sound
a?b:c | a?:c - Trinary operators
abs(num) - Returns the absolute value of
num
actorAlpha(actor,alpha) | actorAlphaTo(object,alpha,time[,curve]) - Sets the actors alpha.
actorAt(actor,[room,]pos|object|actor) - TBD
actorColor(actor[,color]) - Sets or returns the actor's color.
actorCostume() | actorCostume(actor,costume) - TBD
actorDistanceTo(actor) - Returns the positon of an actor. If you want to set the position of an actor, use
actorAt
actorFace(actor,pos|dir|object|actor) - Instantly turn to the
pos
,
dir
,
object
or
actor
actorFacing(actor) - Returns the direction an actor is facing.
actorFastWalk(actor,state) - Returns or turns on and off fast walking.
actorHideLayer(actor,layer[,state=true]) - TBD
actorLockFacing(actor,ok_dirs) - Locks the facing of an actor to the direction bits in ok_dirs.
actorOffset(actor,point) | actorOffsetTo(object,point,time) | actorOffsetTo(object,point,time,curve) - Sets the actors offset. The offset does not change render or sorting order.
actorPos(actor) - Returns the position of the actor in the room
actorPosition(actor) - Returns the positon of an actor. If you want to set the position of an actor, use
actorAt
actorRemapAnimation(actor,remap_table|null) - Remaps animatons names based on the remap_table
actorScale(actor,scale) | actorScaleTo(object,scale,time) | actorScaleTo(object,scale,time,curve) - Sets the actors scale.
actorShowLayer(actor,layer[,state=true]) - TBD
actorStopWalking(actor) - Stops an actor that is walking.
actorTurnTo(actor,pos|dir|object|actor) - Turn to the
pos
,
dir
,
object
or
actor
over 2 frames.
actorUseLighting(actor|object, state) - Sets an
actor
to be lit by
room
lighting.
actorUsePos(actor,pos[,facing]) | actorUsePos(actor[,facing]) - Sets or returns the use position for an actor.
actorUsePos2(actor,pos) | actorUsePos2(actor) - Sets or returns the use position for an actor.
actorUseWalkboxSet(actor,set) - Assigns the walkboxes
set number
for the actor use.
Zero
will disable using walkboxes.
actorWalkForward(actor,dist) - Walks an actor forward
dist
pixels.
actorWalkTo(actor,pos|object|actor[,dir]) - Walks an actor to the
pos
,
object
or
actor
and then faces
dir
.
addTrigger(trigger, func) - Returns the id of the new trigger added to the room.
addconsolebutton(color, title, command) - Adds a button to the debug console to execute a command when pressed
addprivatepref(key, value) - Adds
value
to the private pref with
key
ambientLight([room,]color) - Set the ambient light for a room.
appendfile(filename, string) - Appends the
filename
with a
string
areChoicesShowing() - Returns
true
if yack choices are showing and waiting for input.
array - An array of values.
array() | array(size,value=null) - Returns a new array of
size
elements filled with 'value'
arrayadd(array, value) - Appended
value
to the end only if it doesn't already exist in the array.
arrayappend(array, value) - Appends
value
to the end of an array.
arrayapply(array, function) - Returns an array after applying
function
to each element
arraycount(array) | arraycount(array,value) - Returns the number of
non-null
elements in the
array
arrayextend(array, array2) - Appends
array2
to the end of
array
.
arrayfilter(array, function) - Returns a new array that has been filtered with
function
arrayfind(array, value) - Returns the index of
value
in
array
arrayfindremove(array, value) - Removes
value
from an array.
arrayfirst(array) - Returns the first element of an array
arrayinsertafter(array, index, value) - Insert
value
into an array after
index
arrayinsertbefore(array, index, value) - Insert
value
into an array before
index
arraylast(array) - Returns the last element of an array
arrayprepend(array, value) - Prepends
value
to the beginning of an array.
arrayremovefirst(array) - Removes the first element of an array
arrayremoveindex(array, index) - Removes
index
from an array.
arrayremovelast(array) - Removes the last element of an array
arrayresize(array,size,value=null) - Resizes an array to
size
elements
arrayshuffle(array) - Randomly shuffles an array
arraysort(array[,func=null]) | arrayrsort(array[,func=null) - Sorts an array in place
as_float(value) - Returns the
value
as a
float
as_int(value) - Returns the
value
as a
int
as_point(x,y) | point(x,y) - Returns a
point
with
x
and
y
coordinates`
as_string(value) - Returns the
value
as a
string
assetexists(assetname) | assetexists(sheet, image) - Returns
true
if the asset exists.
bounceInventory(object) - Bounces an object in the inventory
break, continue - breaks out of or continues a
for
,
foreach
,
while
, or
until
loop
breakhere(frames=1) - Breaks (or yelds) a thread until the next frame.
breaktime(duration) | breaktime(from,to) - Breaks (or yelds) a thread for
duration
seconds.
breakwhileanimating() - Breaks while an actor or object is animating.
breakwhileinputoff(sound_id) - Breaks a thread while the input is off.
breakwhilerunning(thread_id) - Breaks while the thread with
thread_id
is running.
breakwhilesound(sound_id) - Breaks a thread while a sound is playing
breakwhiletalking(actor) - Breaks a thread while an actor is talking.
breakwhilewalking(actor) - Breaks a thread while an actor is walking.
breakwhileyacking() - Breaks while a Yack dialog is running.
cameraAt(point|object|actor) - The camera is positioned at a
point
,
object
, or
actor
cameraFollow(actor[,snap_camera) - The camera starts following an actor
cameraOffset(actor, point) - Offset from the actor the camera uses when following the actor.
cameraZoom(factor) - The zooms the camera around the screen center.
cameraZoomFromTo([type,]time,start,end) - Smoothly zooms the camera from
start
to
end
over
time
seconds.
cancelAllInteractions() - Cancels all drags and sentences.
cancelSentence(actor) - Cancels any sentence queued for the actor
chr(ch) - Converts an ascii
int
to a
string
char.
clamp(num,lower,upper) - Clamps
num
between
lower
and
upper
clampInWalkbox(pos[,pos2]) - Finds a point that is clamped in walkboxes.
clone(table|array) - Returns a shallow clone of the
table
or
array
compilestring(string) - Compiles a string into a callable function.
cos(angle) - Returns the
cos
of an angle.
createActor(key, actor_table[,anim_file) - TBD
createActor(key, actor_table[,anim_file) - TBD
createButton(id,image,parent,code) - Creates a button based on an
image
parented to
parent
calling
code
when clicked/touched.
createFont(name,size) - Creates and returns a font from a .ttf at the given
size
createImage(sheet,image[,point])|createImage(image)|createImage() - Creates and optionally positions an image.
createObject() | createObject(image) | createObject(sheet,image) - TBD
createTextImage(font,text,flags) - Creates a text image
cutscene(func[,override]) - Starts a cut-scene with an option override function.
cutsceneDoOverride() - Causes the override code to be called.
defineRoom(table) - Defines a room using
table
as it's code.
defineSound(path) - defines a sounds based on a FMOD sound path
string
defineYack(name) - Call once from defineYacks.dinky
deleteImage(image) - Deletes an
image
and return
null
deleteImagesChildren(image) - Deletes the children of
image
, but not the
image
distance(p1,p2) - Returns the distance between two numbers or
points
do{ ... }until(expr) | do{ ... } -
dumpstack() - Dumps the call stack to the debug console
dumpvar() - Dumps a variable to the debug console
enableTrigger(trigger_id, state) - Enable or disables a trigger based on
state
endYack() - Ends a .yack file conversation.
enterRoom(room|object[,door]) - Causes the game to enter a new room
error([value, ...]) - Throws an error and prints the
string
execSentence(actor, verb, noun1, noun2=null) - Called to execute a sentence and, if needed, start the actor walking.
exitRoomFromDoor(from_door, to_door) - Call when you need to leave a room from one door to another door.
findActorAt(pos) - Returns a touchable actor at the room cordinates.
findActorObjectAt(pos) - Returns a touchable actor or object at the room cordinates.
findButtonAt(screen_pos) - Finds a button created with createButton and returns the
id
or null if not found
findObjectAt(pos) - Returns a touchable object at the room cordinates.
findRoom(name|id|room) - Returns a room from it's name, id or table.
flipDir(dir) - Returns a 180 deg flip of a direction.
float - A 32 bit floating point number
fontProps(font,props_table) - Alter various properties of a font.
for(assignment, expr, expr) - This standard c-style
for
for(var = start .. end) - Loops
var
from
start
to
end
foreach(key, var in table) - Loops through all the keys and values in
table
foreach(var in array) - Loops though all the elements of
array
foreach(var in table) - Loops through all the keys of
table
format(format, ...) - Returns a formatted string
freezeGame([state]) - Freezes the game or returns the freeze state.
function - A value that is a pointer to a function
gameFullscreen([state]) - If passed
state
changes fullscreen mode, otherwises returns screen state.
gametime() - Returns the number of seconds the game has been running.
getInventory(actor=null) - Returns the inventory array for an
actor
, or
null
if they don't have one.
getValue(value) - Returns a
value
that is
value
or
value()
getprivatepref(key, default=null) - Returns a private pref for
key
.
getuserpref(key, default=null) - Returns a user pref for
key
.
if, else -
imageAlign(image,alignment) - Aligns an
image
by
alignment
imageAlpha(image,alpha) - Sets the
alpha
of an image and all it's children.
imageAlphaFromTo(image,time,from,to) - Changes
alpha
over
time
seconds.
imageAt(image,pos) | imageAt(image) - Positions or returns the position of an image
imageColor(image,color) - Set an image and it's children to a color.
imageFilter(image,filter) - Turns on or off nearest neighbor filtering
imageHide(image,state) - Hides or shows an image based on
state
imageMoveFromTo(image,type,time,start,end) - Moves an
image
from
start
to
end
points
imageParentChild(parent_image,child_image)" - Makes
child_image
a render child of
parent_image
imagePushPopFrozen(state) - Pushes or pops the frozen state of all images.
imageQuickPop(image,time,amount) - Does a quick pop of the
image
over
time
seconds by
amount
imageReplaceText(image,text) - Replaces the text of a text image
imageRotate(image,angle) - Rotates an image by
angle
degrees
imageScale(image,scale) | imageScale(image,point) - Scales an
image
by
scale
or with
point.x
and
point.y
imageScaleFromTo(image,time,from,to) - Scales an
image
over
time
seconds
imageScissor(image,x,y,dx,dy) - Scissor (crop for display) an image based on screen coordinates.
imageSize(image) - Returns the size of an image as a
point
imageSort(image,sort) | imageSort(image) - Sets or returns an image sorting order
imageTextClip(image,clip) - Sets the clipping (in characters) of a text image.
imageTextDropShadow(image,offset,color) - Sets the drop shadow offset and color of a text image.
imageTextOutline(image,color) - Sets the outline color of a text image.
imageTouchable(image,state) - The button of this image is set to touchable
state
imageWiggle(image,time,amount,loops) - Wiggles an
image
over
time
seconds
loop
times.
inCutscene() - Returns
true
or
false
if there is a cutscene running.
inInventory(object, actor=null) - Returns
true
if the object is in the
actors
inventory.
inputOff(code) - Turns the input off, runs the code, and then back on
inputState([state]) - Set or get the current input state.
int - A 32 bit integer value from
2,147,483,648
to
-2,147,483,644
isActor(actor|object) - Returns
true
if the object is an actor.
isActorInRoom(actor[,room]) - Returns
true
if the
actor
is in
room
or the selected actor and current room if ommited.
isActorInTrigger(actor, trigger) - Returns
true
if the
actor
is in the
trigger
.
isActorTalking(actor) - Returns
true
if the actor is talking.
isActorWalking(actor) - Returns
true
if the actor is walking.
isSoundPlaying(sound_uid) - returns
true
or
false
if the sound is playing
isYacking() - Returns
true
if a yack conversation is happening.
is_array(value) - Returns
true
if
value
is a
array
is_float(value) - Returns
true
if
value
is a
table
is_function(value) | is_function(value, param_count) - Returns
true
if
value
is a
function
and takes
param_count
parameters (if supplied).
is_int(value) - Returns
true
if
value
is a
int
is_number(value) - Returns
true
if
value
is a
float
or
int
is_point(value) - Returns
true
if
value
is a
point
is_string(value) - Returns
true
if
value
is a
string
is_table(value) - Returns
true
if
value
is a
table
iskeydown(key) - Returns
true
if the
key
is being held down.
lerp(v1,v2,time) - Returns the linear interpolation between
v1
and
v2
base on
time
loadSoundBank(name) - Loads a FMOD sound bank.
loadarray(assetname) - Returns an
array
of
strings
from a file.
loadtsvarray(assetname) - Returns an array of a .tsv file.
loadtsvtable(assetname,percents=false) - Returns a table of a
.tsv
file.
loglevel(level) - Sets the current logging output level.
max(num1, num2) - Returns the highest of
num1
and
num2
microtime() - Returns the number of milliseconds seconds the game has been running.
min(num1, num2) - Returns the lowest of
num1
and
num2
null - A null or empty value.
objectAlpha(actor,alpha) | objectAlphaTo(object,alpha,time[,curve]) - Sets the objects alpha.
objectAt(object,pos) - TBD
objectAttachToLayer(object,layer) - Attaches an object to a parallax layer.
objectForID(id) - Returns a object
table
for the given
int
id.
objectHidden(object,state)| objectHidden(object) - Sets or returns an objects hidden state.
objectHotspot(object, lower_left, upper_right) | actorHotspot(actor, lower_left, upper_right) - Sets to rect for the actor or object hotspot centered on the position.
objectOffset(object,point) | objectOffsetTo(object,point,time) | objectOffsetTo(object,point,time,curve) - Sets the objects offset. The offset does not change render or sorting order.
objectPosition(object,point|object|actor) - Returns of sets the position of an objct
objectScale(actor,scale) | objectScaleTo(object,scale,time) | objectScaleTo(object,scale,time,curve) - Sets the objects scale.
objectState(object,state[,instant])| objectState(object) - Plays the animation
state
and sets the internal
state
to that.
objectTouchable(object,state)| objectTouchable(object) - Sets or returns an objects hidden state.
objectUseDir(object) - Returns the use direction, as defined in Wimpy.
objectUseDir2(object) - Returns the secondary use direction, as defined in Wimpy.
objectUseLighting(actor|object, state) - Sets an
object
to be lit by
room
lighting.
objectUsePos(actor,pos[,facing]) | objectUsePos(actor[,facing]) - Sets or returns the use position for an objct.
objectUsePos2(actor,pos) | objectUsePos2(actor) - Sets or returns the use position for an objct.
onKeyYack(key, flags) - Called when a key is pressed while yack choices are showing.
ord(string) - Converts the first character of a
string
into an ascii
int
overlayColor(color) - Sets the screen overlay color.
overlayColorTo - Changes the overlay to
color
over
time
seconds.
overlayFlashColor(color,time) - Flashes an overlay
color
for
time
seconds.
pauseAllSounds(group="master", state) - pauses all sounds in the
group
pauseGame([state]) - pauses the game or returns the pause state.
pickupObject(object, actor=null) - Picks up an inventory object.
playAnimation(actor,animation[,loop]) - Plays the animation
animation
and loops is set.
playAnimation(object,animation[,loop]) - Plays the animation
animation
and loops is set.
playSound(name|sound_id[,global]) - plays a sound given a
name
or
sound_id
playSoundAt(sound_uid,point) - Plays a sounds at a location.
playSoundVolume(sound_uid,volume) - Plays a sound at a specified
volume
point - A point value of two floats.
pow(num1,num2) - Returns
num1
to the power of
num2
print([value, ...]) - Prints a string or list of values to the debug console.
printlog(level, value, [value, ...]) - Prints to the debug console at a log level of
level
quitGame() - Quits the game and saves all Pref files.
quitgame() - Quits the game cleanly.
random(start,end) - Returns a random number between
start
and
end
inclusively.
randomfrom(array|table) | randomfrom(item, item, ...) - Returns a random element from a
table
or
array
or a item from a list.
randomodds(odds) - Returns
true
or
false
based on the
odds
randomseed(seed) | randomseed() - Seeds the random number generator with 'seed' or returns the current seed
refreshUI(state) - Causes the game UI to refresh.
regexcapture - Captures matches in a previously compiled regex
regexcaptureall - Capture all the matches in a string to an array
regexcompile - Compiles a regular expression for future use
regexfree - Release a previously compiled regex
regexmatch - Returns the number of matches found.
registerVerbs(object) - Call if you add or remove verbs outside of room.preEnter()
removeInventory(object, actor=null) - Removes an object from the actors inventory and refreshes the UI
removeTrigger(object|id) - Removed a trigger from the room
return | return `expr` - Returns from a
function
passing an optional value
roomForID(id) - Returns a room
table
for the given
int
id.
roomLayer(room, layer, state) - Show or hide a room layer.
roomLightEnable(id, state) - Enables or disables a room light.
roomLightPosition(id, pos|object) - Set the position of a light for a room.
roomSize(room) - Returns the size of a room based on it's image size.
roomToScreen(point) - Returns the screen coordinates of a
point
in the current room.
roottable() - Returns the root table
sayLine() | sayLine(text) | sayLine(actor,text) - Causes the actor to start talking using
text
.
screenToRoom(point) - Returns the room coordinates of a
point
on the screen.
setdelegate(table, table2) - Sets a delegate for the table for when a
key
doesn't exist.
setprivatepref(key, value) - Sets the private pref for
key
to
value
setuserpref(key, value) - Sets the user pref for
key
to
value
sin(angle) - Returns the
sin
of an angle.
sizeof(value) - Returns the size of a
string
,
array
or
table
slideInventory(object) - slides an inventory item on and off screen is the inventory is not showing.
soundListenerAt(point) - Sets the sound listener position.
soundMixVolume(name,volume) | soundMixVolume(name) - Sets or gets the mix volume for a group of sounds.
soundParam(sound_uid,name,value) - Sets a FMOD sounds parameter for a given playing
sound_uid
.
soundVolume(name,volume) | soundMixVolume(name) - Sets or gets the volume for a group of sounds.
startYack(actor1,actor1,filename) - Starts a .yack file conversation between 2 actors.
startglobalthread/startthread([this_table, ]function, [param, ... ]) - Starts a new thread using
function
and passing the
params
stopAllSounds(group="master") - Stops all sounds in a given
group
.
stopLocalSounds() - Stops all sounds not started with GLOBAL flag.
stopSound(sound_uid) - Stops a playing sound given a
sound_uid
.
stopthread(thread_id) - Stops a thread based on a unique thread id.
strcount(string, needle) - Returns the number of times
needle
is found in
string
.
strendswith(string, tail) - Returns
true
if
string
ends with
tail
strfind(string, needle) - Returns zero based index of
needle
in
string
strfindi(string, needle) - Returns zero based index of case insensitive
needle
in
string
strfirst(string) - Returns the first character of a
string
strguid(type, length=32) - Returns a random GUID of
type
and
length
strhash(string) - Returns 32-bit hash of the string
string - a string of characters
stringreplace(string, find, replace) - Returns a copy of string with
find
replaced with
replace
strjoin(array, glue) - Returns a
string
of an array of
strings
joined with the
glue
strlast(string) - Returns the last character of a string
strlen(string) - Returns the length of the string
strlines(string) - Returns an
array
of
strings
seperated by cr or lf.
strlower(string) - Returns a new string in all lowercase.
strseperate(string, markers) - Returns an
array
of
strings
seperated by any characters in
markers
strslice(string, start, end) - Returns a
string
sliced from index
start
to index
end
inclusivly.
strsplit(string, marker) - Splits a
string
into an array of
strings
strstartswith(string, head) - Returns
true
if
string
starts with
head
strtime(format, unixtime) - Returns a string of
unixtime
using
format
strupper(string) - Returns a new string in all uppercase.
syncprefs() - Syncs user and private prefs to the disk or cloud (if supported).
systemtime() - Returns the unix time for the device running the game.
table - A table contains multiple
key
and
value
entries.
threadid() - Returns the unique thread id of the currently running thread.
threadpausable(thread_id, state) - Marks a thread as pausable to unpausebale based on
state
threadpause(thread_id, state) - Pauses or unpauses a thread based on 'state'.
threadpauseglobal(state) - Pauses or unpauses all global threads
threadrunning(thread_id) - Returns
true
if the thread is running.
trace(state) - Turns on or off the tracing of source code.
useTranslation(language) - Change languages
validateSound(path) - Returns
true
if the sound
path
exists in the FMOD project.
walkboxHidden(name, state) - Sets a walkbox hidden state to
state
watchvar(var) - Opens up a debug window that live-watches the variable allowing values to be changed.
while(expr) { ... } -
yackActor1() - Returns the first party in a yack conversation.
yackActor2() - Returns the second party in a yack conversation.
yackChoice() - Call when the player makes a choice in a .yack file.
yackChoices() - Returns the number of yack choices showing
|, & - Bit-wise
~, ! - Unary operators
Copyright 2020 Terrible Toybox, Inc. All Rights Reserved.