Why isn't this script working?

Started by Epsilon, March 22, 2013, 02:03:14 AM

Previous topic - Next topic

Epsilon

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:

Fussmatte

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.

Epsilon

Quote from: Doormat on March 22, 2013, 03:14:47 AM
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*