If Trinkets?

Started by Sasha_Waters, January 06, 2017, 01:45:08 AM

Previous topic - Next topic

Sasha_Waters

So it's

iftrinkets(x,script)

then it'll work if you have x trinkets or more, right? So, theoretically, if I wanted to make it flash if you have 8 trinkets or more, I would say

iftrinkets(x,flash)

right? But I can't even get that to work!! How?! What do I do?

Quote

"Flash" on it's own is a command, not a script.  You must create a script that results in a flash, and plug that in instead.

So, instead of iftrinkets(x,flash), it would be something like

script1=flash

script2=iftrinkets(x,script1)

Sasha_Waters

OOooooh, I didn't know that's how that worked. Thank you! Can I do multiple lines of "script1"? Such as

script1=say(1)
You did it!

Or how would I do that?

Quote

You can add as many lines as you want into the script that will be called by script2.

QwertymanO07

All iftrinkets() does is redirect you to another script.

lol...ipops2


Sasha_Waters

Okay, so I've gotten to this point...

say(1)
Checking if you have 8 trinkets...
iftrinkets(8,script1)
iftrinketsless8(script2)
script1=destroy(warptokens)
script2=flash

And neither of these work. When I have less than 8 trinkets, the thing ends and no flash happens. When I have 8 trinkets, it will end with two black bars obscuring the top and bottom of the screen. Help?

QwertymanO07

As far as I'm aware, iftrinketsless() is broken.  On the other hand, anything below the iftrinkets() line works as an else statement, so if you use an always-true value, like iftrinkets(0,script2) it'll work exactly the same.  As for the black bars, you must add either another text box or endtext() (though I'm not actually sure that would work in simplified scripting) to script1.

Sasha_Waters

Are you sure? "Endtext" did nothing, and I don't know what to put into the parentheses

lol...ipops2

Quote from: Sasha_Waters on January 07, 2017, 12:14:19 AM
Okay, so I've gotten to this point...

say(1)
Checking if you have 8 trinkets...
iftrinkets(8,script1)
iftrinketsless8(script2)
script1=destroy(warptokens)
script2=flash

And neither of these work. When I have less than 8 trinkets, the thing ends and no flash happens. When I have 8 trinkets, it will end with two black bars obscuring the top and bottom of the screen. Help?
IT'S  iftrinketsless(8,x)

Sasha_Waters

Loller, that doesn't help in even the slightest. I made a typo, and I'm not even using iftrinketsless() anymore. Look, if someone could just show me how to do it, could someone do that? I mean, I want to make a gate that only opens when you have 8 trinkets or more. And I want different messages for when it works and when it doesn't. I am a total noob to coding in this game. Could someone please just post how they would code it out? Also, how do you format it so it's in that cool blue background thingy (on this forum)?

I have even looked up scripting for this game and nothing I have found helps! Even the pinned things on this forum! And when people put down "command()", I have no idea what I'm supposed to put in the parentheses to make it work! Please, please, please help, and also could someone direct me to the most in depth coding tutorial they can? I am missing so much, I can tell.

moth ✨

Script1

iftrinkets,8,script2
say,1
you don't have enough trinkets!

Script2

flash
destroy,warptokens

this should work

Dav999

You need two scripts, consider the first one (script1) is run first, iftrinkets() works like this:

Code (script1) Select
say(2)
This is always said first
(checking amount of trinkets)

iftrinkets(8,script2)

say(3,red)
This is said when you have
less than 8 trinkets
(not opening gate)


Code (script2) Select
say(3,green)
This is said when you have
8 trinkets or more
(opening gate now)

flash



Check out these topics for more information about scripting:
VVVVVV Level Editor Tutorial - Part 3: Scripting
Script commands index and hints


(I got severely ninja'd by Shiny because I was doing other things, but I'd consider my post to be more complete. And also: let's consistently use the standard scripting notation with brackets, and not suddenly introduce Info Teddy's comma notation)

Ally 🌠

Quote from: Sasha_Waters on January 08, 2017, 08:55:24 PM
Also, how do you format it so it's in that cool blue background thingy (on this forum)?

Sasha_Waters

Quote from: Dav999 on January 08, 2017, 10:27:57 PM
You need two scripts, consider the first one (script1) is run first, iftrinkets() works like this:

Code (script1) Select
say(2)
This is always said first
(checking amount of trinkets)

iftrinkets(8,script2)

say(3,red)
This is said when you have
less than 8 trinkets
(not opening gate)


Code (script2) Select
say(3,green)
This is said when you have
8 trinkets or more
(opening gate now)

flash



Check out these topics for more information about scripting:
VVVVVV Level Editor Tutorial - Part 3: Scripting
Script commands index and hints


(I got severely ninja'd by Shiny because I was doing other things, but I'd consider my post to be more complete. And also: let's consistently use the standard scripting notation with brackets, and not suddenly introduce Info Teddy's comma notation)
THANK YOU! I didn't understand it literally had to be another script... That was an interesting misunderstanding on my part. Sorry, and thank you so much!! It works now!!