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

Yanfly told me the new earth all animations in MZ look a bit like summoning potatoes and now I can't unsee it. halp
Despite time and all the other things I am working on, I decided that I am going to start a Fire Emblem-like project. Follow your dreams! I'll just have to balance hours efficiently. I'm also not making this as complex as my Might and Magic inspired project, so it will be a much easier project to work on.
So I've taken to doing a test of the game, and making a list of everything I think of during the test to add/fix. Over the course of the night I check them off as I do them, and by the end of the night I always feel like I've accomplished something. :LZSexcite:
Eventz MZ? Events MZ!

Forum statistics

Threads
100,586
Messages
977,522
Members
132,181
Latest member
Reich
Top