[SOLVED] Trigger the clock

Started by jjmugen, December 10, 2011, 12:54:44 PM

Previous topic - Next topic

jjmugen

Hi, guys.

I want to implement some states depending of the clock time in each round.
I can't find a trigger which triggers with the value of the clock.

I've found "Gametime". It's OK for round 1, but gametime add the whole fight time,
includding the round 1 passed time if you are in round 2, for example.

Is there any trick for triggering depending of the clock time?

Thanks

Cyanide

No. None whatsoever.

I have an idea, but i can't put it into words. Involves removing the previous rounds gametime from gametime and retaining that value in a variable, then using gametime - variable to give you current timing.

You would have to set the var on gametime all the time or superpauses etc will put the timing of it off. Variable needs to be set/reset in state 5900 all the time as you need unique gametime per match.


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.

jjmugen

#2
Quote from: Cyanide on December 10, 2011, 10:12:55 PM
No. None whatsoever.

I have an idea, but i can't put it into words. Involves removing the previous rounds gametime from gametime and retaining that value in a variable, then using gametime - variable to give you current timing.

You would have to set the var on gametime all the time or superpauses etc will put the timing of it off. Variable needs to be set/reset in state 5900 all the time as you need unique gametime per match.

Oh, you've given me a good idea.
I was trying this things you propose, and then I tried to make a game clock, so easy, and I think it works:

[Statedef -2]

[State -2, GameClock]
type = VarAdd
triggerall = roundstate = 2
trigger1 = (Gametime % 60) = 0
v = X
value = 1


So var(x) has in each round the number of seconds passed per round.

Thanks for the inspiration.

Is it OK or I'm forgeting something?

And also, is it possible to save a var value between different rounds? It would be interesting get the round 1 final clock altought you are in round 2 or something.

Cyanide

Yes, variables can be retained between rounds. People often use var(59) for AI so they can use a top end value of intpersistindex in the constants. intpersistindex = 58 is all variables over 58 are not reset between rounds, bring the value down to allow more through.


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.

jjmugen

Quote from: Cyanide on December 11, 2011, 08:26:25 PM
Yes, variables can be retained between rounds. People often use var(59) for AI so they can use a top end value of intpersistindex in the constants. intpersistindex = 58 is all variables over 58 are not reset between rounds, bring the value down to allow more through.

Ok, this so useful.
Thanks a lot.
I can make a clock now :)