Playmaker Forum

Bug Reporting => PlayMaker Bug Reporting => Topic started by: qholmes on September 17, 2012, 04:26:51 PM

Title: Send Event Delay
Post by: qholmes on September 17, 2012, 04:26:51 PM
I just found an error i think.. I have a Send Event with a 20 second delay to reset some animations kind of in a loop..

So at 20 sec it jumps to another state and then back to this one to reset the animations and other things to the beginning etc..

So it runs fine if i just start it up and run it.. now if i click another object that causes this FSM to jump to another state of waiting it is like the timer for the send even is messed up.. after this it now triggers after 8 to 14 seconds or something.. kind of random.

I honestly dont remember what version i am running at the moment. I have not been doing any beta testing that i know of.. so probably just the latest stable normal release.. Unless there is a new one lately which i have not updated to..
Title: Re: Send Event Delay
Post by: qholmes on September 17, 2012, 04:30:45 PM
I just posted via the bug reporting menu.. sorry i just noticed that post.

Q
Title: Re: Send Event Delay
Post by: qholmes on September 17, 2012, 10:14:52 PM
sent another bug report with reproduction instructions.

I hope it is just my version or something.. its killing my final version for my client.. Maybe i can figure out a different way to code it.

Q
Title: Re: Send Event Delay
Post by: jeanfabre on September 18, 2012, 07:11:55 AM
Hi,

 Events fired with a delay WILL be fired, even if you exit the state. if that what you are experiencing?

 bye,

 Jean
Title: Re: Send Event Delay
Post by: qholmes on September 18, 2012, 07:57:15 AM
Really.......

That does not make any sense to me.. If you leave a state it should not be doing anything. And if you reenter a state it should start over and reset..

So i think what i am experiencing is some kind of multiple version of that delay running so each time i go in it starts a new copy of the delay timer or something.. Because when i go back in it triggers at all different kinds of times.. 4 sec 12 sec 8 sec etc... if i made a chart maybe i would see that there were multiple timers running and sending the event over and over all at staggered 20 sec delay times.

Q
Title: Re: Send Event Delay
Post by: jeanfabre on September 18, 2012, 10:24:44 AM
Hi,

 Yes, I think so too that it is misleading. I can't find an action I did that was fixing this problem, I'll send it as soon as I can find it,

bye,

 Jean
Title: Re: Send Event Delay
Post by: qholmes on September 18, 2012, 10:31:17 AM
Thanks Jean..

Yes so i just proved that it is creating new timers every time it enters that state.. that cant be good. I interrupted it at 10 sec on my 20 sec timer and then it fired every 10 sec.. so then i interrupted it at a 5 sec interval once or twice.. and now it is firing every 5 sec. So every time it enters that state it makes a new timer. And all of the old ones are still running as well..

Q
Title: Re: Send Event Delay
Post by: qholmes on September 18, 2012, 10:34:02 AM
And i have never figured out why there is an Every Frame option in Send Event?

Just looking at the code now.

Q
Title: Re: Send Event Delay
Post by: jeanfabre on September 18, 2012, 10:59:09 AM
hi,

 found it,

 try this, and tell me if that works for you,

 bye,

 Jean
Title: Re: Send Event Delay
Post by: qholmes on September 18, 2012, 11:14:09 AM
Jean,

Thanks yours does work!!!

I made one too that is just the code from an older version of Send Event that i had modified for something else and i noticed that the delayed Event code was handled differently.. maybe there was a reason for that.

What do you think? Which one should i use?

Q
Title: Re: Send Event Delay
Post by: jerware on March 14, 2013, 06:20:48 PM
Yikes! I just encountered this today, and I'm so glad this thread existed. Has Alex been made aware of it? Certainly multiple timers running concurrently is a bad thing. I agree that if you exit the state on another event, the timer should be destroyed.

I just noticed a "Kill Delayed Events" action exists. I suppose it's meant as a workaround for this problem, though its documentation link doesn't work.
Title: Re: Send Event Delay
Post by: jeanfabre on March 15, 2013, 10:14:05 AM
Hi,

 thanks for the report, have you submitted a bug on that broken doc link? if not, I'll do it.

bye,

 Jean
Title: Re: Send Event Delay
Post by: jerware on March 15, 2013, 01:21:56 PM
I just submitted a bug report about the documentation link. Also, thanks for the replacement Send Event action, which solves the original problem.