Author Topic: some scripting commands  (Read 15000 times)

zaratustra

  • Crewmate
  • *
  • Posts: 3
    • View Profile
some scripting commands
« on: July 30, 2011, 04:38:28 pm »
cribbed from the existing levels

music(X) - plays music X (0: silence, 1: pushing onwards, 2: positive force, 3: potential for anything, 4: passion for exploring, 5: ???, 6: predestined fate, 7: popular poutpourri, 8: pipe dream, 9: pressure cooker, 10: paced energy, 11: piercing the sky)
say(X) - says the text contained in the next X lines (default:1)
reply(X) - player says the text contained in the next X lines (default:1)
delay(X) - pause of X ticks
happy - yay
sad - bawww
flash - flash of light
destroy(gravitylines)
destroy(platforms) - doesn't quite work properly according to terry
destroy(warptokens)
flag(X,on) - turns flag on. X= 1-99
flag(X,off) - turns flag off
iftrinkets(X,script) = if trinkets are more or equal to X execute script
iftrinketsless(X,script)= if trinkets are less than X execute script
ifflag(X,script) = if flag is on, execute script

« Last Edit: July 30, 2011, 06:11:13 pm by zaratustra »

Terry

  • Administrator
  • Captain
  • *****
  • Posts: 608
    • View Profile
    • distractionware
Re: some scripting commands
« Reply #1 on: July 30, 2011, 06:01:37 pm »
Heh, how did you find out about "destroy(platforms)"? :P It doesn't work properly yet in this version, so I didn't mention it when I was listing commands on twitter.

TheoX

  • Professor
  • ****
  • Posts: 145
  • Platformer Connoisseur / level rater
    • View Profile
    • TheoX's Site of Miscellany
Re: some scripting commands
« Reply #2 on: July 30, 2011, 06:02:03 pm »
This will actually be a very helpful thread if you edit your post and keep putting in commands.  Starting to understand scripting better.  Insani mentioned in one of the sticky threads about an 'end' command (no quotes) that stops the script safely, if you want to put that in.

zaratustra

  • Crewmate
  • *
  • Posts: 3
    • View Profile
Re: some scripting commands
« Reply #3 on: July 30, 2011, 06:07:10 pm »
Heh, how did you find out about "destroy(platforms)"? :P It doesn't work properly yet in this version, so I didn't mention it when I was listing commands on twitter.

your window was almost unlocked!

>cough<

activateteleporter(X), altstates(X), befadein(X), blackon(X), blackout(X), changeai(X,X,X), changecolour(X,X), changedir(X,X), changemood(X,X), changeplayercolour(X), changetile(X,X), companion(X), createactivityzone(X), createcrewman(X,X,X,X,X,X), createentity(X,X,X,X,X), createlastrescued(X), createrescuedcrew(X), cutscene(X), delay(X), destroy(X), endcutscene(X), everybodysad(X), face(X,X), fadein(X), fadeout(X), finalmode(X,X), flipgravity(X), foundtrinket(X), gamemode(X), gamestate(X), gotoposition(X,X,X), gotoroom(X,X), hascontrol(X), hidecoordinates(X,X), hideplayer(X), hidesecretlab(X), hideship(X), hidetargets(X), hideteleporters(X), hidetrinkets(X), ifcrewlost(X,X), ifexplored(X,X,X), ifflag(X,X), iflast(X,X), ifskip(X), loadscript(X), missing(X), musicfadeout(X), nocontrol(X), playef(X,X), position(X), position(X,X), rescued(X), rollcredits(X), setcheckpoint(X), shake(X), showcoordinates(X,X), showplayer(X), showsecretlab(X), showship(X), showtargets(X), showteleporters(X), showtrinkets(X), specialline(X), squeak(X), stopmusic(X), teleportscript(X), telesave(X), text(X,X,X,X), tofloor(X), trinketbluecontrol(X), trinketyellowcontrol(X), undovvvvvvman(X), untilbars(X), untilfade(X), vvvvvvman(X), walk(X,X)

(most of these do not actually work)
« Last Edit: July 30, 2011, 06:41:51 pm by zaratustra »

Terry

  • Administrator
  • Captain
  • *****
  • Posts: 608
    • View Profile
    • distractionware
Re: some scripting commands
« Reply #4 on: July 30, 2011, 08:03:11 pm »
Oh right, yeah - they're the scripting commands from the old flash version. Is there a decompiled version floating around or something?

TheoX

  • Professor
  • ****
  • Posts: 145
  • Platformer Connoisseur / level rater
    • View Profile
    • TheoX's Site of Miscellany
Re: some scripting commands
« Reply #5 on: July 30, 2011, 08:23:41 pm »
(most of these do not actually work)

Would you be kind enough to list what kind of arguments those functions take?  I want to use some of them :D

And just what is "vvvvvvman()"  :o

@Terry - Does this bother you or are you ok with extra commands being leaked?

EDIT:  Oops, I read it as "do actually work" instead of "do not"..
« Last Edit: July 31, 2011, 11:17:30 pm by TheoX »

