Author Topic: Why isn't this script working?  (Read 2897 times)

Epsilon

  • Professor
  • ****
  • Posts: 139
  • (ʘ‿ʘ)
    • View Profile
Why isn't this script working?
« 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:

Hejmstel

  • Captain
  • *****
  • Posts: 502
  • Formerly "Doormat"
    • View Profile
    • My hardly used YT account
Re: Why isn't this script working?
« Reply #1 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.

Epsilon

  • Professor
  • ****
  • Posts: 139
  • (ʘ‿ʘ)
    • View Profile
Re: Why isn't this script working?
« Reply #2 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*