The Mugen Fighters Guild

M.U.G.E.N Central => Development => Topic started by: Creamy_Goodness on June 01, 2014, 08:25:16 pm

Title: Loop trigger
Post by: Creamy_Goodness on June 01, 2014, 08:25:16 pm

> Is there a way to set up a trigger so that an event is repeated at regular intervals? I'm trying to have a projectile appear on every third tick of a state, and I understand that I can do this with trigger1 = Time = 3, trigger2 = Time = 6, trigger3 = Time = 9, etc. But I don't want to have to repeat this one hundred times, and it would be far more convenient to do this with one trigger.
Title: Re: Loop trigger
Post by: XGargoyle on June 01, 2014, 09:53:58 pm
trigger1 = gametime%3
Title: Re: Loop trigger
Post by: Sheng Long on June 01, 2014, 10:11:41 pm
Is there a difference between using trigger1 = gametime%3, or TimeMod = 3,0? Is timemod based on state time, and gametime is based on any time given?
Title: Re: Loop trigger
Post by: Creamy_Goodness on June 02, 2014, 01:07:49 am

@XGargoyle

"trigger1 = gametime%3"

> Thanks XG, I'll give it a shot.
Title: Re: Loop trigger
Post by: Bastard Mami on June 02, 2014, 05:28:21 am
Is there a difference between using trigger1 = gametime%3, or TimeMod = 3,0? Is timemod based on state time, and gametime is based on any time given?
yes, several ; timemod is deprecated so it might be dropped in future revisions of mugen; being practical about it it means very little, tho. a more practical difference is that gametime is based on the overall time of the round, while timemod is based on state time; so using game time mean that the first time the projectile will trigger does not necesarily mean it will be on time = 0, for the state, same for time=3,6, etc...
Title: Re: Loop trigger
Post by: Cyanide on June 02, 2014, 05:28:28 am
gametime is based on the game itself, i've had it go stupid on me a couple of times.

timemod is deprecated

time%3 = 0 would be every 3 ticks
Alternatively
time >= 0
persistent = 3

Will also work.
Title: Re: Loop trigger
Post by: Creamy_Goodness on June 02, 2014, 08:28:48 am

@Cyanide

> trigger1 = Time%3 = 0 did the trick, thank you very much. But tell me, what does the "0" do?
Title: Re: Loop trigger
Post by: Bastard Mami on June 02, 2014, 04:43:16 pm
% returns the remainder of the division, so tick by tick it will return 0,1,2,0,1,2 etc... so = 0 means to trigger then time%3 is returning 0
Title: Re: Loop trigger
Post by: Creamy_Goodness on June 02, 2014, 06:28:20 pm

@[MFG]maximilianjenus

"% returns the remainder of the division, so tick by tick it will return 0,1,2,0,1,2 etc... so = 0 means to trigger then time%3 is returning 0"

> OK I think I get it now, thanks. :)