Author Topic: VVVVVV Level Editor Tutorial - Part 3: Scripting  (Read 13094 times)

Terry

  • Administrator
  • Captain
  • *****
  • Posts: 600
    • View Profile
    • distractionware
VVVVVV Level Editor Tutorial - Part 3: Scripting
« 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 for a more detailed explaination of things!
« Last Edit: May 07, 2015, 08:02:46 AM by Terry »

Vitellary

  • Doctor
  • ***
  • Posts: 52
  • If you like VVVVVV, say I. I!
    • View Profile
Re: VVVVVV Level Editor Tutorial - Part 3: Scripting
« Reply #1 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)!

stylzm

  • Doctor
  • ***
  • Posts: 99
  • Im The Doctor!
    • View Profile
Re: VVVVVV Level Editor Tutorial - Part 3: Scripting
« Reply #2 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

ToasterApocalypse

  • Captain
  • *****
  • Posts: 1010
  • le lenny face
    • View Profile
Re: VVVVVV Level Editor Tutorial - Part 3: Scripting
« Reply #3 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

FIQ

  • Captain
  • *****
  • Posts: 809
  • https://github.com/FredrIQ/
    • View Profile
    • FIQ
Re: VVVVVV Level Editor Tutorial - Part 3: Scripting
« Reply #4 on: June 17, 2014, 12:21:48 PM »
How about Script command index and hints?
It's not really a tutorial, but a full reference to the (simplified) VVVVVV scripting language.
« Last Edit: June 17, 2014, 12:26:14 PM by FIQ »

Dav999

  • Global Moderator
  • Captain
  • *****
  • Posts: 2102
    • View Profile
    • The Open Level Project
Re: VVVVVV Level Editor Tutorial - Part 3: Scripting
« Reply #5 on: June 17, 2014, 12:35:22 PM »
Some additions to the quote in the first post:
  • Flag numbers are from 0 to 99, excluding 67 if you want to maintain compatibility with 2.0 and 2.1
  • iftrinketsless() doesn't work properly
  • The amount of lines in text boxes shouldn't exceed 5 for compatibility with 2.0
  • 2.1+ commands like say(lines,color) and making other crewmates happy and sad
:viridian:

caleb

  • Crewmate
  • *
  • Posts: 5
  • Caleb is in the house!
    • View Profile
Re: VVVVVV Level Editor Tutorial - Part 3: Scripting
« Reply #6 on: January 31, 2015, 03:54:21 PM »
How do I open a level file? I fail everytime.

My Face: :victoria:

SJMistery

  • Captain
  • *****
  • Posts: 455
    • View Profile
Re: VVVVVV Level Editor Tutorial - Part 3: Scripting
« Reply #7 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:

Sendy

  • Professor
  • ****
  • Posts: 163
  • Progenitor of the Great Spike Incident of 4
    • View Profile
    • My music at soundcloud
Re: VVVVVV Level Editor Tutorial - Part 3: Scripting
« Reply #8 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.

onepamop_wl

  • Crewmate
  • *
  • Posts: 8
  • oh, hi everyone!
    • View Profile
Re: VVVVVV Level Editor Tutorial - Part 3: Scripting
« Reply #9 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:

Trinket4067

  • Guest
Re: VVVVVV Level Editor Tutorial - Part 3: Scripting
« Reply #10 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

SteveGamer68

  • Professor
  • ****
  • Posts: 127
  • Changed my old avatar
    • View Profile
    • The open level project 2 forum
Re: VVVVVV Level Editor Tutorial - Part 3: Scripting
« Reply #11 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:
« Last Edit: June 30, 2016, 01:15:12 AM by SteveGamer68 »