distractionware forums

VVVVVV => VVVVVV Levels => Topic started by: Terry on June 17, 2014, 09:56:12 AM

Title: VVVVVV Level Editor Tutorial - Part 3: Scripting
Post by: Terry on June 17, 2014, 09:56:12 AM
So, unfortunately, I never got around to writing that scripting tutorial. However, here's a basic reference that should get you started:

here's some scripting advice pasted from terry's twitter account:

I'll write a proper tutorial later, but here's a super quick guide to scripting in VVVVVV: Place a teminal or scriptbox and type a name...

That name is how you refer to the script. In the editor, you can modify what's in it. Here are a few simple commands:

This is how you make a terminal talk - the number that "say" takes as an argument is the number of lines -

Code: [Select]
say(2)
A two line script, read
by a terminal

The "reply" command makes Viridian talk:

Code: [Select]
say(2)
A two line script, read
by a terminal
reply(1)
Ohh, a talking terminal!

You can change expression with the "happy" and "sad" commands

music(songnum) will play a given song (same as the numbers in the menu), delay(frames) will wait for how many ever frames

Now, logic! "flag(1,on)", say, will turn flag number 1 on. "flag(6,off)" turns flag six off. There are 100 flags, or something like that.

"ifflag(5,scriptx)" will jump to the script named "scriptx" if flag 5 is set.

You can also do iftrinkets(t,script) to check that you've collected at least t trinkets! Or you can use iftrinketsless(t,script).

destroy(gravitylines) will get rid of all the gravitylines on a screen, while destroy(warptokens) gets rid of all the warp tokens.

You could totally use that to make gates that are unlocked with trinket keys, incidentally. If you were so inclined.

If anyone here would like to link to more advanced scripting notes or tutorials, feel free to do so in this topic and I'll update this post to include the links!

[edit:] Check out FIQ's Script command index and hints (http://distractionware.com/forum/?topic=1038.0) for a more detailed explaination of things!
Title: Re: VVVVVV Level Editor Tutorial - Part 3: Scripting
Post by: vitellaryjr on June 17, 2014, 10:12:35 AM
I'm not sure if I should go to internal commands so early, so I'll just say this:

If you use the "say" command, you can make it colored in version 2.1 and 2.2 by typing this:

Code: [Select]
say(1,yellow)
This is a yellow text box!

If you have a crewmate of the same color in that room, it will appear above the crewmate's head. Like this:

Code: [Select]
say(2,yellow)
This is a yellow text
box above Vitellary!

For 2.1 and 2.2 users, hope that helped (at least a bit)!
Title: Re: VVVVVV Level Editor Tutorial - Part 3: Scripting
Post by: stylzm on June 17, 2014, 11:31:36 AM
I'm not sure if I should go to internal commands so early, so I'll just say this:

If you use the "say" command, you can make it colored in version 2.1 and 2.2 by typing this:

Code: [Select]
say(1,yellow)
This is a yellow text box!

If you have a crewmate of the same color in that room, it will appear above the crewmate's head. Like this:

Code: [Select]
say(2,yellow)
This is a yellow text
box above Vitellary!

For 2.1 and 2.2 users, hope that helped (at least a bit)!
What?! 2.2 is out?!  0.0
Title: Re: VVVVVV Level Editor Tutorial - Part 3: Scripting
Post by: ToasterApocalypse on June 17, 2014, 12:18:23 PM
I'm not sure if I should go to internal commands so early, so I'll just say this:

If you use the "say" command, you can make it colored in version 2.1 and 2.2 by typing this:

Code: [Select]
say(1,yellow)
This is a yellow text box!

If you have a crewmate of the same color in that room, it will appear above the crewmate's head. Like this:

Code: [Select]
say(2,yellow)
This is a yellow text
box above Vitellary!

For 2.1 and 2.2 users, hope that helped (at least a bit)!
What?! 2.2 is out?!  0.0

yes but it was mostly just bugfixes and the addition of predestined fate remix

