The Open Level Project

Distractionware => VVVVVV => Topic started by: Dav999 on 7 May 2013, 05:19

Title: Internal commands
Post by: Dav999 on 7 May 2013, 05:19
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:
Code: [Select]
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:
Code: [Select]
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:
Code: [Select]
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 (http://www.wegenforum.nl/images/smilies/icon_facepalm.gif) 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: Example
cutscene()
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
(http://d2bm3ljpacyxu8.cloudfront.net/width/30/crop/0,0,30x35/afbeeldinge.webs.com/terminal.jpg) = 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 ---

Code: [Select]
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:

Code: [Select]
...
{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:

Code: [Select]
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)

(copy pasting from Distractionware)
Title: Re: Internal commands
Post by: Bearboy on 7 May 2013, 09:50
Good copy and paste skills  :cvitellary_pleased_right:
Title: Re: Internal commands
Post by: Hejmstel on 7 May 2013, 15:56
YEEEAAHHHHHHHHHHHHHHH
I loved that thread
Title: Re: Internal commands
Post by: nicholashin on 8 May 2013, 04:04
Let me post/copy-and-paste some more information here! Although the main reason for posting this is to notify people about the awesome alternative method of internal scripting :shiny:
I've re-worded a bit in some quotes  :viridian:

Quote from: Dav999
Another method for internal scripting:
Code: (scriptone) [Select]
iftrinkets(0,scripttwo)
(blank line)
Code: (scripttwo) [Select]
#
A)Say
<internal>
(blank line)
you can also write this:
Code: (scripttwo) [Select]
<internal>
(blank line)
This makes sure there's no terminal sound, and no cutscene bars.
You can use multiple simplified commands, and on the last two lines you write 'A)Say' and the internal command you want to use. Strangely enough, the internal command will always run first, then the simplified commands. You have to run the script from another script (with iftrinkets(0,asayscript)), and there should be exactly one empty line at the end of the script, not 0, because your internal command will be deleted, and also not 2, because then it doesn't work for some reason. If you don't want to use simplified commands, you can write # on the first line, or something similar.
Quote from: FIQ
Keep in mind that you CAN run multiple internal commands with the method, but you're limited to one line per script.
Code: (showtrinkets) [Select]
iftrinkets(0,showtrinkets1)
(blank line)
Code: (showtrinkets1) [Select]
iftrinkets(1,showtrinkets2)
A)Say
<internal>
(blank line)
Code: (showtrinkets2) [Select]
iftrinkets(1,showtrinkets3)
A)Say
<internal>
(blank line)
(…)
Quote from: FIQ
Entities is posted below. "Metadata" shows one, possibly two (which should be used in the specified order then) extra setting you can use. All are numbers, but you'll have to experiment what different numbers do. Modified by earlier list posted by ToasterApocalypse.
Code: [Select]
createentity(x,y,n,meta,meta)

x,y=coordinates
n=the number of the entity

0 - The player

1 - Enemy
Metadata: movement type, movement speed
Due to lacking needed data, you will only ever get a purple enemy box, unless you're in the VVVVVV polar dimension while doing the command

2 - Moving platform
Metadata: movement type, movement speed
Note that conveyors is implemented as moving platforms, see movement type 8 and 9.

3 - A disappearing platform

4 - A 1x1 quicker quicksand block

5 - A flipped Viridian, you will flip gravity when touched

6 - Weird red flashy thingy that disappears quickly

7 - Same as above, but doesn't flash and is coloured cyan

8 - A coin from the prototype
Metadata: Coin ID

9 - Trinket
Metadata: Trinket ID
Note that trinket ID start at 0, and everything above 19 will not be saved in the savefile once you restart the level

10 - Checkpoint
Metadata: Checkpoint state (0=flipped, 1=normal), Checkpoint ID (checks if the checkpoint is active or not)

11 - Horisontal gravity line
Metadata: Length in pixels

12 - Vertical gravity line
Metadata: Length in pixels

13 - Warp token
Metadata: Destination in tiles X axis, destination in tiles Y axis

14 - The round teleporter
Metadata: Checkpoint ID(?)

15 - Verdigris
Metadata: AI state

16 - Vitellary (flipped)
Metadata: AI state

17 - Victoria
Metadata: AI state

18 - Crewmate
Metadata: Colour (using raw color list, not the crewmate colors), mood

19 - Vermilion
Metadata: AI state

20 - Terminal
Metadata: Sprite, Script ID(?)

21 - Same as above but when touched the terminal doesn't light up
Metadata: Sprite, Script ID(?)

22 - Collected trinket
Metadata: Trinket ID

23 - Gravitron square
Metadata: Direction
If you input negative X coordinate (or too high), an arrow shows instead, just like in the real Gravitron

24 - Intermission 1 crewmate
Metadata: Raw color, mood
Doesn't seem to be affected by hazards, but should be. I'll have to look into this one

25 - Trophy
Metadata: Challenge identifier, sprite
If the challenge is completed, the base sprite ID (what you get if you use sprite=0) will change. Only use 0 or 1 if you want predictable results (0=normal, 1=flipped)

26: The warp token to the Secret Lab
Keep in mind that the warp is just implemented as a nice looking sprite. You'll have to script the functionality for yourself

55 - Rescueable crewmate
Metadata: Crewmate color. Color >6 will always show a *happy* Viridian

56 - Custom level enemy
Metadata: Movement type, movement speed
Keep in mind that if there's no enemies in the room, the enemy sprite data isn't updated correctly and it will just show what enemy you saw last time, or a square enemy

Undefined entities (27-50, 57+) give glitchy Viridians.
Quote from: Doormat
List of colors for createentity() crewmates:
Code: [Select]
0: Cyan
1: Flashy red (used for death)
2: Dark orange
3: Trinket color
4: Gray
5: Flashy white
6: Red (tiny bit darker than Vermilion)
7: Lime green (ala Viel)
8: Hot pink (ala Vaelyn)
9: Brilliant yellow
10: Flashy white
11: Bright cyan
12: Blue, same as Victoria
13: Green, same as Verdigris
14: Yellow, same as Vitellary
15: Red, same as Vermilion
16: Blue, same as Victoria
17: Lighter orange
18: Gray
19: Darker gray
20: Pink, same as Violet
21: Lighter gray
22: White
23: Flashy white
24-29: White
30: Gray
31: Dark, slightly purplish gray?
32: Dark cyan/green (ala Valso)
33: Dark blue
34: Dark green
35: Dark red
36: Dull orange
37: Flashy gray
38: Gray
39: Darker cyan/green
40: Flashier gray
41-99: White
100: Dark gray
101: Flashy white
102: Teleporter color
103 and onwards: White
Quote from: FIQ
Internal playlist
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
Quote from: FIQ
The effect list
Code: [Select]
0 - Flip to ceiling
1 - Flip back to floor
2 - Cry
3 - Trinket collected
4 - Coin collected
5 - Checkpoint touched
6 - Quicker quicksand block touched
7 - Normal quicksand block touched
8 - Gravity line touched
9 - Flash
10 - Warp
11 - Viridian squeak
12 - Verdigris squeak
13 - Victoria squeak
14 - Vitellary squeak
15 - Violet squeak
16 - Vermilion squeak
17 - Terminal touched
18 - Teleporter touched
19 - Alarm
20 - Terminal squeak
21 - Time trial countdown "3", "2", "1"
22 - Time trial countdown "Go!"
23 - VVVVVV Man breaking walls
24 - Crewmates (de)combining into VVVVVV Man
25 - New record in Super Gravitron
26 - New trophy in Super Gravitron
27 - Rescued crewmate (in custom levels)

