The Open Level Project

Distractionware => VVVVVV => Topic started by: Dav999 on September 7, 2017, 06:42:15 PM

Title: Internal commands (2017 version)
Post by: Dav999 on September 7, 2017, 06:42:15 PM
A more up-to-date reference for internal commands that doesn't use the C64 font has been requested multiple times, so I updated my little messy internal commands database webapp so that it can also output in BBCode. That means this is the same list of commands as in the Ved help.

As always, the color coding is as follows:

I know the following commands aren't on the list yet, and there might be others I overlooked:

If you have any suggestions or corrections, please tell me!


squeak(color)
Makes a squeak sound from a crewmate, or a terminal sound

color - cyan/player/blue/red/yellow/green/purple/terminal

text(color,x,y,lines)
Store a text box in memory with color, position and number of lines. Usually, the position command is used after the text command (and its lines of text), which will overwrite the coordinates given here, so these are usually left as 0.

color - cyan/player/blue/red/yellow/green/purple/gray
x - The x position of the text box
y - The y position of the text box
lines - The number of lines

position(x,y)
Overrides the x,y of the text command and thus sets the position of the text box.

x - center/centerx/centery, or a color name cyan/player/blue/red/yellow/green/purple
y - Only used if x is a color name. Can be above/below

endtext
Makes a text box disappear (fade out)

endtextfast
Makes a text box disappear immediately (without fading out)

