List of internal commands
This page is a list of internal commands usable in Internal scripting. For a list of simplified commands, see List of simplified commands.
activateteleporter
activateteleporter
Make the first spawned teleporter in the room do its actively-teleporting animation, and change it to be the flashy teleporting color. This will happen even if the teleporter is already white (activeteleporter).
It matters which one of activateteleporter
or activeteleporter
is run first, even if they happen on the same frame.
Touching the first spawned teleporter after this command is run will not overwrite your tsave.vvv
in 2.2 and below (in 2.3 and later your telesave cannot be overwritten anyway), and a teleporter activity zone will not spawn.
Calling this command in a room with no teleporters will trigger undefined behavior in 2.2 and below, and do nothing in 2.3 and later.
activeteleporter
activeteleporter
Make the first spawned teleporter in the room light up, although it will not do the pulsating animation that an activated teleporter usually does. If the first spawned teleporter is already doing the pulsating animation and is doing the flashy teleport color (activateteleporter), then this command will make it white, but it won't stop its animation.
It matters which one of activeteleporter
or activateteleporter
is run first, even if they happen on the same frame.
Touching the first spawned teleporter after this command is run will still overwrite your tsave.vvv
in 2.2 and below (in 2.3 and later your telesave cannot be overwritten anyway), and a teleporter activity zone will still spawn. However, if this is run after activateteleporter
, then it won't overwrite your tsave.vvv
, and a teleporter activity zone will not spawn.
Calling this command in a room with no teleporters will trigger undefined behavior in 2.2 and below, and do nothing in 2.3 and later.
alarmoff
alarmoff
Turn the alarm off (see alarmon).
alarmon
alarmon
Turn the alarm on. More specifically, it periodically plays sound effect 19 (crashing.wav
), every 20 frames, until it is turned off.
It is temporarily paused when either the ESC/ENTER/teleporter screen or "Game paused" screen is up.
The alarm is turned off when the player exits to the main menu, or when alarmoff is called.
altstates
altstates
is plural, i.e. spelled with an S at the end.altstates (<state>)
Set the alt state to <state>
. By default, the alt state is 0
. Custom levels do not support alt states at all.
<state>
: The alt state to be set to. Different alt states will make different versions of rooms appear when you go to them in the main game map.1
- the version of the trinkets room in the ship with the giant trinkets warp
- the version of the Secret Lab spawn room with both obstructing pillars
2
- the version of the Secret Lab spawn room with one obstructing pillar destroyed
Note that the alternate version of Prize for the Reckless that removes the spikes to the trinket along with changing the roomname to "I Can't Believe You Got This Far" in No Death Mode or "Imagine Spikes There, if You Like" in Time Trials is not handled by alt states. Instead, the room is simply loaded differently if the game is in No Death Mode or in a Time Trial.
audiopause
audiopause (<state>)
Force-enable or disable the audio pause, regardless of the audio pause state in game options. By default, this is off, i.e. allow audio to keep playing during unfocus pause.
<state>
: The state to set the audio pause to. Eitheron
oroff
. Anything else has no effect.
This command is unused in the main game.
backgroundtext
backgroundtext
For the text box in memory, do not initiate an ACTION prompt when speak
or speak_active
is called.
befadein
befadein
Instantly undo a faded- or fading- in screen caused by fadeout, without the animation of fadein.
blackon
blackon
Turn off blackout mode (see blackout).
blackout
blackout
Turn on blackout mode.
In this mode, the screen will keep rendering on each frame whatever was rendered last on the screen. However things can still render on the screen and overwrite what's supposed to be frozen.
Most notably, text boxes will still appear, and in 2.2 and below, the "Game paused" screen will still render when the game is unfocused (but it no longer renders in 2.3 and later); but the text boxes always render on top no matter what. These text boxes include the activity zone prompts, the teleporter activity zone prompt and the teleporter "Game saved". As well, room text will always render onscreen.
The ESC screen brought up by pressing ESC, and pause screen and teleporter screen brought up by pressing ENTER will still render, but it seems that during their animations of being brought up or down, the background is a copy of the last ESC/ENTER/teleporter screen that was brought down. If an ESC/ENTER/teleporter screen hasn't been brought down, then it simply defaults to a solid black screen.
Additionally, the player's on-ground and on-roof flipping eligibility is unchanged while in this state. This means that if they are eligible to flip off the floor but not eligible to flip off of the ceiling at the time this command is run, they can always flip off of the floor, but never be able to flip off of the ceiling; and vice versa. Similarly, if they are neither eligible to flip off the floor or ceiling when this command is run, they will never be able to flip at all.
When used while the screen is shaking from shake and screen effects are enabled, the screen will turn completely black (as the name suggests), since the screen buffer is cleared while the screen is shaking. This is how the command is used in the main game, for the intro cutscene and the Secret Lab discovery cutscene.
This mode is turned off when the player exits to the main menu, or when blackon is called.
bluecontrol
bluecontrol
Run Victoria's activity zone script, which also creates Victoria's activity zone when finished.
changeai
changeai (<crewmate>, <behavior>, [position])
Set the behavior of a crewmate.
<crewmate>
: The identifier of thecreatecrewman
entity. See the section oncreatecrewman
identifiers.<behavior>
: Can be any of the behaviors from the following list:followplayer
followred
followyellow
followgreen
followcyan
followblue
followpurple
(this will actually follow the pink-colored entity)faceleft
faceright
panic
followposition
(requires field 3, "position", to specify position)
- The behaviors prefixed with "follow" (other than
followposition
) will make the crewmate try to get close to the x-position of the target crewmate or player, and the crewmate will not try anything in regards to reaching the y-position of the target crewmate or player.
faceleft
andfaceright
will do what their names say.
panic
will make the crewmate periodically move back and forth, like in the main game cutscene where the game shows you where the lost crewmates are in their respective rooms, and they're pacing back and forth and being all worried.
followposition
requires using the third field to specify the given position that the crewmate should follow.
[position]
: Required when the behavior isfollowposition
, to specify the x-position the crewmate should try to move to. Otherwise unused.
- Note that since the code for this behavior is reused from the behavior to follow another crewmate or the player, the crewmate will stop short of the targeted x-position, and the distance they are short by will vary, depending on pixel alignment, between 12 and 17 pixels inclusive if the target position is to the right of the crewmate, or between 32 and 37 pixels inclusive if the target position is to the left of the crewmate. Additionally, if the crewmate is already within 33 pixels inclusive of the target position to the right of them, or 35 pixels inclusive of the target position to the left of them, they will not move. However, even if they don't move, they will turn to face the target position if it is at least 6 pixels away in either direction from their x-coordinate.
changecolour
changecolour
is spelled with U, a la British English and not without one a la American English.changecolour (<crewmate>, <color>)
Change the color (and identifier) of a createcrewman
entity to another one. However, you cannot change the identifier of the player.
<crewmate>
: The identifier of thecreatecrewman
entity. See the section oncreatecrewman
identifiers.
<color>
: The color (and identifier) to change the crewmate to, but you cannot change the identifier of the player.
changecustommood
changecustommood (<custom crewmate>, <mood>)
Change the mood of the first-placed rescuable crewmate edentity in the room.
<custom crewmate>
: The identifier of the rescuable crewmate. Can be any of the following:red
yellow
green
cyan
blue
purple
(this will actually target the pink-colored rescuable crewmate)pink
player
- If it's not any one of these, it will default to the player.
<mood>
: The mood to make the rescuable crewmate.0
is happy, anything that is nonzero is sad. Usually people use1
to make the rescuable crewmate sad.
changedir
changedir (<crewmate>, <direction>)
Change the direction variable of the given crewmate. If the direction is 0
, the crewmate is facing left; otherwise, when the value is nonzero, they will be facing right, usually with a value of 1
.
<crewmate>
: The identifier of thecreatecrewman
entity. See the section oncreatecrewman
identifiers.
<direction>
: The direction to make the crewmate face.0
is left, anything that is nonzero is facing right. Usually people use1
to face right.
changegravity
changegravity (<crewmate>)
Add 12 to the current sprite offset of the given crewmate. This is not functionally equivalent to changetile(<crewmate>,12)
, it's more like changetile(<crewmate>,<current sprite offset>+12)
.
<crewmate>
: The identifier of thecreatecrewman
entity. See the section oncreatecrewman
identifiers.
This command is unused in the main game.
changemood
changemood (<crewmate>, <mood>)
Change the mood of the given crewmate. More specifically, it changes the sprite offset depending on what you give for <mood>
. This means this is functionally equivalent to changetile(<crewmate>,0)
if you give 0
to <mood>
and changetile(<crewmate>,144)
if you give anything nonzero (usually 1
) to it.
<crewmate>
: The identifier of thecreatecrewman
entity. See the section oncreatecrewman
identifiers.
<mood>
: The mood to make the crewmate.0
is happy, anything that is nonzero is sad. Usually people use1
to make the crewmate sad.
changeplayercolour
changeplayercolour
is spelled with U, a la British English and not without one a la American English.changeplayercolour (<color>)
Set the color of the player.
<color>
: Can be any of the colors from the following list:red
yellow
green
cyan
(same effect as restoreplayercolour)blue
purple
(this is actually pink)teleporter
(rapidly cycles through random colors for flashy effect, actually unused in the main game, intended to be used before player teleports)
changerespawncolour
changerespawncolour
is spelled with U, a la British English and not without one a la American English.changerespawncolour (<color>)
changetile
changetile (<crewmate>, <sprite offset>)
Set the sprite offset of the given crewmate. Then, the final sprite rendered, the sprite number, will be the crewmate's animation offset plus the sprite offset given. However, the sprite offset is ignored if the player is currently dying.
The sprite number is fetched from each 32x32 box in sprites.png
, or flipsprites.png
if the game is in flip mode. The sprite to be fetched from sprites.png
or flipsprites.png
is obtained by dividing the sprite number by 12 while keeping an integer remainder - the non-remainder will then be the row, and the remainder will be the column.
Note that the final sprite (the animation offset plus the sprite offset) must be in the range of 0..191 inclusive; otherwise the game will try to fetch a nonexistent sprite, and then segfault. Except in 2.3 and later, where this segfault is fixed and doesn't happen, and instead the crewmate or player simply doesn't render at all.
<crewmate>
: The identifier of thecreatecrewman
entity. See the section oncreatecrewman
identifiers.
<sprite offset>
: The sprite offset to set the crewmate to. The final sprite will be the sprite offset plus the animation offset.
- Here are the animation offsets for the various sprites:
Offset Flipped Direction Animation 0
On the floor Facing right Standing still 1
On the floor Facing right Walking 1 2
On the floor Facing right Walking 2 3
On the floor Facing left Standing still 4
On the floor Facing left Walking 1 5
On the floor Facing left Walking 2 6
On the ceiling Facing right Standing still 7
On the ceiling Facing right Walking 1 8
On the ceiling Facing right Walking 2 9
On the ceiling Facing left Standing still 10
On the ceiling Facing left Walking 1 11
On the ceiling Facing left Walking 2
- These are the death sprites, which will ignore the sprite offsets:
Offset Flipped Direction Animation 12
On the floor Facing right Dying 13
On the floor Facing left Dying 14
On the ceiling Facing right Dying 15
On the ceiling Facing left Dying
clearteleportscript
clearteleportscript
Clear the teleport script. This restores the action that happens upon pressing ENTER at a teleporter to simply bringing up the teleporter screen, which would have been set by teleportscript
.
This command is unused in the main game.
companion
createactivityzone
createcrewman
createentity
createlastrescued
createrescuedcrew
customifflag
ifflag
.customifflag (<flag>, <script>)
If the specified flag is on, then jump to the custom script.
<flag>
: The flag to check. Must be between 0 and 99 inclusive. In 2.2 and below, a flag outside the bounds would trigger undefined behavior, but this was fixed in 2.3.<script>
: The custom script to jump to.
customiftrinkets
iftrinkets
.customiftrinkets (<trinkets>, <script>)
If the number of collected trinkets is equal to or greater than the specified number, then jump to the custom script.
Most often used in custom levels as customiftrinkets(0,<script>)
to unconditionally jump to a custom script, because it is always true that the player will have collected 0 or more trinkets.
<trinkets>
: The number of trinkets to check.<script>
: The custom script to jump to.
customiftrinketsless
iftrinketsless
.customiftrinketsless (<trinkets>, <script>)
If the number of collected trinkets is strictly less than the specified number (and not equal to), then jump to the custom script.
<trinkets>
: The number of trinkets to check.<script>
: The custom script to jump to.
custommap
map
.custommap (<state>)
Enables or disables the pause screen minimap in custom levels.
If the minimap is disabled, "NO SIGNAL" will be displayed.
<state>
: The state of the map. Eitheron
oroff
. Anything else will have no effect.
customposition
cutscene
cutscene
Make the black bars indicating a cutscene is in progress appear.
This command does not do a delay on its own. To do a delay, use untilbars.
delay
delay
.delay (<frames>)
Delay the script for the given number of frames. The player cannot move during this delay. In 2.2 and below, they could not bring up the ENTER screen either.
One frame is 34 milliseconds, so 30 frames is almost one second.
<frames>
: The number of frames to delay for.
destroy
destroy
.destroy (<object type>)
Destroy all objects of the given type in the current room.
<object type>
: The object type to destroy.gravitylines
: Gravity lines.warptokens
: Warp tokens.platforms
: All moving platforms. However, this is bugged and will simply stop the platforms in place while turning them invisible.moving
(since 2.4): All moving platforms. This will work properly, unlikeplatforms
.disappear
(since 2.4): All disappearing platforms.
do
endcutscene
endcutscene
Make the black bars prompted by cutscene disappear.
This command does not do a delay on its own. To do a delay, use untilbars.
endtext
endtextfast
entersecretlab
everybodysad
face
fadein
fadeout
finalmode
flag
flag
.flag (<number>, <state>)
Turn on or off a flag.
<number>
: The number of the flag. Only 0 to 99 inclusive are valid, other numbers are ignored.<state>
: The state of the flag. Eitheron
oroff
. Anything else will have no effect.
flash
flip
flip
Presses the ACTION button, causing the player to flip if eligible. This command also does 1 frame of delay.
If there is an ACTION prompt onscreen and the prompt is gamestate-based, this ACTION press will dismiss it. Script-based ACTION prompts cannot be dismissed because this command can't run at the same time as the prompt.
It is a common pitfall for this command to not work when placed right after an ACTION prompt. This is because the ACTION-down input frame from the player to dismiss the prompt is immediately followed by an ACTION-down input frame from this command with no intervening ACTION-up input frame, so this ACTION-down input frame gets treated like an ACTION hold instead of an ACTION press. The usual workaround is to put a delay(1)
before this command.
flipgravity
flipme
flipme
Marks that the text box should be vertically repositioned if the player is in Flip Mode.
In 2.2 and below, the repositioning does not account for the height of the text box, so the Flip Mode position is wrong. In 2.3 and later, this is fixed and the repositioning now accounts for the height of the text box.
foundlab
foundlab2
foundtrinket
gamemode
gamestate
gotoposition
gotoroom
gotoroom (<x (0-indexed)>, <y (0-indexed)>)
Load the room with the given coordinates.
If the player is already in said room, the room is still reloaded.
If the coordinates given are outside the map, they are wrapped around to the other edge of the map. E.g. in a 10x10 map, gotoroom(50,50)
is equivalent to gotoroom(0,0)
and gotoroom(-10,-10)
is equivalent to gotoroom(9,9)
.
<x>
: The x-coordinate of the room to load.<y>
: The y-coordinate of the room to load.
greencontrol
hascontrol
hidecoordinates
hidecoordinates (<x (0-indexed)>, <y (0-indexed)>)
On the map, hides the room at the given coordinates. Note that re-entering this room (via a screen transition or gotoroom) will still show the room again on the map. showcoordinates is the opposite of this command.
In 2.2 and below, if the room number you end up indexing (which is roomx + roomy*20
) is not in the range 0..399, undefined behavior will be triggered. In 2.3 and later, this undefined behavior is fixed.
<x>
: The x-coordinate of the room to hide.<y>
: The y-coordinate of the room to hide.
hideplayer
hidesecretlab
hidesecretlab
On the map, hides the rooms corresponding to the Secret Lab in the main game. showsecretlab is the opposite of this command.
These rooms are (0-indexed):
- (16, 5)
- (17, 5)
- (18, 5)
- (17, 6)
- (18, 6)
- (19, 6)
- (19, 7)
- (19, 8)
hideship
hideship
On the map, hides the rooms corresponding to the Ship in the main game. showship is the opposite of this command.
These rooms are (0-indexed):
- (2, 10)
- (3, 10)
- (4, 10)
- (2, 11)
- (3, 11)
- (4, 11)
hidetargets
hideteleporters
hidetrinkets
ifcrewlost
This command jumps to a main game script, not a custom script. To jump to a custom script, you must prefix the script name with custom_
(but then the load script method won't work for that script; you can however jump to a custom script that jumps to another custom script).
ifexplored
This command jumps to a main game script, not a custom script. To jump to a custom script, you must prefix the script name with custom_
(but then the load script method won't work for that script; you can however jump to a custom script that jumps to another custom script).
ifflag
This command jumps to a main game script, not a custom script. To jump to a custom script, you must either use customifflag instead, or prefix the script name with custom_
(but then the load script method won't work for that script).
iflang
iflang
.iflang (<language>, <script>)
Check if the current language of the game is a certain language, and if so, jump to the given custom script.
<language>
: The language to check. This is the folder name of the language, which is usually a two-letter code, such asen
for English.<script>
: The custom script to jump to, if the check succeeds.
iflast
This command jumps to a main game script, not a custom script. To jump to a custom script, you must prefix the script name with custom_
(but then the load script method won't work for that script; you can however jump to a custom script that jumps to another custom script).
ifskip
This command jumps to a main game script, not a custom script. To jump to a custom script, you must prefix the script name with custom_
(but then the load script method won't work for that script; you can however jump to a custom script that jumps to another custom script).
iftrinkets
This command jumps to a main game script, not a custom script. To jump to a custom script, you must either use customiftrinkets instead, or prefix the script name with custom_
(but then the load script method won't work for that script).
iftrinketsless
This command jumps to a main game script, not a custom script. To jump to a custom script, you must either use customiftrinketsless instead, or prefix the script name with custom_
(but then the load script method won't work for that script).
ifwarp
gotoroom
command, but you would have to use the coordinates (1,1) for this command.ifwarp
.ifwarp (<x (1-indexed)>, <y (1-indexed)>, <warp background>, <script>)
Check if the warp background of the given room is a certain warp background, and if so, jump to the given custom script.
This command can be used in internal scripting without having to prefix either the command with custom
or the script with custom_
. You cannot jump to a main game script with this command, but you could jump to a custom script that jumps to a main game script.
In 2.2 and below, if the room number you end up indexing (which is just, without accounting for 1-indexing, roomx + roomy*20
) is not in the range 0..399, undefined behavior will be triggered. In 2.3 and later, this undefined behavior is fixed.
<x>
: The x-coordinate of the room whose warp background you want to check, 1-indexed.<y>
: The y-coordinate of the room whose warp background you want to check, 1-indexed.<warp background>
: The warp background to check. There are four intended values:0
: No warping1
: Horizontal2
: Vertical3
: All sides
- Additionally, you can set the warp dir of the room to any arbitrary integer with
warpdir
, and then check that arbitrary value with this command.
<script>
: The custom script to jump to, if the check succeeds.
jukebox
leavesecretlab
loadscript
This command jumps to a main game script, not a custom script.
Consider using customiftrinkets(0,<script>)
instead (however, loadscript(stop)
is fine to use just to keep with convention).
loadtext
loadtext
.loadtext (<language>)
In custom levels, load the given language.
<language>
: The language to load. If left blank, this will load the language the game's language is currently set to.
loop
missing
moveplayer
musicfadein
musicfadeout
nocontrol
play
playef
position
purplecontrol
redcontrol
rescued
resetgame
restoreplayercolour
resumemusic
rollcredits
setactivitycolour
setactivitycolour (<color>)
setactivitytext
setactivitytext <text>
setcheckpoint
shake
showcoordinates
showcoordinates (<x (0-indexed)>, <y (0-indexed)>)
On the map, reveals the room at the given coordinates. hidecoordinates is the opposite of this command.
If the room number you end up indexing (which is roomx + roomy*20
) is not in the range 0..399: 2.2 and below: [Undefined behavior will be triggered.] 2.3 and later: [Nothing will happen.]
<x>
: The x-coordinate of the room to show.<y>
: The y-coordinate of the room to show.
showplayer
showsecretlab
showsecretlab
On the map, reveals the rooms corresponding to the Secret Lab in the main game. hidesecretlab is the opposite of this command.
These rooms are (0-indexed):
- (16, 5)
- (17, 5)
- (18, 5)
- (17, 6)
- (18, 6)
- (19, 6)
- (19, 7)
- (19, 8)
showship
showship
On the map, reveals the rooms corresponding to the Ship in the main game. hideship is the opposite of this command.
These rooms are (0-indexed):
- (2, 10)
- (3, 10)
- (4, 10)
- (2, 11)
- (3, 11)
- (4, 11)
showtargets
showtrinkets
speak
speak_active
specialline
specialline (<case>)
Replaces text box lines with hardcoded strings. Used for two particular main game lines that want the name of a random unrescued crewmate.
<case>
: Can be 1 or 2; the command does nothing otherwise.1
: Sets the text box to beI'm worried about <random unrescued crewmate>, Doctor!
.2
: If there are less than 5 rescued crewmates, two lines will be appended:to helping you find the rest of the crew!
Else,to helping you find <random unrescued crewmate>!
is appended.
squeak
squeak (<sound>)
Plays a sound corresponding to particular characters speaking/emoting.
<sound>
: Which sound to play.player
orcyan
: Viridian squeaking. Equivalent toplayef(11)
.red
: Vermilion squeaking. Equivalent toplayef(16)
.green
: Verdigris squeaking. Equivalent toplayef(12)
.yellow
: Vitellary squeaking. Equivalent toplayef(14)
.blue
: Victoria squeaking. Equivalent toplayef(13)
.purple
: Violet squeaking. Equivalent toplayef(15)
.cry
: Sad characters squeaking. Equivalent toplayef(2)
.terminal
: Terminals squeaking. Equivalent toplayef(20)
.
startintermission2
stopmusic
teleportscript
telesave
text
textcase
textcase
.textcase (<case>)
Set the text case of the following text box to the given case number. The default text case is 1.
This is intended to be used in localization to disambiguate between different text boxes with the exact same text contents.
<case>
: The case number, between 1 and 255.
textboxactive
tofloor
tofloor
Acts identically to flip if the player is currently flipped.
trinketbluecontrol
trinketscriptmusic
trinketyellowcontrol
undovvvvvvman
undovvvvvvman
Undo the effects of vvvvvvman, returning the player character to their normal state.
untilbars
untilfade
vvvvvvman
vvvvvvman
Change the player character into the large character shown in the Secret Lab's introduction cutscene. Collision is very glitchy.
walk
warpdir
gotoroom
command, but you would have to use the coordinates (1,1) for this command.warpdir
.warpdir (<x (1-indexed)>, <y (1-indexed)>, <warp background>)
Set the warp background of the given room, permanently for the given session. The changed warp background will not be preserved if you quicksave, quit, and load the level from the save again, but leaving the room and coming back will not reset its warp background to what it was originally. This means you can set the warp background of a certain room without having to be in it.
There is a bug with this command in versions 2.2 and below where if you are in a room with the Lab or Warp Zone tileset, and you set the warp background to none (e.g. make the room no longer warp anymore), instead of setting it to the Lab or stars-up background, it will set it to the stars-left background, always. But leaving and coming back will set the room's background to what it's supposed to be. In 2.3 and later, this bug is fixed.
In 2.2 and below, if the room number you end up indexing (which is just, without accounting for 1-indexing, roomx + roomy*20
) is not in the range 0..399, undefined behavior will be triggered. In 2.3 and later, this undefined behavior is fixed.
<x>
: The x-coordinate of the room to target, 1-indexed.<y>
: The y-coordinate of the room to target, 1-indexed.<warp background>
: The warp background to set the room to. There are four intended values:0
: No warping1
: Horizontal2
: Vertical3
: All sides
- All other values will still succeed in setting the warp dir to that value, and will make the room no longer warp, but the background will still be there.
yellowcontrol
yellowcontrol
Run Vitellary's activity zone script, which also creates Vitellary's activity zone when finished.