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

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.
    • moving (since 2.4): All moving platforms. This will work properly, unlike platforms.
    • disappear (since 2.4): 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. 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.

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.

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

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>)

Sets the background music permanently until the end of the session.

  • <number>: The ID of the song to play.
    • 0: Silence (no music)
    • 1: Pushing Onwards
    • 2: Positive Force
    • 3: Potential For Anything
    • 4: Passion For Exploring
    • 5: Presenting VVVVVV
    • 6: Predestined Fate
    • 7: Popular Potpourri
    • 8: Pipe Dream
    • 9: Pressure Cooker
    • 10: Paced Energy
    • 11: Piercing The Sky


playremix

playremix

Plays the Predestined Fate remix. This is equivalent to the following line of internal scripting:

play(15)

reply

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

Creates a cyan text box centered above the player. This command is virtually identical to 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, the message is assumed to be 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 happy:

  • 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.

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.

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.

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