speak
Shows a text box, without removing old text boxes. Also pauses the script until you press action (unless there's a backgroundtext command above it)

speak_active
Shows a text box, and removes any old text box. Also pauses the script until you press action (unless there's a backgroundtext command above it)

backgroundtext
If you put this command on the line above speak or speak_active, the game will not wait until you press action after creating the text box. This can be used to create multiple text boxes at the same time.

changeplayercolour(color)
Changes the player's color

color - cyan/player/blue/red/yellow/green/purple/teleporter

restoreplayercolour()
Changes the player's color back to cyan

changecolour(a,b)
Changes the color of a crewmate (note: this only works with crewmates who have been created using the createcrewman command)

a - Color of crewmate to change cyan/player/blue/red/yellow/green/purple
b - Color to change to

alarmon
Turns the alarm on

alarmoff
Turns the alarm off

cutscene()
Makes cutscene bars appear

endcutscene()
Makes cutscene bars disappear

untilbars()
Wait until cutscene()/endcutscene() is completed

customifflag(n,script)
Same as ifflag(n,script) in simplified scripting

ifflag(n,script)
Same as customifflag, but loads an internal (main game) script

loadscript(script)
Load an internal (main game) script. Commonly used in custom levels as loadscript(stop)

iftrinkets(n,script)
Same as simplified scripting, but loads an internal (main game) script

iftrinketsless(n,script)
Same as simplified scripting, but loads an internal (main game) script

customiftrinkets(n,script)
Same as iftrinkets(n,script) in simplfied scripting

customiftrinketsless(n,script)
Same as iftrinketsless(n,script) in simplfied scripting (but remember it is broken)

createcrewman(x,y,color,mood,ai1,ai2)
Creates a crewmate (not rescuable)

mood - 0 for happy, 1 for sad
ai1 - followplayer/followpurple/followyellow/followred/followgreen/followblue/faceplayer/panic/faceleft/faceright/followposition,ai2
ai2 - required if followposition is used for ai1

createentity(x,y,n,meta1,meta2)
Creates an entity, check the lists reference for entity numbers

n - The entity number

vvvvvvman()
Makes the player huge

undovvvvvvman()
Back to normal

hideplayer()
Makes the player invisible

showplayer()
Makes the player visible

gamestate(x)
Change the gamestate to the specified state number

gamemode(x)
teleporter to show the map, game to hide it (shows teleporters of the main game)

x - teleporter/game

blackout()
Make the screen black/freezes the screen

blackon()
Back to normal from blackout()

fadeout()
Fades the screen to black

fadein()
Fades back

befadein()
Instantly fade in from fadeout()

untilfade()
Wait until fadeout()/fadein() is completed

gotoroom(x,y)
Change the current room to x,y, where x and y start at 0.

x - Room x coordinate, starting at 0
y - Room y coordinate, starting at 0

gotoposition(x,y,f)
Change Viridian's position to x,y in this room, and f is whether you're flipped or not. (1 for flipped, 0 for not flipped)

f - 1 for flipped, 0 for not flipped (you can also use gotoposition(x,y), then you will have normal gravity by default)

flash(x)
Makes the screen white, you can change the time how long the screen should stay white (just flash won't work, you have to use flash(5) in combination with playef(9) and shake(20) if you want a normal flash)

x - The amount of ticks. 30 ticks is almost one second.

play(x)
Start playing a song with internal song number.

x - Internal song number

jukebox(x)
Makes a jukebox terminal white and turns off the color of all the other terminals (in custom levels, it just seems to turn off the white color of all activated terminals).

musicfadeout()
Fades out the music.

musicfadein()
Opposite of musicfadeout() (doesn't seem to work)

stopmusic()
Stops the music immediately. Equivalent to music(0) in simplified scripting.

resumemusic()
Opposite of stopmusic() (doesn't seem to work)

playef(x,n)
Play a sound effect.

n - Actually unused, and can be left out. In VVVVVV 1.x, this used to control the offset in milliseconds at which the sound effect started.

changemood(colour,mood)
Changes the mood of a crewmate (only works for crewmates created with createcrewman)

colour - cyan/player/blue/red/yellow/green/purple
mood - 0 for happy, 1 for sad

everybodysad()
Makes everybody sad (only for crewmates created with createcrewman and the player)

changetile(colour,tile)
Changes the tile of a crewmate (you can change it to any sprite in sprites.png, and it only works for crewmates created with createcrewman)

colour - cyan/player/blue/red/yellow/green/purple/gray
tile - Tile number

face(a,b)
Makes the face of crewmate a point to crewmate b (only works with crewmates created with createcrewman)

a - cyan/player/blue/red/yellow/green/purple/gray
b - same

companion(x)
Makes the specified crewmate a companion (as far as I remember, this also depends on on the location on the map)

changeai(crewmate,ai1,ai2)
Can change the face direction of a crewmate or the walking behaviour

crewmate - cyan/player/blue/red/yellow/green/purple
ai1 - followplayer/followpurple/followyellow/followred/followgreen/followblue/faceplayer/panic/faceleft/faceright/followposition,ai2
ai2 - required if followposition is used for ai1

changedir(colour,direction)
Just like changeai(colour,faceleft/faceright), this changes face direction.

colour - cyan/player/blue/red/yellow/green/purple
direction - 0 is left, 1 is right

walk(direction,x)
Makes the player walk the specified number of ticks

direction - left/right

flipgravity(colour)
Flips the gravity of a certain crewmate (it won't always work on yourself)

colour - cyan/player/blue/red/yellow/green/purple

flipme
Correct vertical positioning of multiple text boxes in flip mode

tofloor
Makes the player flip to the floor if he isn't already on the floor.

flip
Make the player flip

foundtrinket(x)
Makes a trinket found

x - Number of the trinket

runtrinketscript
Play Passion For Exploring?

altstates(x)
Changes the layout of some rooms, like the trinket room in the ship before and after the explosion, and the secret lab entrance (custom levels don't support altstates at all)

createlastrescued(x,y)
Creates the last rescued crewmate at position x,y (?)

rescued(colour)
Makes someone rescued

missing(colour)
Makes someone missing

finalmode(x,y)
Teleports you to Outside Dimension VVVVVV, (46,54) is the initial room of the Final Level

setcheckpoint()
Sets the checkpoint to the current location

textboxactive
Makes all text boxes on the screen disappear except for the last created one

ifexplored(x,y,script)
If x+1,y+1 is explored, go to (internal) script

iflast(crewmate,script)
If crewmate x was rescued last, go to script

crewmate - Numbers are used here: 2: Vitellary, 3: Vermillion, 4: Verdigris, 5 Victoria (I don't know the number for Viridian and Violet)

ifskip(x)
If you skip the cutscenes in No Death Mode, go to script x

ifcrewlost(crewmate,script)
If crewmate is lost, go to script

showcoordinates(x,y)
Show coordinates x,y on the map (This works for the map for custom levels)

hidecoordinates(x,y)
Hide coordinates x,y on the map (This works for the map for custom levels)

showship
Show the ship on the map

hideship
Hide the ship on the map

showsecretlab
Show the secret lab on the map

hidesecretlab
Hide the secret lab on the map

showteleporters()
Show the teleporters on the map (I guess it only shows the teleporter in Space Station 1)

hideteleporters()
Hide the teleporters on the map

showtargets()
Show the targets on the map (unknown teleporters which show up as ?s)

hidetargets()
Hide the targets on the map

showtrinkets()
Show the trinkets on the map

hidetrinkets()
Hide the trinkets on the map

hascontrol()
Makes the player have control, however doesn't work in the middle of scripts

nocontrol()
The opposite of hascontrol()

specialline(x)
Special dialogs that show up in the main game

destroy(x)
Same behaviour as simplified command

x - gravitylines/warptokens/platforms

delay(x)
Same behaviour as simplified command

flag(x,on/off)
Same behaviour as simplified command

telesave()
Saves your game (in the regular teleporter save, so don't use it!)

befadein()
Instantly fade in from fadeout()

createactivityzone(colour)
Creates a zone where you are standing which says "Press ACTION to talk to (Crewmate)"

createrescuedcrew()
Creates all rescued crewmates

trinketyellowcontrol()
Dialog of Vitellary when he gives you a trinket in the real game

trinketbluecontrol()
Dialog of Victoria when she gives you a trinket in the real game

rollcredits()
Makes the credits roll. It destroys your save after the credits are completed!

teleportscript(script)
Used to set a script which is run when you use a teleporter

clearteleportscript()
Clears the teleporter script set with teleporterscript(x)

moveplayer(x,y)
Moves the player x pixels to the right and y pixels down. Of course you can also use negative numbers to make him move up or to the left

do(n)
Starts a loop block which will repeat n times

loop
Put this at the end of the loop block

leavesecretlab()
Turn off "secret lab mode"

shake(n)
Shake the screen for n ticks. This will not create a delay.

activateteleporter()
If there's a teleporter in the room, it will glow white and touching it will not annihilate your save data. May not work if there are multiple teleporters.

customposition(x,y)
Overrides the x,y of the text command and thus sets the position of the text box, but for crewmates, rescuable crewmates are used to position against, instead of createentity crewmates.

x - center/centerx/centery, or a color name cyan/player/blue/red/yellow/green/purple (rescuable)
y - Only used if x is a color name. Can be above/below

custommap(on/off)
The internal variant of the map command

trinketscriptmusic
Plays passion for exploring, without taking arguments(?)

startintermission2
Alternate finalmode(46,54), takes you to the final level without accepting arguments. Crashes in timeslip.

resetgame
Resets all trinkets, collected crewmates and flags, and teleports the player to the last checkpoint.

redcontrol
Start a conversation with Vermilion just like when you meet him in the main game and press ENTER. Also creates an activity zone afterwards.

greencontrol
Start a conversation with Verdigris just like when you meet him in the main game and press ENTER. Also creates an activity zone afterwards.

bluecontrol
Start a conversation with Victoria just like when you meet her in the main game and press ENTER. Also creates an activity zone afterwards.

yellowcontrol
Start a conversation with Vitellary just like when you meet him in the main game and press ENTER. Also creates an activity zone afterwards.

purplecontrol
Start a conversation with Violet just like when you meet her in the main game and press ENTER. Also creates an activity zone afterwards.

foundlab
Plays sound effect 3, shows text box with "Congratulations! You have found the secret lab!" Does not endtext, also has no further unwanted effects.

foundlab2
Displays the second text box you see after discovering the secret lab. Also does not endtext, and also does not have any further unwanted effects.

entersecretlab
Actually unlocks the secret lab for the main game, which is probably an unwanted effect for a custom level to have. Turns on secret lab mode.
Title: It’s 2017 but the docs are in 2013.
Post by: Info Teddy on September 7, 2017, 07:17:22 PM
Why is vvvvvvman still documented as “You know what it does”?

finalmode should be documented as “teleports you to Outside Dimension VVVVVV”, with (46,54) being the initial room of the Final Level.

Docs for gotoposition uses multiple names for the last argument, which can cause confusion.

playef’s last argument does nothing, the code doing anything with the last argument is commented out (https://twitter.com/terrycavanagh/status/818225780396326913) and putting anything there is completely meaningless, even though it technically does have two arguments.
Title: Re: Internal commands (2017 version)
Post by: Kiwi Alexia ♡ on September 8, 2017, 03:40:34 AM
(I've tested the others, I just forgot what they do)
(I'll re-test tonight)

Anyway, nice job.
This will be pretty useful, heh.
Title: Re: Internal commands (2017 version)
Post by: Dav999 on September 8, 2017, 08:08:07 AM
All updated! I also added redcontrol, greencontrol, bluecontrol, yellowcontrol, purplecontrol, foundlab, foundlab2 and entersecretlab.
Title: Re: Internal commands (2017 version)
Post by: Kiwi Alexia ♡ on September 8, 2017, 11:27:32 AM
Also, what about warp(x)?
Title: Re: Internal commands (2017 version)
Post by: FIQ on September 8, 2017, 04:33:07 PM
IIRC createlastrescued is used in the main game for spawning the last rescued crewmate right before the final level.
Title: Re: Internal commands (2017 version)
Post by: Info Teddy on December 10, 2017, 11:47:37 AM
why isn't this pinned
Title: Re: Internal commands (2017 version)
Post by: Dav999 on December 10, 2017, 12:47:42 PM
It is pinned, and has been for a while.
Title: Re: Internal commands (2017 version)
Post by: Info Teddy on December 10, 2017, 03:21:31 PM
weird, i thought it wasn't pinned

before i couldn't find it in the vvvvvv board