28+ segfaults
Quote from: FIQ
Entity limit is 3000.
Script limit is 500.
Title: Re: Internal commands
Post by: Dav999 on 8 May 2013, 06:34
Quote from: Dav999
Another method for internal scripting:
Code: (scriptone) [Select]
iftrinkets(0,scripttwo)
(blank line)
Code: (scripttwo) [Select]
#
A)Say
<internal>
(blank line)
This makes sure there's no terminal sound, and no cutscene bars.
You can use multiple simplified commands, and on the last two lines you write 'A)Say' and the internal command you want to use. Strangely enough, the internal command will always run first, then the simplified commands. You have to run the script from another script (with iftrinkets(0,asayscript)), and there should be exactly one empty line at the end of the script, not 0, because your internal command will be deleted, and also not 2, because then it doesn't work for some reason. If you don't want to use simplified commands, you can write # on the first line, or something similar.

Actually, instead of this:

Code: (scripttwo) [Select]
#
A)Say
<internal>
(blank line)

you can write this:

Code: (scripttwo) [Select]
<internal>
(blank line)
Title: Re: Internal commands
Post by: IMG_4346.jpeg on 5 Jul 2013, 16:13


Actually, instead of this:

Code: (scripttwo) [Select]
#
A)Say
<internal>
(blank line)

you can write this:

Code: (scripttwo) [Select]
<internal>
(blank line)

So i can just stick in 1 internal script per scriptname? Kinda confused.  :verdigris:
Title: Re: Internal commands
Post by: Dav999 on 5 Jul 2013, 22:57


Actually, instead of this:

Code: (scripttwo) [Select]
#
A)Say
<internal>
(blank line)

you can write this:

Code: (scripttwo) [Select]
<internal>
(blank line)

So i can just stick in 1 internal script per scriptname? Kinda confused.  :verdigris:

Yes! The trick is that if you load a script with iftrinkets, it's going to execute the last line in that script (before the blank line) as an internal command.
Title: Re: Internal commands
Post by: IMG_4346.jpeg on 6 Jul 2013, 13:23
All right! Thanks for the  VVVVVVery fast reply.
Title: Re: Internal commands
Post by: IMG_4346.jpeg on 18 Jul 2013, 06:44
So. When I tried say-1, I got customposition(center) and a bunch of what looks like I messed up. What causes this?
Title: Re: Internal commands
Post by: Dav999 on 18 Jul 2013, 07:02
So. When I tried say-1, I got customposition(center) and a bunch of what looks like I messed up. What causes this?

Could you post everything in between <script> and </script> inside code tags here if you open the level in notepad, along with the name of the script which has problems?
Title: Re: Internal commands
Post by: IMG_4346.jpeg on 19 Jul 2013, 08:15
So. When I tried say-1, I got customposition(center) and a bunch of what looks like I messed up. What causes this?

Could you post everything in between <script> and </script> inside code tags here if you open the level in notepad, along with the name of the script which has problems?
Hold on... it was the flipme command that
Quote from: Dav999
Doesn't have anything to do with flipping Viridian  :facepalm:
Does that help?
Title: Re: Internal commands
Post by: Dav999 on 19 Jul 2013, 08:20
So. When I tried say-1, I got customposition(center) and a bunch of what looks like I messed up. What causes this?

Could you post everything in between <script> and </script> inside code tags here if you open the level in notepad, along with the name of the script which has problems?
Hold on... it was the flipme command that
Quote from: Dav999
Doesn't have anything to do with flipping Viridian  :facepalm:
Does that help?

If you post the script here, someone else might be able to fix it. I don't know how the flipme command would cause this, but why do you want to use that command?
Title: Re: Internal commands
Post by: FIQ on 19 Jul 2013, 14:29
So. When I tried say-1, I got customposition(center) and a bunch of what looks like I messed up. What causes this?

Could you post everything in between <script> and </script> inside code tags here if you open the level in notepad, along with the name of the script which has problems?
Hold on... it was the flipme command that
Quote from: Dav999
Doesn't have anything to do with flipping Viridian  :facepalm:
Does that help?

