Script commands index and hints

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

Previous topic - Next topic

FIQ

Quote from: blue626 on June 30, 2012, 05:08:30 PM
If someone, using 2.1 beta, plays a level made in 2.0, does that person see the map? If the answer is yes, I must ask this: does the command map(on/off) create any glitches in 2.0?

EDIT: In the "some scripting commands" thread (see my 1st post above) someone mentioned a way to make scripts execute only once:

Quote from: TheoX on August 07, 2011, 11:48:56 PM
Quote from: Arkatox on August 07, 2011, 08:09:29 PM
What is the command to destroy a script box after it's used?
There isn't one.  You have to use what I call "trigger scripts", or secondary scripts, that use ifflags to make sure a script doesn't run twice.  It's kind of a pain, and one of the reasons my level is taking so long to make.  Example of what I do:

Example script: "talking1trigger"
ifflag(1,talking1)
end()


Example script: "talking1"
say(2)
this script will
only run once!
flag(1,off)
end()


This assumes the flag used was turned "on" previously.

This method uses 2 scripts and 1 flag per terminal/script box and an "init" script. The method I suggested uses 2 scripts and 1 flag per terminal/script box and a "stop" script. The method on this quote is as good as the other one. Note: I think that the "end" commands aren't necessary.
As map(on|off) is non-existent in 2.0, it will not cause any glitches. The parser will just remove the line as it doesn't recognize it as a custom-level-script. :P

Vallu

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

FIQ

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!
There's not as many as when 2.0 was released a year ago, but there's still some active people here.

blue626

Quote from: FIQ on June 30, 2012, 05:50:53 PM
Quote from: blue626 on June 30, 2012, 05:08:30 PM
If someone, using 2.1 beta, plays a level made in 2.0, does that person see the map? If the answer is yes, I must ask this: does the command map(on/off) create any glitches in 2.0?

(rest of my post)

As map(on|off) is non-existent in 2.0, it will not cause any glitches. The parser will just remove the line as it doesn't recognize it as a custom-level-script. :P

Does the parser remove the line when I use these commands? Will they create glitches?

say(N,crewmate)
happy/sad(crewmate)

FIQ

Quote from: blue626 on June 30, 2012, 07:24:55 PM
Quote from: FIQ on June 30, 2012, 05:50:53 PM
Quote from: blue626 on June 30, 2012, 05:08:30 PM
If someone, using 2.1 beta, plays a level made in 2.0, does that person see the map? If the answer is yes, I must ask this: does the command map(on/off) create any glitches in 2.0?

(rest of my post)

As map(on|off) is non-existent in 2.0, it will not cause any glitches. The parser will just remove the line as it doesn't recognize it as a custom-level-script. :P

Does the parser remove the line when I use these commands? Will they create glitches?

say(N,crewmate)
happy/sad(crewmate)
No, they will just work as in 2.0.

FIQ


Dav999

#21
If I use the internal command hidecoordinates(x,y), does that work if I want to hide a room from the map of custom levels in 2.1? I'm asking because I still can't use 2.1. What I want to do: the start point of my level is in the ship. It starts with a cutscene in which :viridian: gets teleported somewhere else. Is it possible to hide the ship after that? Otherwise I'm afraid I have to completely turn off the map again, or do a huge redesign of my level... :victoria:

EDIT: also, does map(off) clear the map so it's empty if you turn it on again?

FIQ

Quote from: Dav999 on July 29, 2012, 09:16:55 PM
If I use the internal command hidecoordinates(x,y), does that work if I want to hide a room from the map of custom levels in 2.1? I'm asking because I still can't use 2.1. What I want to do: the start point of my level is in the ship. It starts with a cutscene in which :viridian: gets teleported somewhere else. Is it possible to hide the ship after that? Otherwise I'm afraid I have to completely turn off the map again, or do a huge redesign of my level... :victoria:

EDIT: also, does map(off) clear the map so it's empty if you turn it on again?
You can use hidecoordinates() for that, yes. Do note that internally, map coordinates start with 0 instead of 1, however (as with gotoroom()).
map(off) just make the map work like in intermissions, but doesn't hide the map (It even still fill it, allthought you'll not see that before map(on) again!)

Dav999

Quote from: FIQ on July 30, 2012, 10:43:54 AM
Quote from: Dav999 on July 29, 2012, 09:16:55 PM
If I use the internal command hidecoordinates(x,y), does that work if I want to hide a room from the map of custom levels in 2.1? I'm asking because I still can't use 2.1. What I want to do: the start point of my level is in the ship. It starts with a cutscene in which :viridian: gets teleported somewhere else. Is it possible to hide the ship after that? Otherwise I'm afraid I have to completely turn off the map again, or do a huge redesign of my level... :victoria:

