Skip to main content

Scene & Flow Control

Functions related to controlling UI and the active scene.

SetScene
name
  • name (string) - the asset name of the new Scene to load.
Switches to a different scene. In order: the new scene will be loaded, the current scene's LeaveScript will be executed, the new scene is made active, and the new scene's EnterScript is executed. Note that SetScene will terminate the currently running script, so any instructions coming after it will not run.
SetLocation
name
  • name (string) - the user-friendly name of the player's location.
Sets the text displayed above the compass. It is intended to be used to show the player's current location, though it is not technically limited to that. This string is also shown in the player's save game.
SetInstruction
name
  • name (string) - a user-facing text string.
Sets the default tooltip text displayed above the choice buttons, if no other tooltip is currently active. This is reset back to an empty string after every player turn.
SetInventoryEnabled
mode
  • mode (boolean) - true if enabled, false if not.
Sets whether or not the player can access their Character Sheet. If true, access is allowed, if false, the button will be greyed out. The setting will last until this function is called again, and is stored in save data.
enum 
ECompass
.North
the 'N' compass button
.West
the 'W' compass button
.South
the 'S' compass button
.East
the 'E' compass button
AddLink
direction
link
  • direction (ECompass) - target compass direction
  • link (string or function) - if string: name of scene asset to link to. if function: a callback that takes no parameters
Creates a compass link button. The button remains until the next Choice the user makes. Compass links can link either directly to a scene, as if SetScene is called when the button is pressed, or can contain a Lua script which will run when the button is pressed.
Sleep
seconds
  • seconds (number) - time in seconds during which to pause.
Pauses execution of the script for the specified time. Dramatic pause, oh my!
IsDevModeEnabled
  • (boolean) - true if dev mode on, false otherwise
Checks whether Developer Mode is enabled. Dev Mode is enabled by clicking the Launch Dev Mode option in the Editor, or passing the '-dev' command line option to the game.