If you post the script here, someone else might be able to fix it. I don't know how the flipme command would cause this, but why do you want to use that command?
Only reason I can come up with is to fix headline position in Flip Mode. Though, as flipme doesn't even work properly in first place even in the real game...
Title: Re: Internal commands
Post by: Faces3210 on 23 Jul 2013, 04:06
Yes, I love gotoroom()!
Title: Re: Internal commands
Post by: FIQ on 23 Jul 2013, 04:12
Yes, I love gotoroom()!
Probably the single most useful command out of all internal scripts.
Title: Re: Internal commands
Post by: nicholashin on 24 Jul 2013, 01:43
Yes, I love gotoroom()!
Probably the single most useful command out of all internal scripts.
+1
If you need a reason to learn internal scripting, gotoroom() is the answer. Boss battles, simulating exhaust chute (http://tolp.net16.net/forum/index.php?topic=255.msg3631#msg3631), moving rooms (http://tolp.net16.net/forum/index.php?topic=133.msg2617#msg2617) (note: tOLP contributors exclusive), puzzles (http://distractionware.com/forum/index.php?topic=1219.0), and so much more.... Just too awesome.
Title: Re: Internal commands
Post by: Hejmstel on 24 Jul 2013, 01:53
Yes, I love gotoroom()!
Probably the single most useful command out of all internal scripts.
+1
If you need a reason to learn internal scripting, gotoroom() is the answer. Boss battles, simulating exhaust chute (http://tolp.net16.net/forum/index.php?topic=255.msg3631#msg3631), moving rooms (http://tolp.net16.net/forum/index.php?topic=133.msg2617#msg2617) (note: tOLP contributors exclusive), puzzles (http://distractionware.com/forum/index.php?topic=1219.0), and so much more.... Just too awesome.

Amen to that, brother.
Title: Re: Internal commands
Post by: FIQ on 26 Jul 2013, 13:20
Yes, I love gotoroom()!
Probably the single most useful command out of all internal scripts.
+1
If you need a reason to learn internal scripting, gotoroom() is the answer. Boss battles, simulating exhaust chute (http://tolp.net16.net/forum/index.php?topic=255.msg3631#msg3631), moving rooms (http://tolp.net16.net/forum/index.php?topic=133.msg2617#msg2617) (note: tOLP contributors exclusive), puzzles (http://distractionware.com/forum/index.php?topic=1219.0), and so much more.... Just too awesome.
gotoroom() is also vital for emulating background scripts without the feature actually existing, by warping to the same room you are in. ;)
Title: Re: Internal commands
Post by: nicholashin on 26 Jul 2013, 18:28
gotoroom() is also vital for emulating background scripts without the feature actually existing, by warping to the same room you are in. ;)
What's the point of emulating background scripts, just wondering?
Title: Re: Internal commands
Post by: FIQ on 26 Jul 2013, 19:15
gotoroom() is also vital for emulating background scripts without the feature actually existing, by warping to the same room you are in. ;)
What's the point of emulating background scripts, just wondering?
Several things, actually:
* Dialog which doesn't hinder gameplay (think Portal style, or the various help texts at the beginning of VVVVVV, achievement texts in the secret lab). One of the simpler, yet very useful, uses
* If you have way too much free time - a random number generator
* Background-altering rooms (think The Final Level)
* A counter that ticks to something
* User interfaces use them in a sense (think Level Select Menu in my level)

And much more, only your imagination (and VVVVVV's 500 scripts limit) can stop you :P
Title: Re: Internal commands
Post by: nicholashin on 26 Jul 2013, 19:35
gotoroom() is also vital for emulating background scripts without the feature actually existing, by warping to the same room you are in. ;)
What's the point of emulating background scripts, just wondering?
Several things, actually:
* Dialog which doesn't hinder gameplay (think Portal style, or the various help texts at the beginning of VVVVVV, achievement texts in the secret lab). One of the simpler, yet very useful, uses
* If you have way too much free time - a random number generator
* Background-altering rooms (think The Final Level)
* A counter that ticks to something
* User interfaces use them in a sense (think Level Select Menu in my level)

And much more, only your imagination (and VVVVVV's 500 scripts limit) can stop you :P
I actually made a sample level of changing backgrounds yesterday. I guess this is what you means by background-altering rooms :D
But how to use dialog not hindering gameplay? Don't say() and reply() commands themselves stop gameplay? I thought those were just well-positioned background texts  :beg:
Title: Re: Internal commands
Post by: Faces3210 on 27 Jul 2013, 05:33
gotoroom() is also vital for emulating background scripts without the feature actually existing, by warping to the same room you are in. ;)
What's the point of emulating background scripts, just wondering?
Several things, actually:
* Dialog which doesn't hinder gameplay (think Portal style, or the various help texts at the beginning of VVVVVV, achievement texts in the secret lab). One of the simpler, yet very useful, uses
* If you have way too much free time - a random number generator
* Background-altering rooms (think The Final Level)
* A counter that ticks to something
* User interfaces use them in a sense (think Level Select Menu in my level)

And much more, only your imagination (and VVVVVV's 500 scripts limit) can stop you :P
* Removing the wraparound in rooms
Title: Re: Internal commands
Post by: FIQ on 29 Jul 2013, 09:19
gotoroom() is also vital for emulating background scripts without the feature actually existing, by warping to the same room you are in. ;)
What's the point of emulating background scripts, just wondering?
Several things, actually:
* Dialog which doesn't hinder gameplay (think Portal style, or the various help texts at the beginning of VVVVVV, achievement texts in the secret lab). One of the simpler, yet very useful, uses
* If you have way too much free time - a random number generator
* Background-altering rooms (think The Final Level)
* A counter that ticks to something
* User interfaces use them in a sense (think Level Select Menu in my level)

