Calculate time after another trigger (Read 505 times)

Started by DR119, December 03, 2017, 12:36:26 am
Share this topic:
Calculate time after another trigger
#1  December 03, 2017, 12:36:26 am
  • avatar
  • **
Usually, the "time" trigger calculates the time that has passed since the start of the round. But how do I calculate the time that has passed since another trigger was activated? For example 30 frames after the round was won?
Last Edit: December 03, 2017, 01:54:45 am by DR119
Re: Calculate time after another trigger
#2  December 03, 2017, 01:47:43 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
Variable timers. Winko sets the var. Use -2 to increment it while its not 0. When it hits 30 thats 30 ticks.

In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.


Re: Calculate time after another trigger
#3  December 03, 2017, 02:20:49 am
  • ****
  • inktrebuchet
    • USA
I thought “time” was just the amount of time spent in the current state and “Gametime” was the amount of time in the round.

Would something like this work too?
trigger1 = win
trigger1 = gametime%999999 = 30
Re: Calculate time after another trigger
#4  December 04, 2017, 06:05:28 pm
  • ****
  • Robotics Engineer
    • USA
I found this in MUGEN Class about Gametime:

Notes from Game-time and state-time (CNS)
Did a little testing. In WinMUGEN and 1.0, GameTime seems to count up for every tick that the game is 'in a fight'. So from the moment it starts fading in to a fight in RoundState = 0, it's starts counting up, and is only halted by pausing the game or entering a menu (returning to character select, displaying a victory screen or vs screen, etc). Once it enters a battle again, it continues counting from where it left off, meaning the only way to reset this number to zero is to close MUGEN.

In 1.1, GameTime counts up from the moment MUGEN is opened and only stops when MUGEN is closed, regardless if you're in a menu or a battle. With these things in mind, GameTime seems to have very niche uses for characters.

So GameTime is most useful for intermittent triggering (Gametime%50 = 0 /// triggers every 50 ticks).  Or you capture the current Gametime as a Var, then compare against it to see how much time has advanced.

@DR119: The best way to make those kinds of calculations is different depending on the situation.  You say 30 ticks after the round ends - well, if it's for a win pose the solution would be as simple as using trigger "Time = 30" in your WinPose state.  If you need to trigger something 30 ticks while you're KOd, it would have to be more complicated involving vars to keep track of the time elapsing.