playMaker

Author Topic: Sending Event on a Delay without needing to remain in the State?[SOLVED]  (Read 2296 times)

MikeTelly

  • Playmaker Newbie
  • *
  • Posts: 40
Is there a way to do this? Apparently this is how Send Event initially functioned. It seemed like a good way to set up timers within an FSM. If you can't make a Timer using Send Event, how do you make timers that work across a single FSM (without creating a separate FSM)? Using the Wait action doesn't work as that forces me to stay in a single state.
« Last Edit: July 23, 2018, 02:49:02 AM by jeanfabre »

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Sending Event on a Delay without needing to remain in the State?
« Reply #1 on: July 23, 2018, 12:51:38 AM »
It can't be done with a single state machine.
Available for Playmaker work

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Sending Event on a Delay without needing to remain in the State?
« Reply #2 on: July 23, 2018, 02:48:52 AM »
Hi,

 Yes it can be done actually :)

there is a fsm setting you can turn on so that delayed event are kept alive even if you exit the state you have defined it.

use Fsm.KeepDelayedEventsOnStateExit = true;

If you need a custom action for this ( if you don't know how to code), let me know, I'll do it.

 Bye,

 Jean

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Whoa  ;D
Available for Playmaker work

MikeTelly

  • Playmaker Newbie
  • *
  • Posts: 40
Re: Sending Event on a Delay without needing to remain in the State?
« Reply #4 on: July 23, 2018, 08:08:48 AM »
Hi,

 Yes it can be done actually :)

there is a fsm setting you can turn on so that delayed event are kept alive even if you exit the state you have defined it.

use Fsm.KeepDelayedEventsOnStateExit = true;

If you need a custom action for this ( if you don't know how to code), let me know, I'll do it.

 Bye,

 Jean

Ya I'd really appreciate a custom action.

Plancksize

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 75
Re: Sending Event on a Delay without needing to remain in the State?
« Reply #5 on: July 23, 2018, 08:34:44 AM »

<SNIP>

use Fsm.KeepDelayedEventsOnStateExit = true;

If you need a custom action for this ( if you don't know how to code), let me know, I'll do it.

<SNIP>


Oh. I've been activating gameobjects that then self-deactivate with a Wait and Send Delay for that.
An action to avoid using those GOs for delayed events would be awesome.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Hi,

 ok, it's on the Ecosystem



Let me know if it works ok for you, then I'll tweet about it.

 Bye,

 Jean

MikeTelly

  • Playmaker Newbie
  • *
  • Posts: 40
Hi,

 ok, it's on the Ecosystem

Let me know if it works ok for you, then I'll tweet about it.

 Bye,

 Jean

I imported it and got the message below. How exactly do you use it through? Is it that if we force a state to exit and if a delayed event has been activated, the delayed event will still go off?

If so, is there a way to make it attached to Send Event only? I made this variation of Send Event that finishes if you select the "State Independent" bool and while having a Delay. The Event will go off regardless of if you left the state. It seems though that Fsm.KeepDelayedEventsOnStateExit is a property of the whole FSM and not individual actions/events. Is there a way to turn this bool to true, send the event, and then back to false without potentially effecting other events?
« Last Edit: July 24, 2018, 10:35:18 AM by MikeTelly »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Hi,

- ignore the warning, it'a harmless.

- yes, you set it for a given fsm, and then all delayed event in that fsm will not be interupted if you exit the state where the delayed event was sent from.

 Bye,

 Jean