And much more, only your imagination (and VVVVVV's 500 scripts limit) can stop you :P
I actually made a sample level of changing backgrounds yesterday. I guess this is what you means by background-altering rooms :D
But how to use dialog not hindering gameplay? Don't say() and reply() commands themselves stop gameplay? I thought those were just well-positioned background texts  :beg:
They do stop gameplay yes, unless backgroundtext is used before the "speak" command. This will not halt gameplay. By utilizing backgrounded scripts, you can make a timer to chose when these dialogs should disappear. Of course you don't *need* backgrounded scripts for this - but if you want them to disappear after a certain time instead of when moving forward a little, you do need background scripts.
Title: Re: Internal commands
Post by: IMG_4346.jpeg on 2 Aug 2013, 07:32
How does one use gotoposition? The coordinates are tripping me up  :victoria:
Title: Re: Internal commands
Post by: Dav999 on 2 Aug 2013, 08:33
How does one use gotoposition? The coordinates are tripping me up  :victoria:

gotoposition is mostly trial and error, but you can get the exact values by placing a checkpoint (or the starting point, temporarily) at the point you want to teleport to, and then play the level and save at that point. You can then open the save file (the .vvvvvv.vvv file in the Saves folder) of the level and look at the values for savex and savey. Those are the values you have to fill in. So if savex is 50 and savey is 112, you need to use gotoposition(50,112,0).
Title: Re: Internal commands
Post by: Woliken on 2 Aug 2013, 10:30
I use this thread as a reference guide for when I use the internal code. Mind posting the full list of gamestates, playefs and plays?
Title: Re: Internal commands
Post by: Probably Arvis on 2 Aug 2013, 10:40
I use this thread as a reference guide for when I use the internal code. Mind posting the full list of gamestates, playefs and plays?
Gamestates (http://tolp.net16.net/forum/index.php?topic=162.0;topicseen)
Title: Re: Internal commands
Post by: Dav999 on 2 Aug 2013, 10:42
I use this thread as a reference guide for when I use the internal code. Mind posting the full list of gamestates, playefs and plays?

Playefs and plays can be found in reply #3:
Quote from: FIQ
Internal playlist
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
Quote from: FIQ
The effect list
Code: [Select]
0 - Flip to ceiling
1 - Flip back to floor
2 - Cry
3 - Trinket collected
4 - Coin collected
5 - Checkpoint touched
6 - Quicker quicksand block touched
7 - Normal quicksand block touched
8 - Gravity line touched
9 - Flash
10 - Warp
11 - Viridian squeak
12 - Verdigris squeak
13 - Victoria squeak
14 - Vitellary squeak
15 - Violet squeak
16 - Vermilion squeak
17 - Terminal touched
18 - Teleporter touched
19 - Alarm
20 - Terminal squeak
21 - Time trial countdown "3", "2", "1"
22 - Time trial countdown "Go!"
23 - VVVVVV Man breaking walls
24 - Crewmates (de)combining into VVVVVV Man
25 - New record in Super Gravitron
26 - New trophy in Super Gravitron
27 - Rescued crewmate (in custom levels)

28+ segfaults

Arvis ninja'd me about the gamestates.
Title: Re: Internal commands
Post by: TheJonyMyster on 2 Aug 2013, 10:51
Well it should all be in the first post to have a monopoly on all scripting I mean so people can just look here.
Maybe this should be stickyd.
Title: Re: Internal commands
Post by: allison on 2 Aug 2013, 16:52
Well it should all be in the first post to have a monopoly on all scripting I mean so people can just look here.

Yeah, it'll be super annoying to have to comb through the thread
Title: Re: Internal commands
Post by: IMG_4346.jpeg on 17 Aug 2013, 07:47
Createentity is acting up. Gravitron squares and enemies are refusing to show up. Using 2.1.  :victoria:
EDIT:Fixed!
Title: Re: Internal commands
Post by: nicholashin on 13 Sep 2013, 06:18
How does a timer with gotoroom() work? I thought it was just use do() to loop, but it seems to make the time for executing each command extremely short. (No longer 30 times is about 1 s.) And the script will repeat again and again due to gotoroom() and I can't use a terminal for it too....
I even thought of use of flags or loadscript(stop), but they don't work....
Title: Re: Internal commands
Post by: nicholashin on 17 Sep 2013, 02:07
How does a timer with gotoroom() work? I thought it was just use do() to loop, but it seems to make the time for executing each command extremely short. (No longer 30 times is about 1 s.) And the script will repeat again and again due to gotoroom() and I can't use a terminal for it too....
I even thought of use of flags or loadscript(stop), but they don't work....
BUMP
Title: Re: Internal commands
Post by: IMG_4346.jpeg on 18 Sep 2013, 04:18
How does a timer with gotoroom() work? I thought it was just use do() to loop, but it seems to make the time for executing each command extremely short. (No longer 30 times is about 1 s.) And the script will repeat again and again due to gotoroom() and I can't use a terminal for it too....
I even thought of use of flags or loadscript(stop), but they don't work....
BUMP
Don't think you can...ask Dav or someone.
Title: Re: Internal commands
Post by: FIQ on 27 Sep 2013, 16:35
I made an example in that old thread in the distractionware forums. Let me copy/paste it here, sec...

...

ffffffff...
Title: Re: Internal commands
Post by: Dav999 on 27 Sep 2013, 22:11
I have a 'print' of that entire topic saved to my computer, will upload it in a few hours...

EDIT: http://tolp2.tk/misc/Internal%20commands.html (http://tolp2.tk/misc/Internal%20commands.html)
Title: Re: Internal commands
Post by: nicholashin on 28 Sep 2013, 08:51
I made an example in that old thread in the distractionware forums. Let me copy/paste it here, sec...

...

ffffffff...
I have a 'print' of that entire topic saved to my computer, will upload it in a few hours...

EDIT: http://tolp2.tk/misc/Internal%20commands.html (http://tolp2.tk/misc/Internal%20commands.html)
WOW Thanks for your help, but I assume FIQ made it in form of a level?
Title: Re: Internal commands
Post by: FIQ on 28 Sep 2013, 09:13
I have a 'print' of that entire topic saved to my computer, will upload it in a few hours...

EDIT: http://tolp2.tk/misc/Internal%20commands.html (http://tolp2.tk/misc/Internal%20commands.html)
That print is too old for my script I think, as I posted it pretty much right before the forums closed.
Title: Re: Internal commands
Post by: nicholashin on 30 Sep 2013, 21:45
I have a 'print' of that entire topic saved to my computer, will upload it in a few hours...

EDIT: http://tolp2.tk/misc/Internal%20commands.html (http://tolp2.tk/misc/Internal%20commands.html)
That print is too old for my script I think, as I posted it pretty much right before the forums closed.
Oh I see......I guess I just have to wait for Terry to miraculously realise that better security question should be used and reopen the forums.
Title: Re: Internal commands
Post by: Dav999 on 30 Sep 2013, 23:08
Oh I see......I guess I just have to wait for Terry to miraculously realise that better security question should be used and reopen the forums.

It may reopen any moment now, but I'm not sure because I don't know when the billing month ends...
Title: Re: Internal commands
Post by: nicholashin on 3 Oct 2013, 04:34
It's reopened!! Look at this print page for reference: http://distractionware.com/forum/index.php?action=printpage;topic=1089.0
Code: [Select]
counter_load:
ifflag(11,stop)
iftrinkets(0,counter) # load internal script

counter:
say(5) # this is one of the few needed internal scripts
gotoroom(0,0) # allow "script backgrounding"
customifflag(5,counter5) # increase counter of flag 5
customifflag(10,counter_started) # check if it has started at all
flag(10,on) # it hasn't
text(1,0,0,4)
say(5) # text
text(gray,-1,30,1)
Counter
backgroundtext
speak
text(1,0,0,4)
say(5)
text(red,-1,90,1)
10
backgroundtext
speak
text(1,0,0,4)
say(5) # set the flags to their current time, making it output 9 once a full second pass
flag(6,on)
flag(7,off)
flag(8,off)
flag(9,on)
loadscript(stop)
text(1,0,0,4)

counter_started:
flag(5,on)
delay(0)

counter5:
flag(5,off) # Do the splitsecond counter
ifflag(4,counter4)
flag(4,on)
delay(0) # those are needed to prevent a bug in VVVVVV

counter4:
flag(4,off)
ifflag(3,counter3)
flag(3,on)
delay(0)

counter3:
flag(3,off)
ifflag(2,counter2)
flag(2,on)
delay(0)

counter2:
flag(2,off)
ifflag(1,counter1)
flag(1,on)
delay(0)

counter1:
flag(1,off)
iftrinkets(0,counter_full0000) # trigger a second, check at the very bottom
delay(0)

# The full counters, sorted by when they occur (in practice). The first part which doesn't exist for odd numbers are continuing branching to other seconds, simulating integers. The second part sets the flags applied for the incoming second. The third part is actual output. While I could merge part 1 and 2 under the same text(1,0,0,4) part in some cirumstances, I didn't, to make it more understandable.

counter_full1001:
say(2)
flag(9,off)
text(1,0,0,4)
say(5)
text(red,-1,90,1)
09
backgroundtext
speak
loadscript(stop)
text(1,0,0,4)

counter_full1000:
say(2)
customifflag(9,counter_full1001)
text(1,0,0,4)
say(5)
flag(6,off)
flag(7,on)
flag(8,on)
flag(9,on)
text(1,0,0,4)
say(5)
text(red,-1,90,1)
08
backgroundtext
speak
loadscript(stop)
text(1,0,0,4)

counter_full0111:
say(2)
flag(9,off)
text(1,0,0,4)
say(5)
text(red,-1,90,1)
07
backgroundtext
speak
loadscript(stop)
text(1,0,0,4)

counter_full0110:
say(3)
customifflag(9,counter_full0111)
text(1,0,0,4)
say(3)
flag(8,off)
flag(9,on)
text(1,0,0,4)
say(5)
text(red,-1,90,1)
06
backgroundtext
speak
loadscript(stop)
text(1,0,0,4)

counter_full0101:
say(2)
flag(9,off)
text(1,0,0,4)
say(5)
text(red,-1,90,1)
05
backgroundtext
speak
loadscript(stop)
text(1,0,0,4)

counter_full0100:
say(3)
customifflag(8,counter_full0110)
customifflag(9,counter_full0101)
text(1,0,0,4)
say(4)
flag(7,off)
flag(8,on)
flag(9,on)
text(1,0,0,4)
say(5)
text(red,-1,90,1)
04
backgroundtext
speak
loadscript(stop)
text(1,0,0,4)

counter_full0011:
say(2)
flag(9,off)
text(1,0,0,4)
say(5)
text(red,-1,90,1)
03
backgroundtext
speak
loadscript(stop)
text(1,0,0,4)

counter_full0010:
say(2)
customifflag(9,counter_full0011)
text(1,0,0,4)
say(3)
flag(8,off)
flag(9,on)
text(1,0,0,4)
say(5)
text(red,-1,90,1)
02
backgroundtext
speak
loadscript(stop)
text(1,0,0,4)

counter_full0001:
say(2)
flag(9,off)
text(1,0,0,4)
say(5)
text(red,-1,90,1)
01
backgroundtext
speak
loadscript(stop)
text(1,0,0,4)

counter_full0000:
say(5)
customifflag(6,counter_full1000) # those are different states of flags
customifflag(7,counter_full0100)
customifflag(8,counter_full0010)
customifflag(9,counter_full0001)
text(1,0,0,4)
say(5)
text(red,-1,90,1)
00
backgroundtext
speak
text(1,0,0,4)
say(2)
flag(11,on) # stop the script
loadscript(stop)
text(1,0,0,4)
Title: Re: Internal commands
Post by: FIQ on 4 Oct 2013, 06:34
I just re-read the script, and found 2 obvious bugs. The code was just to show what I would do, not for actual use, but here goes:

In counter2:
-ifflag(2,counter1)
+ifflag(1,counter1)

In counter1:
-ifflag(1,counter_full0000)
+iftrinkets(0,counter_full0000)
Title: Re: Internal commands
Post by: FIQ on 18 May 2014, 14:30
Bump.

Since Terry has made clear that he doesn't intend to do anything regarding scripting - that is, neither fixing it, or improving it - this is still very relevant.

HOWEVER, Terry also made clear that he doesn't want to force people to update just to play player levels. This means that, unless someone wants to ignore that request, we should NOT abuse the fact that 2.1+ currently can work with say() (or reply() ) with lines above 5.

Basically, just pretend that the update never happened @ level scripting. Otherwise, him wanting to keep backward compatibility is rather pointless. Just saying : D

EDIT: And if you decide to ignore it regardless, at least do a version check.
Code: (checkversion) [Select]
squeak(off)
say(-1)
text(1,0,0,4)
say(2)
customiftrinkets(0,version20)
customiftrinkets(0,version21)
Title: a 1yr bump? rly fiq?
Post by: Info Teddy on 18 May 2014, 18:07
Bump.

Since Terry has made clear that he doesn't intend to do anything regarding scripting - that is, neither fixing it, or improving it - this is still very relevant.

HOWEVER, Terry also made clear that he doesn't want to force people to update just to play player levels. This means that, unless someone wants to ignore that request, we should NOT abuse the fact that 2.1+ currently can work with say() (or reply() ) with lines above 5.

Basically, just pretend that the update never happened @ level scripting. Otherwise, him wanting to keep backward compatibility is rather pointless. Just saying : D

EDIT: And if you decide to ignore it regardless, at least do a version check.
[code=checkversion]NOBODY CARES ABOUT THIS[/code]
you know how some random person created mcedit for minecraft just to make modifying maps easier? someone should make an external scripting editor for vvvvvv so we won't have to repeat text() and say() every 4 lines. the program takes the script data from a level, we just throw in our commands, the program adds in the necessary text() and say() crap, then uploads it into the level.
Title: Re: Internal commands
Post by: Hejmstel on 18 May 2014, 18:09
Quote
a 1yr bump? rly fiq?
if it's relevant to the topic and adds something, it's fine.
Title: still,,,,,,,,
Post by: Info Teddy on 18 May 2014, 18:12
if it's relevant to the topic and adds something, it's fine.
okay, then.
Title: Re: a 1yr bump? rly fiq?
Post by: FIQ on 18 May 2014, 21:37
Bump.

Since Terry has made clear that he doesn't intend to do anything regarding scripting - that is, neither fixing it, or improving it - this is still very relevant.

HOWEVER, Terry also made clear that he doesn't want to force people to update just to play player levels. This means that, unless someone wants to ignore that request, we should NOT abuse the fact that 2.1+ currently can work with say() (or reply() ) with lines above 5.

Basically, just pretend that the update never happened @ level scripting. Otherwise, him wanting to keep backward compatibility is rather pointless. Just saying : D

EDIT: And if you decide to ignore it regardless, at least do a version check.
[code=checkversion]NOBODY CARES ABOUT THIS[/code]
you know how some random person created mcedit for minecraft just to make modifying maps easier? someone should make an external scripting editor for vvvvvv so we won't have to repeat text() and say() every 4 lines. the program takes the script data from a level, we just throw in our commands, the program adds in the necessary text() and say() crap, then uploads it into the level.
Oh yeah, I'm all for an external VVVVVV level editor. The internal one is fine enough, but it could use some work, but since there wont be any work done with it, I suppose an external editor could be useful. Not just for scripting, but for other stuff too like better tile management and such nice things.
Title: external level editing.
Post by: Info Teddy on 18 May 2014, 21:46
Oh yeah, I'm all for an external VVVVVV level editor. The internal one is fine enough, but it could use some work, but since there wont be any work done with it, I suppose an external editor could be useful. Not just for scripting, but for other stuff too like better tile management and such nice things.
and 40x40 maps that won't crash when you attempt to save them in-game!
Title: Re: external level editing.
Post by: FIQ on 19 May 2014, 06:38
Oh yeah, I'm all for an external VVVVVV level editor. The internal one is fine enough, but it could use some work, but since there wont be any work done with it, I suppose an external editor could be useful. Not just for scripting, but for other stuff too like better tile management and such nice things.
and 40x40 maps that won't crash when you attempt to save them in-game!
Not possible.
40x40 is way too big for such a thing anyway.
Title: Re: Internal commands
Post by: FIQ on 12 Jun 2014, 09:55
If you want to use Predestined Fate Remixed in the level, I suggest doing this:

Code: [Select]
music_predestinedfate2:
music(6)
music(15a)

Or, internally:
Code: [Select]
music_predestinedfate2:
say(3)
play(8)
play(15)
loadscript(stop)
text(1,0,0,4)

This will ensure that 2.0 and 2.1 users will hear Predestined Fate rather than Predestined Fate 2. Keep in mind that this will currently break in the Windows version of M&P because for some reason that version lacks the remixed Predestined Fate. However, this version is supposed to see a patch very soon, so we should be OK using this.
Title: Re: Internal commands
Post by: allison on 13 Sep 2014, 18:26
I've been messing around with internal scripting in 2.2. The maximum number of lines in a "block" [say(x)] aren't unlimited; the maximum is 50.
Title: thatsridiculous.wav
Post by: Info Teddy on 13 Sep 2014, 19:00
I've been messing around with internal scripting in 2.2. The maximum number of lines in a "block" [say(x)] aren't unlimited; the maximum is 50.
why is there a maximum anyway
Title: Re: thatsridiculous.wav
Post by: allison on 13 Sep 2014, 20:27
I've been messing around with internal scripting in 2.2. The maximum number of lines in a "block" [say(x)] aren't unlimited; the maximum is 50.
why is there a maximum anyway
https://www.youtube.com/watch?v=t348e24vDyA
Title: waitwhat.wav
Post by: Info Teddy on 13 Sep 2014, 21:05
https://www.youtube.com/watch?v=t348e24vDyA
is it because i stole your eye pee
Title: Re: Internal commands
Post by: Demonic Starlow on 10 Feb 2015, 04:08
Sorry for the bump, but I have something relevant to add to the list of gamestates:
3500 - Pause for a minute, continue to state 3501
3501 - Game Complete, continue to state 3502
3502-3507 just show stats
Title: Probably all.
Post by: Info Teddy on 30 Mar 2015, 21:32
Sorry for the bump, but I have something relevant to add to the list of gamestates:
3500 - Pause for a minute, continue to state 3501
3501 - Game Complete, continue to state 3502
3502-3507 just show stats
Are these for v2.0, v2.1, or v2.2?
Title: Re: Probably all.
Post by: Ally 🌠 on 15 Aug 2015, 12:06
Sorry for the bump, but I have something relevant to add to the list of gamestates:
3500 - Pause for a minute, continue to state 3501
3501 - Game Complete, continue to state 3502
3502-3507 just show stats
Are these for v2.0, v2.1, or v2.2?
Hmm, I might look. but really last post in march? (SHIT, I DIDN'T KNOW I BUMPED THIS)
EDIT: Yes they do in fact work!!!
Title: Because you didn't say which version works.
Post by: Info Teddy on 19 Aug 2015, 20:07
Hmm, I might look. but really last post in march?
EDIT: Yes they do in fact work!!!
Do they work in v2.0, v2.1, or v2.2?
Title: Re: Internal commands
Post by: som1sezhi on 20 Aug 2015, 10:47
works in 2.2 make & play, although "press ACTION to continue" doesn't seem to work
also, the default hardest room is Welcome Aboard, even if you don't have a room named that
Title: Guess that makes one thing where Java is better than C++.
Post by: Info Teddy on 20 Aug 2015, 17:42
works in 2.2 make & play, although "press ACTION to continue" doesn't seem to work
also, the default hardest room is Welcome Aboard, even if you don't have a room named that
Oh, that's interesting. I always thought that the default room would be the first room that you started in, but apparently you shouldn't have intuitive logic when programming games in C++.
Title: Re: Internal commands
Post by: Ally 🌠 on 22 Aug 2015, 17:04
Dav have you posted a list for playef()? I need one for some reason
Title: Re: Internal commands
Post by: Dav999 on 22 Aug 2015, 17:13
Dav have you posted a list for playef()? I need one for some reason
There's a list in this post (http://tolp2.nl/forum/index.php?topic=21.msg145#msg145) :)
Title: Re: Internal commands
Post by: Ally 🌠 on 1 Sep 2015, 08:28
Just ignore this stupid post please
Title: Re: Internal commands
Post by: som1sezhi on 1 Sep 2015, 16:57
ADD THIS TO THE ENTITY LIST:
SHINYWOLF07 FIGURED THIS OUT:
32 - Crewmate that follows player
Metadata: Color (Using raw colors, not crewmate colors), Happy of sad (0 is happy, 1 is sad)
EXAMPLE: createentity(0,55,24,32,0) would give you Valso that follows you.
THANKS SHINYWOLF07 FOR FIGURING THIS OUT!
createentity(0,55,24,32,0)

k then

Quote from: somewhere on this thread
24 - Intermission 1 crewmate
Metadata: Raw color, mood
Doesn't seem to be affected by hazards, but should be. I'll have to look into this one

32 gives you a glitchy viridian just like every other invalid entity id
Title: Re: Internal commands
Post by: Ally 🌠 on 2 Sep 2015, 04:18
Another stupid post
Title: Re: Internal commands
Post by: Ally 🌠 on 3 Oct 2015, 05:42
Wait...
how do you even use changetile(colour,tile)?
Title: Re: Internal commands
Post by: toos tur on 3 Oct 2015, 05:52
nice doublepost
create a crewmate
and then changetile(crewmate's colour, sprite id)
Title: Re: Internal commands
Post by: Ally 🌠 on 13 Nov 2015, 14:02
I was using internal scripting and it did the terminal squeak
Code: [Select]
ifflag(1,start2)
say(-1)
text(1,0.....
Title: Re: Internal commands
Post by: Dav999 on 13 Nov 2015, 14:28
The say(-1) will cause the terminal sound to be played, so if you don't want that you need method #2 in the OP.
Title: Re: Internal commands
Post by: Ally 🌠 on 13 Nov 2015, 14:47
But I still want cutscene bars.
Is there a command like cutscenebars()?
Title: Re: Internal commands
Post by: Dav999 on 13 Nov 2015, 15:09
Almost, the command is cutscene(). Put untilbars() after it for a delay until the bars are completely on the screen.
Title: Re: Internal commands
Post by: Ally 🌠 on 24 Dec 2015, 09:09
This might be useful, but might not.
The createentity() enemy movement types.

Red - Don't use because it can crash the game.

0 - bouncing up and down.
1 - same as above
2 - bouncing left and right
3 - same as above
4 - going right FOREVER (unless it hits something) (it can go left if you use a negitive speed)
5 - as always, same as above.
6 - bouncing up and down, only it goes a little bit off screen.
7 - same as 4...?
8 - staying still...
9 - same as above
10 - CLONES RIGHT UNTIL IT CRASHES VVVVVV BECAUSE OF LAG. Also after running it you cannot save because it will crash too. Also if you save it corrupts the level and you cannot open it.
11 - same as 4 and 7...?
12 - Same as 10, only clones in the same spot.
13 - like 4, only it is down and not right.
14 - same as 8 and 9
15 - same as 8, 9  and 14.
16 - Appears but then dissapears quickly. I think it is moving really fast though.
17 - THE BEST ONE: It goes left, but it waits a second, teleports left a little bit, waits and teleports and repeats until it is off screen (unless it keeps going and we cannot see it...)
18 - same as above, only it goes right and it is a little bit faster.
19 to INFINITY - just stays still.
Title: Re: Internal commands
Post by: Ally 🌠 on 30 Dec 2015, 16:12
:viridian: = cyan or player
:victoria: = blue
:vermillion: = red
:vitellary: = yellow
:verdigris: = green
:violet: = purple
(http://d2bm3ljpacyxu8.cloudfront.net/width/30/crop/0,0,30x35/afbeeldinge.webs.com/terminal.jpg) = gray or terminal[/b]
Why is it not the smiley? I know you copy and pasted but you could change that.
Title: Re: Internal commands
Post by: Dav999 on 30 Dec 2015, 16:29
:viridian: = cyan or player
:victoria: = blue
:vermillion: = red
:vitellary: = yellow
:verdigris: = green
:violet: = purple
(http://d2bm3ljpacyxu8.cloudfront.net/width/30/crop/0,0,30x35/afbeeldinge.webs.com/terminal.jpg) = gray or terminal[/b]
Why is it not the smiley? I know you copy and pasted but you could change that.
The smiley didn't exist yet. And that image was hosted on an old site that now doesn't exist anymore.




...Except it shows up now? :o That means images from that era have still been surviving until now while none of my images from stupid ImageShack are showing up anywhere anymore.
Title: Re: Internal commands
Post by: Ally 🌠 on 10 Jan 2016, 09:18
...Except it shows up now?
it shows up SOMETIMES. I cannot see it anymore.
Title: Re: Internal commands
Post by: allison on 15 Jan 2016, 14:48
Is there a gamestate to end a custom level? I could have sworn I read something about it...!
Title: Re: Internal commands
Post by: Dav999 on 15 Jan 2016, 14:50
Is there a gamestate to end a custom level? I could have sworn I read something about it...!
There is one to go back to the main menu, no idea if there's any hidden state that marks a level as completed though.
Title: Re: Internal commands
Post by: Ally 🌠 on 15 Jan 2016, 14:51
Is there a gamestate to end a custom level? I could have sworn I read something about it...!
Very unlikely.
Edit: dammit dav
Is there a gamestate to end a custom level? I could have sworn I read something about it...!
There is one to go back to the main menu, no idea if there's any hidden state that marks a level as completed though.
what is that state



Is there a gamestate that says "Game Complete!"?
I have the Level Complete, I just need the game complete.
Title: Re: Internal commands
Post by: allison on 15 Jan 2016, 15:07
Is there a gamestate to end a custom level? I could have sworn I read something about it...!
There is one to go back to the main menu, no idea if there's any hidden state that marks a level as completed though.
what is that state
Gamestate 81. I guess that works well enough, though it'll make it impossible to get stars on my level...
Title: Re: Internal commands
Post by: Hejmstel on 20 Jan 2016, 12:26
Gamestate 81. I guess that works well enough, though it'll make it impossible to get stars on my level...
i think there's a way you can mark the level as complete with gamestate 81 by using the custom crewmate found gamestate in some way
i forgot how though
Title: Re: Internal commands
Post by: StillSpelledViridan on 19 Mar 2016, 12:12
what are all of the possible colors for text boxes?
Title: Re: Internal commands
Post by: Dav999 on 19 Mar 2016, 12:18
cyan, blue, red, yellow, green, purple and gray.

That doesn't include special colors - most notably Valso's dark green - that you can get by spawning a crewmate before the speak_active command.
Title: Re: Internal commands
Post by: Ally 🌠 on 2 Jan 2017, 16:58
Quote from: FIQ
Code: [Select]
1 - Enemy
Metadata: movement type, movement speed
Due to lacking needed data, you will only ever get a purple enemy box, unless you're in the VVVVVV polar dimension while doing the command
should be changed to
Quote from: FIQ
Code: [Select]
1 - Enemy
Metadata: movement type, movement speed
Due to lacking needed data, you will only ever get a purple enemy box, unless you're in the VVVVVV polar dimension while doing the command, or if you're in a room that has an enemy in the main game, which also allows more than 2x2 enemies.
Title: Re: Internal commands
Post by: Ally 🌠 on 5 Jan 2017, 08:19
Double post???

I updated remade my list of enemy movement types.
Code: [Select]
0 - Bouncing up and down, starts down.
1 - Bouncing up and down, starts up.
2 - Bouncing left and right, starts left.
3 - Bouncing left and right, starts right.
4, 7, 11 - Moves right until collision.
5 - Same as above, only acts weird when it collides. GIF here: https://files.catbox.moe/c23ovl.gif
6 - Bouncing up and down, but only reaches a certain x position before going back down. Used in "Trench warfare".
8, 9, 14, 15 - Still (?)
10, 12 - Clones right/in the same spot, crashes VVVVVV if it gets too intense, and will corrupt your level if you save.
13 - Like 4, but moves down until collision.
16 - Flashes in and out of existence. (Appears and disappears)
17 - Jittery movement left
18 - Jittery movement right, little bit faster
19+ - Still (?)

With this, I also included a link to a level which showcases all above.
https://files.catbox.moe/tcjz4t.vvvvvv
Title: Is it still or not?
Post by: Info Teddy on 5 Jan 2017, 15:01
What’s with the question marks after “Still”?
Title: Re: Internal commands
Post by: Ally 🌠 on 6 Jan 2017, 07:17
It's still in the room 1x1 and 1x5, but I'm not sure for other rooms, like the ones with the custom enemies in the main game.
Title: Great, now I have to guess which enemies are still in which rooms.
Post by: Info Teddy on 6 Jan 2017, 15:29
If it’s still in specific rooms, why didn’t you specify the rooms that they’re still in?
Title: Re: Internal commands
Post by: Ally 🌠 on 7 Jan 2017, 16:03
but I'm not sure for other rooms
Title: Put the rooms that you’re sure about, basically.
Post by: Info Teddy on 7 Jan 2017, 16:48
You could still say the rooms that they’re in. You don’t have to say which rooms they aren’t still in.
Title: can you fucking read
Post by: Ally 🌠 on 8 Jan 2017, 10:05
It's still in the room 1x1 and 1x5
Title: Why would not you do that?
Post by: Info Teddy on 8 Jan 2017, 11:33
Why don’t you test more for other rooms?
Title: Re: Internal commands
Post by: QwertymanO07✏️ on 8 Jan 2017, 12:40
Because that would be boring, presumably.  Though if you're so curious, why don't you do it?
Title: And then he’s going to give me a more clever question.
Post by: Info Teddy on 8 Jan 2017, 13:22
You answered your own question.
Title: Re: Internal commands
Post by: Faces3210 on 13 Mar 2017, 12:56
Sorry for the bump, but how do I make crewmates walk? (created with createcrewman, of course)
Title: It’s easy.
Post by: Info Teddy on 13 Mar 2017, 13:19
Sorry for the bump, but how do I make crewmates walk? (created with createcrewman, of course)
No need to apologize for bumps, unless they don’t contribute anything to the topic. Acknowledging that you bumped a topic isn’t going to make a difference.

Anyway, here’s the command (size emphasis mine):
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
Basically, that means that to move Vitellary (assuming he is onscreen) to any spot 96 pixels from the left, you do: changeai(yellow,followposition,96)
Title: Re: Internal commands
Post by: Faces3210 on 13 Mar 2017, 13:31
Thanks! Also, I have a script that doesn't seem to work, it just freezes Viridian with a constant horizontal velocity.


Code: [Select]
say(-1)
text(1,0,0,4)
say(2)
fadeout()
text(1,0,0,4)
say(5)
text(gray,0,0,1)
A year after the events of VVVVVV...
position(center)
speak_active
text(1,0,0,4)
say(3)
text(gray,0,0,2)
The crew is living in
the secret lab.
say(4)
position(center)
speak_active
fadein()
text(1,0,0,4)
say(4)
endtext
endcutscene()
untilbars()
loadscript(stop)
Title: Re: Internal commands
Post by: Dav999 on 13 Mar 2017, 13:46
This bit is incorrect:
Code: [Select]
...
say(3)
text(gray,0,0,2)
The crew is living in
the secret lab.
say(4)
position(center)
speak_active
fadein()
text(1,0,0,4)
...

To fix that, you can remove the say(4) and replace the say(3) by say(7). You don't have to split it all into say blocks of at most 5 lines unless you really want to preserve compatibility with VVVVVV 2.0. (Besides, if you use Ved, you can just turn on internal scripting mode to make this a lot less complicated.)
Title: A sequel to VVVVVV is always original!
Post by: Info Teddy on 13 Mar 2017, 14:08
Thanks! Also, I have a script that doesn't seem to work, it just freezes Viridian with a constant horizontal velocity.
Code: [Select]
say(-1)
text(1,0,0,4)
say(2)
fadeout()
text(1,0,0,4)
say(5)
text(gray,0,0,1)
A year after the events of VVVVVV...
position(center)
speak_active
text(1,0,0,4)
say(3)
text(gray,0,0,2)
The crew is living in
the secret lab.
say(4)
position(center)
speak_active
fadein()
text(1,0,0,4)
say(4)
endtext
endcutscene()
untilbars()
loadscript(stop)
Ooh, what level are you making?
Title: Re: Internal commands
Post by: Lollers will devour you on 13 Mar 2017, 17:05
Even when internal scripting mode is turned on, Ved says that the changeplayercolor(rainbow) is incorrect.
Title: You failed twice at the same time.
Post by: Info Teddy on 13 Mar 2017, 17:52
changeplayercolor(rainbow) is incorrect
It is.
Title: nevermind, I just realized it's lol...ipops
Post by: Shiny K on 13 Mar 2017, 18:19
Even when internal scripting mode is turned on, Ved says that the changeplayercolor(rainbow) is incorrect.

Even when internal scripting mode is turned on, Ved says that the changeplayercolor(rainbow) is incorrect.

how could he be wrong on so many levels
Title: Yeah, I realized that, too.
Post by: Info Teddy on 13 Mar 2017, 19:09
wrong on so many levels
Reminds me of this quote:
>There are literally several levels of SCO being wrong. And even if we were to live in that alternate universe where SCO would be right, they'd still be wrong. source (https://www.bloomberg.com/news/articles/2004-02-01/online-extra-linus-torvalds-sco-is-just-too-wrong)
Title: Re: Internal commands
Post by: Faces3210 on 14 Mar 2017, 08:18
Every time I try to modify an internal script and test a level, Viridian does the freeze thing, but when I relaunch the game, it works again until I modify it again.
Title: Re: Internal commands
Post by: Lollers will devour you on 14 Mar 2017, 08:33
Apparently changeplayercolor(rainbow) Doesn't exist.
HOW DOES ONE RAINBOW
Title: Re: You failed twice at the same time.
Post by: Dav999 on 14 Mar 2017, 08:35
Apparently changeplayercolor(rainbow) Doesn't exist.
HOW DOES ONE RAINBOW

changeplayercolor(rainbow) is incorrect
It is.
  • There is no such command named changeplayercolor. Did you mean changeplayercolour?
  • There is no such color named rainbow. Did you mean teleporter?
Title: Re: Internal commands
Post by: Ally 🌠 on 14 Mar 2017, 11:35
Every time I try to modify an internal script and test a level, Viridian does the freeze thing, but when I relaunch the game, it works again until I modify it again.
If it happens
Alt+enter
Esc
Place a trinket where Viridan spawns in the room (like on a checkpoint)
Enter the level and advance through the "you got a trinket!!!" text
Enter (to exit test mode)
Remove trinket

Also, it happens because you're pressing esc during a script that stops Viridan from moving.
That's why enter is also disabled, because enter is disabled during scripts
Title: Re: Internal commands
Post by: RMiZE on 15 Apr 2020, 05:32
The createcrewman() command is kinda confusing... does x and y mean room coordinate or coordinate inside a room? I'm not sure...
Title: Re: Internal commands
Post by: Dav999 on 15 Apr 2020, 10:04
X and Y are coordinates inside a room, in pixels. For reference, rooms are 320x240 pixels.