Help needed for effect when a variable is over a certain number

Eff-n-Geoff

Veteran
Veteran
Joined
Oct 26, 2015
Messages
182
Reaction score
7
First Language
English
Hi there, this one is taxing me a little ...


I have a variable that is sporadically increased throughout the game when certain events occur. It is also constantly reduced by one every 60 frames.


When that variable goes over 60, I would like it to trigger a visual effect


If that variable goes over 80, I would like it to trigger a different visual effect.


My problem arrives when the variable goes to (for example) 90. This would force both the 60 and 80 visual to trigger constantly until the number gets below 80, and then 60.


How can I ensure that if the variable goes over 60, the visual effect only happens once. Then if it goes over 80, that only happens once.
 

sartha

Veteran
Veteran
Joined
Jan 15, 2013
Messages
31
Reaction score
6
First Language
English, French
Primarily Uses
Actually quite simple...


Make your event something like this:


If : Variable 1 >= 80


  Remove level 1 visual effect


  Apply level 2 visual effect


Else


  If : Variable 1 < 60


    Remove level 1 visual effect


    Remove level 2 visual effect


  Else


      Apply level 1 visual effect


      Remove level 2 visual effect


  End


End


If the effect is meant to be persistent (like the screen going red from rage) then that's all you need, if it's meant to just happen briefly when passing the threshold (like a flash) then you need to make a second event that specifically triggers the event then gets switched off.
 

Balako

PattyCake assosiation
Veteran
Joined
Mar 12, 2016
Messages
220
Reaction score
121
First Language
Arabic
Primarily Uses
N/A
if variable ==61


run visual effect 1


wait (frames)


remove visual effect


else


if variable ==81


run visual effect 2


wait (frames)


remove visual effect


else


if variable ==91


run visual 3


wait (frames)


remove visual effect


..... etc etc


this would work if you want the visual to show once then goes off, or use the one on the comment above for the constant one....i think this is basically the idea ..


please tell me if its not what you needed :D
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

The presentation pictures for FSM Castle Tiles are really bad, there is so much more content in this DLC than they show. Great DLC.^^
Anyone know/remember Mummy's Tomb / Crystals of Zong for C64? Trying to recreate it for One Map Challenge. Fun. And ... er ... challenging!


Listen.. I er... caught the live stream. :LZSwink:
The MZ first look stream was quite good. Looks like we get a lot of generator parts right off the bat this time around. Lots of cool clothes, helmets, facial marks, etc. Looking forward to playing around with it. :)
Any tips on how to share resources in here? Should I upload them in a image hosting site or Google Drive?

Forum statistics

Threads
100,822
Messages
979,972
Members
132,470
Latest member
denzelwatson
Top