Terry

  • Administrator
  • Captain
  • *****
  • Posts: 608
    • View Profile
    • distractionware
Re: some scripting commands
« Reply #6 on: July 30, 2011, 08:33:31 pm »
Well, they don't actually do anything - they're the commands the internal scripts in VVVVVV use, and they're a bit more techy. The ones in the editor are actually a simplified version of these.

For example, this cutscene in the editor:

Code: [Select]
iftrinkets(1,newtrenchwarfare)

reply(1)
Ohh! I wonder what that is?

reply(3)
I probably don't really need it,
but it might be nice to take it
back to the ship to study...


... looks like this when it's translated into VVVVVV's actual scripting language:

Code: [Select]
cutscene()
untilbars()

iftrinkets(1,newtrenchwarfare)

squeak(player)
text(cyan,0,0,1)
Ohh! I wonder what that is?
position(player,above)
speak_active

squeak(player)
text(cyan,0,0,3)
I probably don't really need it,
but it might be nice to take it
back to the ship to study...
position(player,above)
speak_active

endtext

endcutscene()
untilbars()

(if you think that's cumbersome, you should see Nexus City :P )
« Last Edit: July 30, 2011, 08:37:03 pm by Terry »

TheoX

  • Professor
  • ****
  • Posts: 145
  • Platformer Connoisseur / level rater
    • View Profile
    • TheoX's Site of Miscellany
Re: some scripting commands
« Reply #7 on: July 30, 2011, 09:10:05 pm »
Yeah that looks a bit more complicated!  Looking forward to the scripting demo so I know how to use the easier commands!

zaratustra

  • Crewmate
  • *
  • Posts: 3
    • View Profile
Re: some scripting commands
« Reply #8 on: July 31, 2011, 12:04:12 am »
Actually I just opened the executable in a text editor.

PJBottomz

  • Captain
  • *****
  • Posts: 700
  • Chibi Toast. It kicks your ass for miles.
    • View Profile
    • PJBottomz First Homepage
Re: some scripting commands
« Reply #9 on: August 02, 2011, 04:43:47 am »
THANK YOU! If it wasn't for you finding all this, I never would've learned how to script! Thank you. :viridian:

Gwinnell

  • Crewmate
  • *
  • Posts: 3
    • View Profile
Re: some scripting commands
« Reply #10 on: August 03, 2011, 09:24:53 pm »
Is there a command for detecting whether a flag is off? I'm trying all sorts but I can't get the behaviour I'm after.

Arkatox

  • Professor
  • ****
  • Posts: 131
  • I WILL GET MY REVVVVVVENGE!
    • View Profile
    • The Sexiest Place On Earth (Just Kidding)
Re: some scripting commands
« Reply #11 on: August 07, 2011, 08:09:29 pm »
What is the command to destroy a script box after it's used?

TheoX

  • Professor
  • ****
  • Posts: 145
  • Platformer Connoisseur / level rater
    • View Profile
    • TheoX's Site of Miscellany
Re: some scripting commands
« Reply #12 on: August 07, 2011, 11:48:56 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"
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.

Smort

  • Crewmate
  • *
  • Posts: 1
    • View Profile
Re: some scripting commands
« Reply #13 on: August 24, 2012, 11:37:33 am »
I don't understand how to use the iftrinkets commands. I want Captain Viridian to say something whenever he walks up to the trinket, but never again once it has been collected. Help!  :(

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2191
    • View Profile
    • The Open Level Project
Re: some scripting commands
« Reply #14 on: August 24, 2012, 03:05:27 pm »
I don't understand how to use the iftrinkets commands. I want Captain Viridian to say something whenever he walks up to the trinket, but never again once it has been collected. Help!  :(

It would have been better to put it in this thread, because this one is a year old!

Anyway, iftrinkets works like iftrinkets(number,script name). If you have collected at least number trinkets, then you will go to another script, otherwise skip this command. The script name can not contain capital letters or spaces, because then it will always skip the command. So just put this in the script box near the trinket:

Code: [Select]
iftrinkets(1,nothing)
iftrinkets(0,trinketscript)

Then, make a script called trinketscript, which has this:

Code: [Select]
reply(2)
I want to get that trinket!
I'd better go and get it!

If there is more than one trinket in the level, it's much better to use flags, because the other trinkets also add up to the trinket count, and you may or may not have collected them, which changes the behaviour for this trinket. In that case, put this in the script near the trinket:

Code: [Select]
ifflag(n,nothing)
iftrinkets(0,trinketscript)

trinketscript stays the same, and you have to make another script, which is when you collect the trinket, in which you have to put this:

Code: [Select]
flag(n,on)
n has to be the same number in both scripts, and it can be anything from 1-99. The reason why this is in different scripts, is that if there is a say or reply command in the script, it will always turn on the cutscene bars (the black bars at the top and bottom of the screen), and you don't want those to appear and be stuck there every time you approach the trinket which is not there anymore. iftrinkets(0,trinketscript) is to load the other script, because there is no command to load a script directly, and this will work because you can't have less than 0 trinkets (actually, you can, but you have to mess with your save data to also glitch the game itself)