Internal commands

Started by Hilbert, July 28, 2012, 01:23:29 PM

Previous topic - Next topic

Hilbert

Collect all internal commands here.

Dav999

#1
Commands in black are safe enough to use which, at most, can crash the game when you use them incorrectly. (Save the level before you test it and nothing can go wrong if you only use these commands.)
Commands in blue are not optimal for use in custom levels, because they only work in the real game.
Commands in orange are a bit dangerous to use and may corrupt your save data if you don't use them correctly.
Commands in red shouldn't be used at all, because these will corrupt your save data.
If I don't know what a command does, I have not coloured it, so that may happen if I know what it does.

squeak(colour) - makes a crewmate squeak (or makes a terminal sound)
text(colour,x,y,lines) - creates a text box (which doesn't appear until you use speak_active or speak)
position(center/centerx/centery/colour,above/colour,below) - overrides the x,y of the text command (sets the position of the text box)
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, see below)
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, see below)
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, like this:
squeak(player)
text(gray,0,0,1)
This is text box one.
backgroundtext
speak_active
text(gray,0,50,1)
This is text box two!
backgroundtext
speak
text(gray,0,100,1)
They will appear all at once!
speak
endtext

Normally, a text box in internal scripting looks like this:
squeak(color)
text(color,x,y,lines)
[The text]
position(x[,x])
speak_active

After the last text box, or before a delay after a text box, use 'endtext', to make the text box disappear. You don't have to do this in between text boxes.
changeplayercolour(colour) - changes the colour of :viridian:
changecolour(colour a,colour b) - changes the colour of the crewmate with colour a into colour b (note: this only works with crewmates who have been created using the createcrewman command)
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 ifflag(n,script) in simplified scripting, but loads an internal script
loadscript(script) - load an internal script
iftrinkets(n,script) - same as iftrinkets(n,script) in simplfied scripting, but loads an internal script
iftrinketsless(n,script) - same as iftrinketsless(n,script) in simplfied scripting, but loads an internal script
   blue because: these four commands can only load scripts from the real game, and there are equivalents which load custom scripts instead of built-in scripts

customiftrinkets(n,script) - same as iftrinkets(n,script) in simplfied scripting
customiftrinketsless(n,script) - same as iftrinketsless(n,script) in simplfied scripting
createcrewman(x,y,colour,mood,direction) - creates a crewmate (not rescuable)
createentity(x,y,n,meta,meta) - creates an entity, I have a list of them, so if you want, I can post it here
   orange because: it is possible to create a teleporter with this command, which destroys your save data if you touch it

vvvvvvman() - you know what it does
undovvvvvvman() - back to normal
hideplayer() - makes :viridian: invisible
showplayer() - makes :viridian: visible
gamestate(x) - changes the gamestate (there is a list of gamestates in this topic)
   orange because: some gamestates destroy your save file, and it can really glitch the game if you don't use it correctly

gamemode(x) - gamemode(teleporter) to show the map, gamemode(game) to hide it
   blue because: It shows teleporters of the main game

blackout() - should make the screen black, but freezes the screen
blackon() - unfreezes the screen
   blue because: these two commands should make the screen black, but that only works in the real game for some reason. If you want to make the screen black, use fadeout() and fadein()

