distractionware forums

Archived => VVVVVV Tech Support => Topic started by: Epsilon on March 21, 2013, 07:03:14 PM

Title: Why isn't this script working?
Post by: Epsilon on March 21, 2013, 07:03:14 PM
So, I've tried and tried, and finally had to resort to posting here.
In my level, I'm trying to make it so Violet tells you if you have all the trinkets or if you're missing one. However, when I get the one and only Trinket, it still activates the "You dont have any" one.  :victoria: The scripts are called "thisisscript" (for you dont have any),"whatisthis" (for having the one) and "meep" (the iftrinkets script)
The trinket is in room 15,5 then the scene is in room 10,13. Download below. Yes, I checked, the scripts are the same name and the iftrinkets script has both of them included in seperate lines.

Thanks in advance  :viridian:
Title: Re: Why isn't this script working?
Post by: Stelpjo on March 21, 2013, 08:14:47 PM
I've found out the problem. You wrote:
iftrinkets(0,thisisscript)
iftrinkets(1,whatisthis)

This doesn't work, as iftrinkets(X,script) will check if you have X or more trinkets. You always have 0 or more, so iftrinkets(0,script) always loads the script. Try moving iftrinkets(0,thisisscript) below iftrinkets(1,whatisthis) and it should work.
Title: Re: Why isn't this script working?
Post by: Epsilon on March 21, 2013, 09:10:50 PM
I've found out the problem. You wrote:
iftrinkets(0,thisisscript)
iftrinkets(1,whatisthis)

This doesn't work, as iftrinkets(X,script) will check if you have X or more trinkets. You always have 0 or more, so iftrinkets(0,script) always loads the script. Try moving iftrinkets(0,thisisscript) below iftrinkets(1,whatisthis) and it should work.

It worked! Thanks, Doormat! *locking*