Author Topic: Script commands index and hints  (Read 16841 times)

FIQ

  • Captain
  • *****
  • Posts: 809
  • https://github.com/FredrIQ/
    • View Profile
    • FIQ
Re: Script commands index and tips
« Reply #15 on: June 30, 2012, 10:50:53 AM »
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:

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"
Code: [Select]
ifflag(1,talking1)
end()

Example script: "talking1"
Code: [Select]
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

  • Doctor
  • ***
  • Posts: 51
    • View Profile
Re: Script commands index and tips
« Reply #16 on: June 30, 2012, 12: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.
« Last Edit: June 30, 2012, 12:23:21 PM by Vallu »

FIQ

  • Captain
  • *****
  • Posts: 809
  • https://github.com/FredrIQ/
    • View Profile
    • FIQ
Re: Script commands index and tips
« Reply #17 on: June 30, 2012, 12:16:57 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

  • Captain
  • *****
  • Posts: 672
  • I changed my avatar!
    • View Profile
Re: Script commands index and tips
« Reply #18 on: June 30, 2012, 12:24:55 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

  • Captain
  • *****
  • Posts: 809
  • https://github.com/FredrIQ/
    • View Profile
    • FIQ
Re: Script commands index and tips
« Reply #19 on: June 30, 2012, 03:32:28 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

  • Captain
  • *****
  • Posts: 809
  • https://github.com/FredrIQ/
    • View Profile
    • FIQ
Re: Script commands index and tips
« Reply #20 on: July 29, 2012, 12:52:29 PM »
bump

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2111
    • View Profile
    • The Open Level Project
Re: Script commands index and tips
« Reply #21 on: July 29, 2012, 02: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?
« Last Edit: July 29, 2012, 02:45:16 PM by Dav999 »

FIQ

  • Captain
  • *****
  • Posts: 809
  • https://github.com/FredrIQ/
    • View Profile
    • FIQ
Re: Script commands index and tips
« Reply #22 on: July 30, 2012, 03:43:54 AM »
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

  • Global Moderator
  • Captain
  • *****
  • Posts: 2111
    • View Profile
    • The Open Level Project
Re: Script commands index and tips
« Reply #23 on: July 30, 2012, 06:19:15 AM »
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

  • Global Moderator
  • Captain
  • *****
  • Posts: 2111
    • View Profile
    • The Open Level Project
Re: Script commands index and tips
« Reply #24 on: August 13, 2012, 12: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)?

blue626

  • Captain
  • *****
  • Posts: 672
  • I changed my avatar!
    • View Profile
Re: Script commands index and tips
« Reply #25 on: August 13, 2012, 02:02:49 PM »
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

  • Captain
  • *****
  • Posts: 809
  • https://github.com/FredrIQ/
    • View Profile
    • FIQ
Re: Script commands index and tips
« Reply #26 on: August 13, 2012, 03:04:33 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

  • Global Moderator
  • Captain
  • *****
  • Posts: 2111
    • View Profile
    • The Open Level Project
Re: Script commands index and tips
« Reply #27 on: August 13, 2012, 03:20:53 PM »
2: No. (Why do you want to do that anyway?)

Just asking. :)

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?

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

  • Captain
  • *****
  • Posts: 809
  • https://github.com/FredrIQ/
    • View Profile
    • FIQ
Re: Script commands index and tips
« Reply #28 on: August 13, 2012, 03:29:44 PM »
2: No. (Why do you want to do that anyway?)

Just asking. :)

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?

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
« Last Edit: August 13, 2012, 03:51:11 PM by FIQ »

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2111
    • View Profile
    • The Open Level Project
Re: Script commands index and tips
« Reply #29 on: August 13, 2012, 03:42:57 PM »
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.
« Last Edit: August 13, 2012, 03:45:37 PM by Dav999 »