no towers
Title: Re: VVVVVV Level Editor Tutorial - Part 3: Scripting
Post by: FIQ on June 17, 2014, 12:21:48 PM
How about Script command index and hints (http://distractionware.com/forum/?topic=1038.0)?
It's not really a tutorial, but a full reference to the (simplified) VVVVVV scripting language.
Title: Re: VVVVVV Level Editor Tutorial - Part 3: Scripting
Post by: Dav999 on June 17, 2014, 12:35:22 PM
Some additions to the quote in the first post:
:viridian:
Title: Re: VVVVVV Level Editor Tutorial - Part 3: Scripting
Post by: caleb on January 31, 2015, 03:54:21 PM
How do I open a level file? I fail everytime.

My Face: :victoria:
Title: Re: VVVVVV Level Editor Tutorial - Part 3: Scripting
Post by: SJMistery on February 01, 2015, 03:41:14 AM
a guide to "how heck you use the direct mode" would be nice. not being able to script anything beyond text and maybe a gravitron makes me feel sad  :victoria:
Title: Re: VVVVVV Level Editor Tutorial - Part 3: Scripting
Post by: Sendy on March 20, 2015, 01:57:25 PM
To use Direct Mode, just press F10, hold down CTRL and use the cursor keys to select the tile you want to use. Make sure you're in editing mode 1 (platforms) - even if you want to add background tiles. The best thing to do is get the screen looking as close as you want it before going into Direct Mode, because once you do that, you'll have to make every change on your own, and turning off DM, to the best of my memory, will destroy your changes.
Title: Re: VVVVVV Level Editor Tutorial - Part 3: Scripting
Post by: onepamop_wl on May 06, 2015, 07:48:26 AM
How do I open a level file? I fail everytime.

My Face: :victoria:

in editor press [ESC], choose LOAD LEVEL, and type name of the level which you saved  :viridian:
Title: Re: VVVVVV Level Editor Tutorial - Part 3: Scripting
Post by: Trinket4067 on May 06, 2015, 04:16:00 PM
You don't need to. Just press L whilst editing a level - it'll do the same thing
Title: Re: VVVVVV Level Editor Tutorial - Part 3: Scripting
Post by: SteveGamer68 on May 30, 2016, 11:26:31 PM
How do I open a level file? I fail everytime.

My Face: :victoria:
You need to type the name in the .vvvvvv file,not the level names!

Hope it helps!  :viridian:
Title: Re: VVVVVV Level Editor Tutorial - Part 3: Scripting
Post by: DubstVne on November 04, 2017, 06:20:04 PM
 :o VVVVVV level editing wont work now, whenever I place a block, it does not show it. Can you please show me a way of how to fix this?  :'(
Title: Re: VVVVVV Level Editor Tutorial - Part 3: Scripting
Post by: weee50 on November 06, 2017, 04:31:23 PM
If you're new to this forum (you probably are because you have only 3 posts), the VVVVVV Help forum would probably be a better place to put your VVVVVV problems, not a topic that hasn't been posted in in over a year.

But anyway, have you tried right clicking? This could be the bug where, if you control-click, you'll be stuck in right-click mode until you right click.

If that doesn't work, you could be in Direct Mode. Try pressing F10 (or Fn+F10 if you're on Mac), and see if that helps.
Title: Re: VVVVVV Level Editor Tutorial - Part 3: Scripting
Post by: DubstVne on November 26, 2017, 12:10:48 PM
If you're new to this forum (you probably are because you have only 3 posts), the VVVVVV Help forum would probably be a better place to put your VVVVVV problems, not a topic that hasn't been posted in in over a year.

But anyway, have you tried right clicking? This could be the bug where, if you control-click, you'll be stuck in right-click mode until you right click.

If that doesn't work, you could be in Direct Mode. Try pressing F10 (or Fn+F10 if you're on Mac), and see if that helps.

Thanks it works now :)
Title: Re: VVVVVV Level Editor Tutorial - Part 3: Scripting
Post by: KostaRotaev on June 11, 2018, 08:47:33 AM
This is a script:

say
Are you want to open?
reply
Yes!
say
Opening gates...
delay(40)
flash
destroy(warptokens)
delay(40)
reply
Thank you!

This doesn't matter if your script working.
Title: Re: VVVVVV Level Editor Tutorial - Part 3: Scripting
Post by: KostaRotaev on June 13, 2018, 02:20:37 AM
It will say:

say(1,blue)
The blue come around.

Example:
say(2,blue)
The blue come around
into the Victoria.