Script commands index and hints

Started by FIQ, June 24, 2012, 10:16:04 PM

Previous topic - Next topic

Bearboy

Quote from: Vallu on June 30, 2012, 07:15:39 PM
Thank you for all your help! I decided to put the talking scene to other room. I also decided to make an English version of my Finnish level when it's done so I could release it here! :viridian: It's going to be pretty long and hard (especially some of :shiny:'s). Is there any active custom level players who could download it and play it? (if not, I don't see why could I make an English version) There is also pretty exciting and "epic" story. (The level is called "Viridian's bad day")

Sorry for my bad English and offtopic!

Edit: Ok! I'll think about making an English version.
Make one.
If you make one that is only finnish, I WILLL NOT KNOW WUT HAPPEN.

blue626

This thread needs a bump! Perhaps this should be stickyied?

avengah

#32
A couple of important points that need adding. The happy and sad commands need extra mention, because if there is an NPC Viridian in the room, the argumentless commands will affect him instead of the player. To make sure you change the player's mood, use any unrecognised argument, e.g. player, me, ruby, poo etc.

Also, "all" works too. It affects everyone on screen, player and NPCs alike. "viridian" and "cyan" both affect the NPC. Note that if there is no cyan NPC in the room, the commands will affect the player, but to guarantee the player is affected, use happy/sad(me) or something.

blue626

Quote from: avengah on November 19, 2012, 07:16:05 PM
Also, "all" works too. It affects everyone on screen, player and NPCs alike.

:o I think that nobody mentioned that before, which makes me think that nobody discovered that before!

Oh, and FIQ, you still didn't wrote about squeak(on/off/crewmate). I wonder if squeak(all) works.

Quote from: avengah on November 19, 2012, 07:16:05 PM
A couple of important points that need adding. The happy and sad commands need extra mention, because if there is an NPC Viridian in the room, the argumentless commands will affect him instead of the player. To make sure you change the player's mood, use any unrecognised argument, e.g. player, me, ruby, poo etc.

Is that only in 2.1.beta or in 2.0. too?


avengah

#35
I'm going to try In Pursuing Design in 2.0, because that has a glitch which makes NPC Viridian smile. I'm assuming that it'll make the player smile in 2.0, because it's a feature added in 2.1 which probably wasn't implemented correctly - no argument assumes cyan rather than player, which is the mistake. I'll let you know my results.

EDIT: Yeah, in In Pursuing Design, when you're in the room with NPC Viridian, it's the player who becomes sad then happy, not the NPC as in 2.1. So it was a new bug introduced into 2.1 as a side effect of being able to pick who becomes happy and sad. Basically, remember that if you're using cyan NPCs, don't use happy and sad sans argument - put anything in the brackets that isn't a recognised command. Recognised commands are:

1, viridian, cyan, [no argument] (=NPC if it exists; if not, then the player)
2, violet, pink, purple
3, vitellary, yellow
4, vermilion, red
5, verdigris, green
6, victoria, blue
all, everyone, everybody (player and NPCs)
0, 7, 8 etc, me, player, random words, anything else = player guaranteed, not cyan NPCs.

So numbers work, and there are three ways to specify "all" that I've found so far. "every" doesn't work, so everyone and everybody must be hard-coded.

Note that if you have multiple NPCs of the same colour in the room, only one will be made happy or sad - even if you use "all". My experimentation hasn't uncovered a solution, unfortunately. It's definitely worth knowing that once happy, they stay happy even if you leave the room and come back. However, multiple NPCs of the same colour in DIFFERENT rooms will all be affected by their corresponding command.

Happy and sad commands affect all NPCs, even in different rooms. If you use no argument or cyan / viridian, if you've got a cyan NPC, both will change if you're in different rooms. The NPC will change alone if you're in the same room. So again, to ensure it's just the player that changes, use e.g. happy(me). If you've got two cyan NPCs in different rooms and you're in one of their rooms, and a script there contains sad, then both cyan NPCs will become sad and the player will be unaffected. If you're in a different room, all three of you will become sad.

