List of simplified commands

From Viki
Jump to navigation Jump to search

This page is a list of simplified commands usable in Simplified scripting. For a list of internal commands, see List of internal commands.

cry

An alias for sad.

delay

This command can also be used in internal scripting as delay.
delay (<frames>)

Delay the script for the given number of frames. The player cannot move during this delay. [2.2 and below: They cannot 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

This command can also be used in internal scripting as 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.
    • [2.4 and later: moving: All moving platforms. This will work properly, unlike platforms.]
    • [2.4 and later: disappear: All disappearing platforms.]

flag

This command can also be used in internal scripting as 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. Either on or off. Anything else will have no effect.

flash

Not to be confused with the internal command of the same name.
flash

Flashes the screen.

This is equivalent to the following lines of internal scripting:

flash(5)
shake(20)
playef(9)

happy

happy ([crewmate])

Makes a rescuable crewmate happy.

If squeak mode is on, this is roughly equivalent to the following lines of internal scripting (except for all):

squeak(<crewmate>)
changecustommood(<crewmate>,0)

And if squeak mode is off, then this is roughly equivalent to the following line of internal scripting (except for all):

changecustommood(<crewmate>,0)

If there are multiple rescuable crewmates in the room, then this command will only target the first-spawned one. If the rescuable crewmate cannot be found, then it will target the player. If the target is invalid, then this command does nothing.

  • [crewmate]: The rescuable crewmate to target, if any. If not specified, it defaults to player.
    • player: The player. This will not target any other cyan rescuable crewmate.
    • cyan, viridian, or 1: A cyan rescuable crewmate.
    • purple, violet, pink, or 2: A pink rescuable crewmate.
    • yellow, vitellary, or 3: A yellow rescuable crewmate.
    • red, vermillion, or 4: A red rescuable crewmate.
    • green, verdigris, or 5: A green rescuable crewmate.
    • blue, victoria, or 6: A blue rescuable crewmate.
    • all, everybody, or everyone: All of the above individually (player, then cyan, then pink, then yellow, then red, then green, then blue). Equivalent to the following lines of internal scripting, regardless of squeak mode:
      changemood(player,0)
      changecustommood(cyan,0)
      changecustommood(purple,0)
      changecustommood(yellow,0)
      changecustommood(red,0)
      changecustommood(green,0)
      changecustommood(blue,0)
      

ifflag

This command can also be used in internal scripting as customifflag.
ifflag (<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. [2.2 and below: A flag outside those bounds will trigger undefined behavior.]
  • <script>: The custom script to jump to.

iflang

This command can also be used in internal scripting as iflang.
This command was added in 2.4.
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 as en for English.
  • <script>: The custom script to jump to, if the check succeeds.

iftrinkets

This command can also be used in internal scripting as customiftrinkets.
iftrinkets (<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 iftrinkets(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.

iftrinketsless

This command can also be used in internal scripting as customiftrinketsless.
iftrinketsless (<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.

ifwarp

Note that unlike other coordinate-based commands, room coordinates with this command are 1-indexed. That means for the top-left room of the map, you would use the coordinates (0,0) with e.g. the internal gotoroom command, but you would have to use the coordinates (1,1) for this command.
This command can also be used in internal scripting as 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.

[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.]

  • <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 warping
    • 1: Horizontal
    • 2: Vertical
    • 3: 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.

loadtext

This command can also be used in internal scripting as loadtext.
This command was added in 2.4.
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.

map

This command can also be used in internal scripting as custommap.
map (<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. Either on or off. Anything else will have no effect.

music

music (<number>)

Plays a track.

  • <number>: The ID of the song to play.
    • 0: Stops the currently playing track. This is equivalent to stopmusic in internal scripting.
    • Anything else: See the list of music tracks for a list of tracks that can be played.

playremix

playremix

Plays the Predestined Fate remix.

This is equivalent to play(15) in internal scripting.

reply

reply([lines])
<text...>

Creates a cyan text box centered above the player.

This command is virtually identical to the following lines of simplified scripting:

say(<lines>,cyan)
<text...>

If squeak mode is on, the command is equivalent to the following lines of internal scripting:

squeak(player)
text(player,0,0,<lines>)
<text...>
position(player,above)
speak_active

If squeak mode is off, the command is equivalent to the above lines without squeak(player).

  • [lines]: The number of lines in the message. If this argument is omitted, or it is less than 1 [2.3 and below: or greater than 50], it defaults to 1 line long.
  • <text...>: The message to be displayed. This message can be multiple lines long.

sad

sad([crewmate])

cry([crewmate]) crewmate - crewmate to turn sad:

  • player
  • cyan/viridian/1
  • purple/violet/pink/2
  • yellow/vitellary/3
  • red/vermillion/4
  • green/verdigris/5
  • blue/victoria/6
  • all/everybody/everyone

The sad/cry command turns the specified crewmate(s) sad and plays the cry sound effect unless otherwise specified (See squeak). If the argument is omitted, the player will turn sad.

say

say([lines[,color]])
<text...>

lines - number of lines in the message
color - color of the text box:

  • terminal/gray/grey/0
  • cyan/viridian/player/1
  • purple/violet/pink/2
  • yellow/vitellary/3
  • red/vermilion/4
  • green/verdigris/5
  • blue/victoria/6

The say command creates a text box. The color parameter determines what color the textbox will be and what sound will play. If the crewmate with the respective color is on the screen, the text box will be centered above their head, otherwise it will be at the center of the screen. The chosen color will be the default text box color until the script ends or it is manually changed. Omitting this argument will result in a gray text box if no previous color has been set. If the lines argument is omitted, the message is assumed to be 1 line long.

setfont

This command can also be used in internal scripting as setfont.
This command was added in 2.4.
The all argument was added in 2.4.1.
setfont ([font], [all])

In custom levels, set the font to the given font.

If there is a text box fading out, this command will delay until it is faded.

  • [font]: The font to set the font to. If left blank, this will set the font to the default font of the custom level.
  • [all] - If all is specified (literally the word all), then this retroactively affects all textboxes that are already on screen. Otherwise simply leave this out.

setrtl

This command can also be used in internal scripting as setrtl.
This command was added in 2.4.
setrtl (<state>)

In custom levels, toggle whether or not the font is RTL (right-to-left) or not. By default, the font is not RTL (it is LTR).

If there is a text box fading out, this command will delay until it is faded.

  • <state>: The state of the font's RTL. Either on or off. Anything else will have no effect.

speaker

speaker(color)

color - color of the text box:

  • terminal/gray/grey/0
  • cyan/viridian/player/1
  • purple/violet/pink/2
  • yellow/vitellary/3
  • red/vermilion/4
  • green/verdigris/5
  • blue/victoria/6

The speaker command changes the default color of text boxes. This color will remain the default until the script ends or it is manually changed.

squeak

squeak(sound)

squeak(b) sound:

  • player/cyan/viridian/1
  • purple/violet/pink/2
  • yellow/vitellary/3
  • red/vermillion/4
  • green/verdigris/5
  • blue/victoria/6
  • sad/cry

b - "on" or "off"

The squeak command can be used in 2 different ways:

  1. to plays specified squeak sound effect
  2. to enable or disable the squeak sound effect

Squeak is on by default, and if it is disabled it will only last for the lifetime of the script.

textcase

This command is intended to be used as a part of constructing a text box. See the section on text box construction for more info.
This command can also be used in internal scripting as textcase.
This command was added in 2.4.
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.

warpdir

Note that unlike other coordinate-based commands, room coordinates with this command are 1-indexed. That means for the top-left room of the map, you would use the coordinates (0,0) with e.g. the internal gotoroom command, but you would have to use the coordinates (1,1) for this command.
This command can also be used in internal scripting as 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.

[2.2 and below: There is a bug with this command 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 if the room is reloaded (e.g. by leaving and coming back), the room's background will be set to what it's supposed to be.]

[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.]

  • <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 warping
    • 1: Horizontal
    • 2: Vertical
    • 3: 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.