EDIT: also, does map(off) clear the map so it's empty if you turn it on again?
You can use hidecoordinates() for that, yes. Do note that internally, map coordinates start with 0 instead of 1, however (as with gotoroom()).
map(off) just make the map work like in intermissions, but doesn't hide the map (It even still fill it, allthought you'll not see that before map(on) again!)

Ok, I knew it starts with 0,0, but I have no idea how maps work in 2.1, so I didn't know if hidecoordinates() only worked on the map in the real game. It could have been just like crewmates: in the real game they're different from the crewmates in custom levels.

Dav999

I don't have much experience with 2.1 scripting, and I have some questions.

1. If you want a dialog with a certain colour in 2.1, and it only has one line, can you skip the number and just use say(colour)?
2. Does reply(N[,C]) also work?
3. If you use for instance say(n,red) and after that use say(n), will that second dialog also be red? And if you want a dialog after that to be gray, will say(n,gray) or say(n,terminal) work?
4. I read something about there being a squeak command in simplified scripting, and also the ability to turn squeaking on and off with that command. Does that mean you can turn squeaking off with squeak(off) and on with squeak(on)?

blue626

I don't have much experience too (because I have 2.0) but I think I can help you:


  • I don't know, but that would be good.
  • say(n,color/crewmate) puts the text box above a crewmate with the same color (if there's one on the screen), so having reply(n,color/crewmate) wouldn't make sense. To other people: If you use 2.1.beta and you think I'm wrong, tell me!
  • Yes, according to a thread in this forum. In the same thread, they say that terminal won't work, but I don't know about grey.
  • Probably, yes. I think that there's also a squeak(crewmate) command, which makes a certain crewmate squeak (the sound is different for each crewmate). If I'm right, that should be added to the list (as well as squeak(on/off)).

FIQ

Quote from: Dav999 on August 13, 2012, 07:58:43 PM
I don't have much experience with 2.1 scripting, and I have some questions.

1. If you want a dialog with a certain colour in 2.1, and it only has one line, can you skip the number and just use say(colour)?
2. Does reply(N[,C]) also work?
3. If you use for instance say(n,red) and after that use say(n), will that second dialog also be red? And if you want a dialog after that to be gray, will say(n,gray) or say(n,terminal) work?
4. I read something about there being a squeak command in simplified scripting, and also the ability to turn squeaking on and off with that command. Does that mean you can turn squeaking off with squeak(off) and on with squeak(on)?
1: No.
2: No. (Why do you want to do that anyway?)
3: There's currently a bug that stops you from being able to change color back to gray, PJBottomz told about it in VVVVVV Tech Discussion. I think splitting the script reverts it, though.
4:
...You can turn *off* squeaking?

*tests*

Oooh, didn't know about that. But it seems to work, yes! But it's just temporary, when you execute a new script, it'll be on again. And also, this seem to be simple-script only (didn't see that coming), squeak() internally still works as usual.

Dav999

Quote from: FIQ on August 13, 2012, 10:04:33 PM
2: No. (Why do you want to do that anyway?)

Just asking. :)

Quote from: FIQ on August 13, 2012, 10:04:33 PM
3: There's currently a bug that stops you from being able to change color back to gray, PJBottomz told about it in VVVVVV Tech Discussion. I think splitting the script reverts it, though.

So it does stay red?

Quote from: FIQ on August 13, 2012, 10:04:33 PM
4:
...You can turn *off* squeaking?

*tests*

Oooh, didn't know about that. But it seems to work, yes! But it's just temporary, when you execute a new script, it'll be on again. And also, this seem to be simple-script only (didn't see that coming), squeak() internally still works as usual.

Ok, great, that way at least 2.1 users won't hear a terminal sound every time you start using internal scripting.

FIQ

#28
Quote from: Dav999 on August 13, 2012, 10:20:53 PM
Quote from: FIQ on August 13, 2012, 10:04:33 PM
2: No. (Why do you want to do that anyway?)

Just asking. :)

Quote from: FIQ on August 13, 2012, 10:04:33 PM
3: There's currently a bug that stops you from being able to change color back to gray, PJBottomz told about it in VVVVVV Tech Discussion. I think splitting the script reverts it, though.

So it does stay red?

Quote from: FIQ on August 13, 2012, 10:04:33 PM
4:
...You can turn *off* squeaking?

*tests*

Oooh, didn't know about that. But it seems to work, yes! But it's just temporary, when you execute a new script, it'll be on again. And also, this seem to be simple-script only (didn't see that coming), squeak() internally still works as usual.

Ok, great, that way at least 2.1 users won't hear a terminal sound every time you start using internal scripting.
Hahahah, always found that annoying, wasn't aware that you could turn it off :P

Dav999

#29
You could also have used use reply(-1) text(1,0,0,4) reply(5) instead of say, because the sound you get when you use say is about 4x longer than the sound you get when you use reply.