fadeout() - fades the screen to black
fadein() - fades back
untilfade() - wait until fadeout()/fadein() is completed
gotoroom(x,y) - teleport (without any effects) to room x+1,y+1
gotoposition(x,y,z) - teleport (without any effects) to position x,y in this room, and z is whether you are flipped or not, 1 for flipped, 0 for normal (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)
play(x) - play a song, but the song numbers are different:
0 - Path Complete
1 - Pushing Onwards
2 - Positive Force
3 - Potential For Anything
4 - Passion For Exploring
5 - Pause
6 - Presenting VVVVVV
7 - Plenary
8 - Predestined Fate
9 - ecroF evitisoP
10 - Popular Potpurri
11 - Pipe Dream
12 - Pressure Cooker
13 - Paced Energy
14 - Piercing The Sky

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 the music out
musicfadein() - opposite of musicfadeout() (doesn't seem to work)
stopmusic() - stops the music at once
resumemusic() - opposite of stopmusic() (doesn't seem to work)
playef(x,n) - play a sound effect (I have a list) I don't know what the n does, but just use playef(x) without the second argument until I found out what it does
changemood(colour,mood) - changes the mood of a crewmate (0 for happy, 1 for sad, only works for crewmates created with createcrewman)
everybodysad() - makes everybody sad (only for crewmates created with createcrewman + :viridian:)
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)
face(a,b) - makes the face of crewmate a point to crewmate b (only works with crewmates created with createcrewman)
companion(x) - I don't know exactly how this works
   blue because: I have read it only works on :vermillion:

changeai(crewmate,followplayer/followpurple/followyellow/followred/followgreen/followblue/faceplayer/followposition,x/panic/faceleft/faceright) - can change the face direction of a crewmate or the walking behaviour
changedir(colour,direction) - just like changeai(colour,faceleft/faceright), this changes face direction, 0 is left, 1 is right
walk(left/right,x) - makes :viridian: walk
flipgravity(colour) - flips the gravity of a certain crewmate (it won't always work on yourself)
changegravity - haven't tested it
flipme - makes :viridian: flip/go to the ceiling (?) Doesn't have anything to do with flipping Viridian It has something to do with text boxes in flip mode.
tofloor - makes :viridian: go to the floor. This has always worked for me, actually.
flip - make :viridian: flip either way, this always works.
foundtrinket(x) - makes a trinket found
runtrinketscript - Play Passion For Exploring?
   blue because: you can just use play(4) to play Passion For Exploring, and I guess this will do something different when used in the real game.

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
   blue because: 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
   blue because: I think these only work for crewmates in the real game

finalmode(x,y) - final level (46,54)
   blue because: why would you want to use the final level in custom levels?

setcheckpoint() - sets the checkpoint to the current location
textboxactive - no idea what this does.
ifexplored(x,y,script) - if x+1,y+1 is explored, go to script
   blue because: I guess it loads an internal script, but I think you can use ifexplored(x,y,stop) and customiftrinkets(0,customscript) to go to a script if an area has not been explored yet

iflast(crewmate,script) - if crewmate x was rescued last, go to script (it uses numbers here: 2: :vitellary: 3: :vermillion: 4: :verdigris: 5 :victoria: (I don't know the number for :viridian: and :violet:)
   blue because: I think these only work for crewmates in the real game

ifskip(x) - if you skip the cutscenes in No Death Mode, go to script x
   blue because: you can't skip cutscenes in custom levels

ifcrewlost(a,b) - if crewmate a is lost, go to script b
   blue because: I think these only work for crewmates in the real game, and if it does work, it probably loads an internal script

showcoordinates(x,y) - show coordinates x,y on the map
hidecoordinates(x,y) - hide coordinates x,y on the map
   -NOTE: This works for the map for custom levels in 2.1
showship - show the ship on the map?
hideship - hide the ship on the map?
   blue because: I guess that if you have made the ship at the exact same location as in the real game, that you can make the ship purple, but otherwise: no.

showsecretlab - show the secret lab on the map?
hidesecretlab - hide the secret lab on the map?
   blue because: again, only if you have made the secret lab at the exact same location as in the real game, this command makes sense.

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?
   blue because: There is no way you have all teleporters or trinkets at the same location as in the real game, but maybe hidetrinkets can be used to hide all trinkets from the map, if the map in 2.1 shows trinkets (I have no idea what a 2.1 map looks like)

hascontrol() - makes the player have control, however doesn't work in the middle of scripts
nocontrol() - the opposite of hascontrol()
specialline(x) - special dialogs, with text(colour,0,0,0) before it?
   blue because: I have never seen any of the lines below these commands (they're talking about lollipops ???) and I don't know when you see them

destroy(gravitylines) - same behaviour as simplified command
destroy(warptokens) - same behaviour as simplified command
destroy(platforms) - same (glitchy) behaviour as simplified command
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!)
   red because: this is one of the two commands in this list which you really shouldn't use, to make a long story short: it destroys your teleporter save, regardless of how you 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)"
   blue because: you can't control what happens if you press enter

createrescuedcrew() - creates all rescued crewmates
   blue because: crewmates rescued with rescued(colour), so you have to put that command in a script box after you rescue a certain crewmate to make this work.

trinketyellowcontrol() - diolog 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
   blue because: I don't think there is a purpose for using this in a custom level

rollcredits() - makes the credits roll.
   red because: It destroys your save after the credits are completed!

teleportscript(levelonecomplete) - used to set a script which is run when you use a teleporter (in this case levelonecomplete)
   blue because: It loads an internal script, and you can't really use teleporters, and if you make them with createentity(x,y,14,0,0), you'll have to touch the teleporter which corrupts your save data

clearteleportscript() - clears the teleporter script set with teleporterscript(x)
   blue because: It is useless without teleportscript(x) and this command isn't even used in the game itself!

moveplayer(x,y) - moves the player x pixels to the right and y pixels down (and of course you can also use negative numbers to make him move up or to the left)
do(n) - unused command, starts a loop block which will repeat n times
loop - put this at the end of the loop block
Quote from: Examplecutscene()
untilbars()
squeak(terminal)
text(gray,0,0,1)
You will hear 3 coin sounds in a row.
position(center)
speak_active
endtext
do(3)
playef(4)
delay(20)
loop

squeak(terminal)
text(gray,0,0,1)
The loop has ended.
position(center)
speak_active
endtext
endcutscene()
untilbars()
leavesecretlab() - turn off "secret lab mode"
   blue because: the secret lab is not accessible in custom levels.


Some commands I'm not sure about if they exist or not:

ifwarp(x)

Some new ones which I will test:
resumemusic()
musicfadein()

That's all I know for now... :viridian:

Important: if you have to specify a certain crewmate, don't use their names, because that won't work. Use their colours:
:viridian: = cyan or player
:victoria: = blue
:vermillion: = red
:vitellary: = yellow
:verdigris: = green
:violet: = purple
= gray or terminal


HOW TO USE INTERNAL COMMANDS:

There are two methods to do it. Those methods are listed below, and I attached an example with those two methods as a vvvvvv level.

--- METHOD 1 - THE SAY(-1) METHOD ---

say(-1)
text(1,0,0,4)
say(5)
{internal command}
{internal command}
{internal command}
{internal command}
text(1,0,0,4)
say(5)
{internal command}
{internal command}
{internal command}
{internal command}
text(1,0,0,4)
say(5)
...


It has to end with:

...
{internal command}
{internal command}
{internal command}
{internal command}
text(1,0,0,4)
say(4)
endtext
endcutscene()
untilbars()
loadscript(stop)


You don't have to use say(5) if you want to use less than 4 commands in a row, you can use say(4) to have 3 commands in a row, say(3) to have 2 commands in a row, et cetera. For example:

say(-1)
text(1,0,0,4)
say(4)
{internal command}
{internal command}
{internal command}
text(1,0,0,4)
say(5)
{internal command}
{internal command}
{internal command}
{internal command}
text(1,0,0,4)
say(2)
{internal command}
text(1,0,0,4)
say(4)
endtext
endcutscene()
untilbars()
loadscript(stop)


Text boxes in internal scripting are a bit hard to do, because you can only use 4 lines in a row. There's a post somewhere else in this topic which explains how to do it. This post is already REALLY long.

--- METHOD 2 - WITHOUT CUTSCENE BARS---

If you want to use internal commands without cutscene bars, put this in the script box which Viridian walks through:

Code (script1) Select
iftrinkets(0,script2)

Then make a new script. In this case the new script is called 'script2' (you can use any name using a-z or 0-9, note that A-Z and some special characters should not be used). Delete the script box, so that Viridian doesn't activate it directly. The script has to be activated by the script containing iftrinkets(0,script2).

The second script should look like this:

Code (script2 first part) Select
say(5)
{internal command}
{internal command}
{internal command}
{internal command}
text(1,0,0,4)
say(5)
{internal command}
{internal command}
{internal command}
{internal command}
text(1,0,0,4)
say(5)
...


It has to end with:

Code (script2 last part) Select
...
{internal command}
{internal command}
{internal command}
{internal command}
text(1,0,0,4)
say(2)
endtext
loadscript(stop)
text(1,0,0,4)


Note that in the last part of this script, there has to be one blank line after the last text(1,0,0,4). Not 0, because then things get deleted because of a bug in the script editor, and not more than 1, because then it won't work. 'text(1,0,0,4)' has to be the second last line, and the last line has to be empty.

Just like in the say(-1) method, you don't have to use say(5) if you want to use less than 4 commands in a row, you can use say(4) to have 3 commands in a row, say(3) to have 2 commands in a row, et cetera. For example:

Code (script2) Select
say(4)
{internal command}
{internal command}
{internal command}
text(1,0,0,4)
say(5)
{internal command}
{internal command}
{internal command}
{internal command}
text(1,0,0,4)
say(2)
{internal command}
text(1,0,0,4)
say(2)
endtext
loadscript(stop)
text(1,0,0,4)

FIQ

Do you have the *full* gamestate list?

Dav999

#3
Quote from: FIQ on July 28, 2012, 05:56:06 PM
Do you have the *full* gamestate list?

This should be complete:

2 - "To do: write quick intro to story!"
4 - "Press arrow keys or WASD to move"
5 - Fadeout, fadein, play Passion for Exploring
8 - "Press enter to view map and quicksave"
9 - Super Gravitron
10 - Gravitron
11 - "When you're NOT standing on stop and wait for you"
12 - "You can't continue to the next room until he is safely accross."
14 - "When you're standing on the floor,"
16 - Makes Viridian sad
17 - "If you prefer, you can press UP or DOWN instead of ACTION to flip."
22 - "Press ACTION to flip"
30 - "I wonder why the ship teleported me here alone?" "I hope everyone else got out ok..."
31 - "Violet, is that you?" cutscene
32 - "A teleporter!" "I can get back to the ship with this!"
33 - Victoria-cutscene
34 - Vitellary-cutscene
35 - Verdigris-cutscene
36 - Vermilion-cutscene
37 - Vitellary after gravitron
38 - Vermilion after gravitron
39 - Verdigris after gravitron
40 - Victoria after gravitron
47 - "Ohh! I wonder what that is?" trinket cutscene
48 - "This seems like a good place to store anything I find out there..." (Victoria not found yet)
49 - Play Predestined Fate
50 - "Help! Can anyone hear this message?"
51 - "Verdigris? Are you out there? Are you ok?"
52 - "Please help us! We've crashed and need assistance!"
53 - "Hello? Anyone out there?"
54 - "This is Doctor Violet from the D.S.S. Souleye! Please respond!"
55 - "Please... Anyone..."
56 - "Please be alright, everyone..."
With gamestate 50-56, you can choose where to start, because everything will appear after each other (did anyone know that if you wait after "Help! Can anyone hear this message?", there will be more text?)
81 - Go back to the main menu
82 - Results of time trial
84 - Results of time trial (I think 82 works better than 84)
85 - Flash + play Positive Force
90 - First cutscene (goes to another location)
91 - Play Potential For Anything (also goes to another location)
92 - Same as above (but goes to another location as above)
93 - Go to another location and play Positive Force
94 - Go to another location and play Pushing Onwards
97 - Go to another location and play Pipe Dream
100 - Verdigris: "Captain! I've been so worried!"
101 - Same as above
102 - Same as above
104 - "I'm glad you're ok!" dialog that will never go away
106 - "I've been trying to find a way out, but I keep going around in circles..."
108 - "Don't worry! I have a teleporter key!"
110 - "Follow me!"
115 - Red dialog at the bottom of the screen saying "Sorry Eurogamers! Teleporting around the map doesn't work in this version!"
116 - Same as above
120 - Flip, and then Vitellary says: "Captain! You're ok!" "I've found a teleporter, but I can't get it to go anywhere..." Viridian: "I can help with that!" "I have the teleporter codex for our ship!" Vitellary: "Yey! Let's go home!" (never heard of this cutscene before? :-\)
121 - Same as above
122 - Same as above, but without flipping
124 - "I've found a teleporter, but I can't get it to go anywhere..."
126 - "I can help with that!"
128 - "I have the teleporter codex for our ship!"
130 - "Yey! Let's go home!"
200 - Final mode
3050 - Level Complete! You have rescued Violet!
4010 - Flash + warp
4070 - The Final Level, but the game will crash when you reach timeslip!
4080 - Captain teleported back to the ship: "Hello!" [C[C[C[C[Captain!] cutscene + credits
!!!The above will mess up your save data so don't do it unless you backed up!!!
4090 - Cutscene after you complete space station 1

Please note that gamestates are dangerous and can mess up save data (like 4080)!

EDIT: I meant space station, not intermission.

TheoX

Wow!  How many of these are new and how many were there before?

Quote from: Dav999 on July 28, 2012, 01:43:41 PM
vvvvvvman() - you know what it does
I actually don't.  :-\

ToasterApocalypse

Quote from: TheoX on July 28, 2012, 09:07:31 PM
Wow!  How many of these are new and how many were there before?

Quote from: Dav999 on July 28, 2012, 01:43:41 PM
vvvvvvman() - you know what it does
I actually don't.  :-\

You know in the laboratry cutscene after getting all 20 trinkets
you go huge

yes

Hilbert

#6
Quote from: TheoX on July 28, 2012, 09:07:31 PM
Wow!  How many of these are new and how many were there before?

Quote from: Dav999 on July 28, 2012, 01:43:41 PM
vvvvvvman() - you know what it does
I actually don't.  :-\
COMBINE INTO AN UBER- GIANT GUY LIKE IN THE SPOILERS secret lab CUTSCENE

FIQ

#7
Here is the *complete* gamestate list if anyone wonders (Edited some of yours to detail exactly what happens) :p

Quote0 - Break out from most gamestates
1 - Set gamestate to 0 (i.e. same as above in practice)
2 - "To do: write quick intro to story!"
4 - "Press arrow keys or WASD to move"
5 - Runs the script "returntohub" (i.e. fadeout, teleport to right before The Tower, fadein, play Passion for Exploring)
7 - Removes textboxes
8 - "Press enter to view map and quicksave"
9 - Super Gravitron
10 - Gravitron
11 - "When you're NOT standing on stop and wait for you" (Tries to access flipmode check to write "the ceiling" or "the floor", and check crewmate, but as this fails, the above prints instead)
12 - "You can't continue to the next room until he is safely accross."
13 - Removes textboxes quickly
14 - "When you're standing on the floor," (the same applies here as for 11)
15 - Makes Viridian happy
16 - Makes Viridian sad
17 - "If you prefer, you can press UP or DOWN instead of ACTION to flip."
20 - If flag 1 is 0, set flag 1 to 1 and remove textboxes
21 - If flag 2 is 0, set flag 2 to 1 and remove textboxes
22 - "Press ACTION to flip"
30 - "I wonder why the ship teleported me here alone?" "I hope everyone else got out ok..."
31 - "Violet, is that you?" cutscene (as long as flag 6 is 0)
32 - If flag 7 is 0: "A teleporter!" "I can get back to the ship with this!"
33 - If flag 9 is 0: Victoria-cutscene
34 - If flag 10 is 0: Vitellary-cutscene
35 - If flag 11 is 0: Verdigris-cutscene
36 - If flag 8 is 0: Vermilion-cutscene
37 - Vitellary after gravitron
38 - Vermilion after gravitron
39 - Verdigris after gravitron
40 - Victoria after gravitron
41 - If flag 60 is 0: run the beginning of intermission 1 cutscene
42 - If flag 62 is 0: run the 3rd intermission 1 cutscene
43 - If flag 63 is 0: run the 4th intermission 1 cutscene
44 - If flag 64 is 0: run the 5th intermission 1 cutscene
45 - If flag 65 is 0: run the 6th intermission 1 cutscene
46 - If flag 66 is 0: run the 7th intermission 1 cutscene
47 - If flag 69 is 0: "Ohh! I wonder what that is?" trinket cutscene
48 - If flag 70 is 0: "This seems like a good place to store anything I find out there..." (Victoria not found yet)
49 - If flag 71 is 0: Play Predestined Fate
50 - "Help! Can anyone hear this message?"
51 - "Verdigris? Are you out there? Are you ok?"
52 - "Please help us! We've crashed and need assistance!"
53 - "Hello? Anyone out there?"
54 - "This is Doctor Violet from the D.S.S. Souleye! Please respond!"
55 - "Please... Anyone..."
56 - "Please be alright, everyone..."
With gamestate 50-56, you can choose where to start, because everything will appear after each other (did anyone know that if you wait after "Help! Can anyone hear this message?", there will be more text?)
80 - If screen is black (and only if), continue to state 81 (My guess is that this is called when ESC is pressed, before the pause meny opens)
81 - Go back to the main menu
82 - Results of time trial (bugged)
83 - If screen is back, continue to state 84
84 - Results of time trial (I think 82 works better than 84)
85 - The Time Trial version of gamestate 200 (Flash, play Positive Force, turn on finalstretch mode)
States 90-95 are time trial related, but doesn't work properly in custom levels. The only real effects that happens in custom levels is a warp, and music change
90 - Space Station 1
91 - The Laboratory
92 - Warp Zone
93 - The Tower
94 - Space Station 2
95 - Final Level
96 - If the screen is black, continue to state 97
97 - Exit from Super Gravitron (teleport and play Pipe Dream)
100 - If flag 4 is 0: continue to state 101
101 - If you are flipped, flip back to floor, continue to state 102
The following states (102-112) tries to go to the current state + 1, like in 50-56 (but doesn't loop around), but may glitch as half of the states (103, 105, 107, 109, 111) doesn't exist.
102 - Verdigris: "Captain! I've been so worried!"
104 - "I'm glad you're ok!"
106 - "I've been trying to find a way out, but I keep going around in circles..."
108 - "Don't worry! I have a teleporter key!"
110 - "Follow me!"
112 - Removes textboxes
115 - Essentially nothing, continue to state 116
116 - Red dialog at the bottom of the screen saying "Sorry Eurogamers! Teleporting around the map doesn't work in this version!", continue to state 117, which doesn't exist, so things may fail
118 - Removes textboxes
State 120-128 works a bit like 102-112, i.e. in a series, but with less broken things
120 - If flag 5 is 0: continue to state 121
121 - If you're on the floor, flip.
122 - Vitellary: "Captain! You're ok!"
124 - Vitellary: "I've found a teleporter, but I can't get it to go anywhere..."
126 - "I can help with that!"
128 - "I have the teleporter codex for our ship!"
130 - "Yey! Let's go home!" (never heard of this cutscene before? Probably things Terry played with before coming up with the current story/etc /fiq)
132 - Removes textboxes
200 - Final mode
1000 - Turns on cutscenebars, freezes the game, continue to state 1001
1001 - You got a shiny trinket! dialog (but you didn't actually get any, this is just called each time you get one), continue to state 1003
1003 - Revert game to normal
1010 - You found a crewmate! in the same manner as for trinkets
2000 - Save the game
2500-2509 - Perform a teleport to some weird non-existent location, supposedly to The Laboratory I guess, continue to state 2510
2510 - Viridian: "Hello?", continue to state 2512
2512 - Viridian: "Is anybody there?", continue to state 2514
2514 - Removes textboxes, play Potential For Anything
3000-3099 states:
3000-3005 - Level Complete! You've rescued the crewmate applied to companion(), defaults to Verdigris. 6=Verdigris, 7=Vitellary, 8=Victoria, 9=vermillion, 10=viridian (yes, really), 11=Violet (Gamestates: 3006-3011=Verdigris, 3020-3026=Vitellary, 3040-3046=Victoria, 3060-3066=Vermillion, 3080-3086=Viridian, 3050-3056=Violet)
3070-3072 - Perform postrescue things, usually return to ship
4010 - Flash + warp
4070 - The Final Level, but the game will crash when you reach timeslip! (Because of how the game gets entity information, which is broken in custom levels)
4080 - Captain teleported back to the ship: "Hello!" [C[C[C[C[Captain!] cutscene + credits
!!!The above will mess up your save data so don't do it unless you backed up!!!
4090 - Cutscene after you complete space station 1

There is more but I can't check more at the moment

Some commands:
foundtrinket(x) - Found a trinket. x is the trinket ID (1-20 usually). The ID is hard to grab in a custom level, bruteforce if you're uncertain and see which is removed. 21+ will increase the trinket counter but not actually give any trinkets - in case you want secrets for 105%+ trinket completion :)
runtrinketscript - Makes the music continue as normal (plays Passion for exploring from where it stopped if you ran the above when it was playing already, if not, play it from the beginning). If you're using foundtrinket(), I suggest that you use a combination of endtext() and play() instead.
ifexplored(x,y,script) - If x+1,y+1 is explored, run "script"
iflast(x,script) - if crewmember x was the last one rescued, run "script"
specialline(x) - Some dialogs are called by this (x is a number). No idea why really
altstates(x) - Change altstate.

In the normal game, 2 maps has more than one layout. These can be switched by switching the altstate. The rooms affected is the trinket room @ship and the secret lab entrance. 0 is normal (normal trinket room, open entrance). 1 is exploded-trinkets trinket room and a secret lab entrance with 2 walls. 2 is when one of the walls is broken by VVVVVV Man.

Dav999

How did you discover all the flag-related things? :o

Maybe there are also gamestates with letters, just like music(0a), music(5a) and music(9a)!

FIQ

#9
Quote from: Dav999 on July 28, 2012, 10:15:19 PM
How did you discover all the flag-related things? :o

Maybe there are also gamestates with letters, just like music(0a), music(5a) and music(9a)!
I cheated. Not going to tell more than that, to prevent Terry from being mad at me. :D
I also cheated to find the gamestate for "game complete" in Back to VVVVVV (otherwise I just did things the same way as you to look scripts)
There are no gamestates with letters.

music(5a) isn't really a music ID - I just inserted "a" in my examples to show how you could trick the parser to play track 5 instead of translaing music(5) to play(6).

Dav999

Quote from: FIQ on July 28, 2012, 10:20:35 PM
I cheated. Not going to tell more than that, to prevent Terry from being mad at me. :D

I actually tried the first 203 gamestates one by one, then I searched in the binary for the remaining gamestates (the four digit ones). I wonder what you mean with 'cheated'? ??? :-\

Pyrite


blue626

Quote from: TheoX on July 28, 2012, 09:07:31 PM
Wow!  How many of these are new and how many were there before?

Note that these are part of internal scripting, meaning that they were commands used in the main game and should not be used in user levels. Actually, you need to use a combination of say commands to use them in user levels (in other ways the commands would be erased), but they still will create glitches, unless you know how to use them well. Some people have already used them in levels, but I still recommend to not use them. I suppose they are the same in 2.0 and 2.1.beta..


The "I have a teleported key!" cutscenes don't appear in the game in versions 1.2, 2.0 and, probably, 2.1.beta. I wonder if these were used in beta versions or prototypes of the game, as well as the "Sorry Eurogamers" cutscene :D.
So many internal commands and gamestates! I wonder why there are big gaps in the gamestates' numbers.
FIQ: You already have seen the scripts of the main game (by opening agile on a text editor), didn't you? So, you know the flags used and the place and time on the game they're used. If you can test gamestates on custom levels you could just change the flags and watch! But, you must have done something else, that you can't say in the forums to prevent Terry from being mad at you... Does it have to do with the main game and its scripts? Did you play the main  game again?

Roskilla: Look at your post. I suppose that you wanted to write in white what you wrote in blue-green. Also, Toaster already said the same thing!

FIQ

Quote from: Dav999 on July 28, 2012, 10:42:14 PM
Quote from: FIQ on July 28, 2012, 10:20:35 PM
I cheated. Not going to tell more than that, to prevent Terry from being mad at me. :D

I actually tried the first 203 gamestates one by one, then I searched in the binary for the remaining gamestates (the four digit ones). I wonder what you mean with 'cheated'? ??? :-\
I really don't want to tell it (Hey Terry, if you care/wonder, throw me a PM).

manofperson: By tricking the parser, the explanation is in various places in this forum, but it all boils down to this:

say(-1)
text(1,0,0,4)
say(5)
internalscript
internalscript
internalscript
internalscript
text(1,0,0,4)
say(5)
internalscript
internalscript
internalscript
internalscript
text(1,0,0,4)
say(5)
...
text(1,0,0,4)
say(5)
internalscript
internalscript
endcutscene
untilbars
loadscript(stop)

blue626: agile? And no, not that. Yes, flags can be tested by bruteforcing, but that would take ages :P

Dav999

It's hard to extract the full game script from the binary, because it is compressed or something. I noticed that no line of text appears twice.
For example:


squeak(terminal)
text(gray,0,0,2)
This is a
terminal!
position(center)
speak_active
squeak(terminal)
text(gray,0,0,2)
Again, this is a
terminal!
position(center)
speak_active
squeak(terminal)
text(gray,0,0,2)
And this is another
example text!
position(center)
speak_active


Would appear in the binary as something like this (I use a hex editor to read the binary):


squeak(terminal).text(gray,0,0,2).This is a.terminal!.position(center).speak_active.Again, this is a.And this is another.example text!


Lines that are used more than once just disappear the second time!