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.
Help needed for effect when a variable is over a certain number
● ARCHIVED · READ-ONLY
-
-
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. -
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