YesNoOk
avatar

Variable countdown (Read 163 times)

Started by Liero, September 24, 2009, 08:57:34 pm
Share this topic:
Variable countdown
#1  September 24, 2009, 08:57:34 pm
  • **
    • http://rumblepk.tumblr.com/
I need a way to test if a variable is counting down.  What I have is a variable that loses one unit per frame and based on certain events is set to certain numbers which then activate events.  What I don't want is the event to activate when the variable is counting down; but only when the variable is set to that number.  Is this possible?
Re: Variable countdown
#2  September 24, 2009, 08:59:51 pm
  • ******
    • www.mugenguild.com/pots/
If you just want to check what the var is up to you can use
[mcode]DisplayToClipboard[/mcode]
Use anything you want from my works.  If you need to contact me use email, not private messages.
Re: Variable countdown
#3  September 24, 2009, 09:02:24 pm
  • ******
Can't you make a workaround by checking what makes the variable count down to begin with ? If you expect the variable to have a fixed value at some point, you have to know when the variable is supposed to count down : just determine the case when you're not making it count down.
Otherwise you can maybe try another variable that records the value your variable had on the previous tick, and just see if the two are equal - i.e., if the variable you want has not changed since last tick. For that, have that new variable take the new value only at the end of your file (end of your statedef -2), after you're done checking if the two have the same value.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.