I think that about covers it. Any questions? Sorry if I overcomplicated things...

EDIT again: Just to point out that it's safe to have a 2.0 exe in the main folder of a 2.1 install. I haven't noticed any problems; the extra 2.1-exclusive stuff in the save files is left alone by v2.0 it seems. Any player levels you complete with 2.0 won't be starred when you load v2.1, but the levels already starred will still be starred. I copied my original v2.0 into the folder and called it VVVVVV20.exe along with the main vvvvvv.exe which is 2.1.

EDIT 3: OK, happy and sad commands affect all crewmembers of a certain colour, just not all straight away if there's more than one on the screen. For example, say you've got three cyan and three red in a row; happy(all) will only affect the player, the first cyan and the first red crewmember (in terms of when you placed them; if you placed them middle, left, right then it's the middle that will be affected), but when you leave the screen and come back, they will all be happy. Same goes for picking a colour; the first will be affected on the screen you're on, but they'll all be affected once you leave the screen.

avengah

The second argument in the say command also accepts a number, but it does not accept all. As before, 1 = NPC Viridian (or player if no NPC present), 2 = Violet, 3 = Vitellary, 4 = Vermilion, 5 = Verdigris, 6 = Victoria, 0 / 7+ / everything else = repeats last colour used. There is no grey command, so load another script if you need grey after a different colour.

To ensure your box appears over the player, not NPC Viridian, use reply, not say. To summarise, you can use say(1,3) for one yellow line of text.

avengah

#37
Quote from: blue626 on November 19, 2012, 07:49:43 PM
Quote from: avengah on November 19, 2012, 07:16:05 PM
Also, "all" works too. It affects everyone on screen, player and NPCs alike.

:o I think that nobody mentioned that before, which makes me think that nobody discovered that before!

Oh, and FIQ, you still didn't wrote about squeak(on/off/crewmate). I wonder if squeak(all) works.

Yes, it was already known - check the featured level "Quantum Tunnel". The script "intro2" uses happy(all). Now that you mention "squeak", I'll test it out a bit.

OK, so squeak commands are local to the current script; that we know. Now then, squeak(off) disables ALL text box noises caused by say and reply for the current script. squeak(on) reverses this and is the normal behaviour.

The only other arguments that are accepted are 1-6, colours, crew names, player and sad. Not terminal, and not all. The numbers are the same as above, and both pink and purple work for Violet. So squeak(sad) makes the sad/death noise without making anyone actually sad, and player = cyan = viridian = 1; there's no difference this time.

Any other arguments are completely ignored. For example,

If anyone forgets the numbers, there are two ways to remember - when you create a crewman in the editor, start at cyan; this is 1. Every click to change its colour increases its number by 1, up to 6.

The second way, which I forgot to mention before, is to look at the order of the crew in the main game. When you pause the game and check the crew roster (saved, missing etc.) they're numbered like this:

14
25
36

Finally, squeak without an argument defaults to cyan / player. squeak(off) disables automatic squeaks from terminals and characters, but does not disable manual squeaks created with the squeak command. And squeak(off) only lasts as long as the current script.

avengah

#38
Now, something important about the say command. Do not assume that if you use no argument, you will get grey. We already know that it defaults to the previous colour used, but I've just discovered that it defaults to the NEXT colour used if no argument is specified! This is... strange.

So, the following script:

say
1
reply
2
say
3
say(1,2)
4

will produce 1, 3 and 4 all in pink, with 2 in cyan. Let's say you're using a terminal and you want output from the terminal, but you also want commentary from Violet. Then you must specify an unrecognised argument.

say(1,0)
1
reply
2
say
3
say(1,2)
4

That will do the trick. Now, it'll be grey, cyan, grey, pink in that order. I honestly don't know why the scripting system works like that - surely, if your third or fourth say command specifies a colour, then you want that command to be that colour; not all the commands before it too! Still, it is how it is, and we must use workarounds.

If anyone's had their text appear the wrong colour in custom levels, this could be why.

EDIT: New discovery about happy and sad - if you specify an individual number, colour or name, no matter what it is, the player will be affected if there is no crewman of that colour on the screen. Even if there is, say, a red crewmember over somewhere else in the level, if you do sad(red) then the player will become sad if there's no red crew on the current screen. The red crew elsewhere will also become sad.

So therefore, the fact that specifying cyan prioritises NPCs, then the player if no cyan NPCs are on screen, is not exclusive to the cyan argument. It applies to every colour; in addition to the matching NPCs elsewhere in the level, the player will be affected if there isn't a matching NPC on the current screen.

FIQ

Corrected a few typos.

Also, I think this topic is worth a bump.

FIQ


Dav999

Quote from: FIQ on June 24, 2012, 10:16:04 PM
* Amount of script lines max before VVVVVV crashes if you try to run it: 198

Are you sure this is correct? I made the full map of tOLP show up with two scripts, both containing 200 showcoordinates(x,y) for both halves of the map, and text(1,0,0,4) say(5) every time, and it worked perfectly. Maybe it's just the amount of converted lines...

weee50

Quote from: FIQ on June 25, 2012, 05:30:30 PM
Flags is only 1-99? I thought it went to 100? Have to test this one...
I know this post is a year old, but they are not 1-99 nor 1-100, but they are actually 0-99!

blue626

Small bump.
I think it's a good idea to mention which scripts activate cutscene bars and which make :viridian: stop.
We already know that say and reply create cutscene bars and make  :viridian: stop. And, from how the script that makes scripts only execute once works, we know that iftrinkets (as well as ifflag) don't make Viridian stop (or create cutscene bars).
Delay doesn't create cutscene bars but does make Viridian stop (until it ends, I suppose). I suppose if it isn't executed, even though the script that contains it is entered, it doesn't make Viridian stop.
Flash, destroy and music don't make Viridian stop nor create cutscene bars. I suppose it's the same for happy, sad, map and squeak?
It may be a good idea to write about this because people may not know what this script does:

delay(60)
flash

(It obviously includes an empty line).
It doesn't just make a flash effect around 2 seconds (60 ticks) after it's activated. What it does is make :viridian: stop for around 2 seconds, as soon as it's activated, and then make a flash effect.

Another thing: I read somewhere someone saying that, in the method to execute scripts only once, the stop script doesn't need to exist. I removed that script in my level and then executed a script which I didn't modify or even seen for a long time. IIRC, it had the method to execute scripts only once shown here. It worked! It worked normally the first time, left the room, reentered and it didn't do anything the 2nd time.

FIQ

Quote from: blue626 on July 19, 2013, 03:46:45 PM
Small bump.
I think it's a good idea to mention which scripts activate cutscene bars and which make :viridian: stop.
We already know that say and reply create cutscene bars and make  :viridian: stop. And, from how the script that makes scripts only execute once works, we know that iftrinkets (as well as ifflag) don't make Viridian stop (or create cutscene bars).
Delay doesn't create cutscene bars but does make Viridian stop (until it ends, I suppose). I suppose if it isn't executed, even though the script that contains it is entered, it doesn't make Viridian stop.
Flash, destroy and music don't make Viridian stop nor create cutscene bars. I suppose it's the same for happy, sad, map and squeak?
It may be a good idea to write about this because people may not know what this script does:

delay(60)
flash

(It obviously includes an empty line).
It doesn't just make a flash effect around 2 seconds (60 ticks) after it's activated. What it does is make :viridian: stop for around 2 seconds, as soon as it's activated, and then make a flash effect.

Another thing: I read somewhere someone saying that, in the method to execute scripts only once, the stop script doesn't need to exist. I removed that script in my level and then executed a script which I didn't modify or even seen for a long time. IIRC, it had the method to execute scripts only once shown here. It worked! It worked normally the first time, left the room, reentered and it didn't do anything the 2nd time.
I got issues when I didn't have that script once, but perhaps it was unrelated.