playMaker

Author Topic: An FSM terminates. OK. Then what?  (Read 1511 times)

thierry_st_malo

  • Junior Playmaker
  • **
  • Posts: 58
An FSM terminates. OK. Then what?
« on: October 02, 2017, 04:49:42 AM »
Hi, all!

Let's suppose that FSM "A" starts FSM "B" (Enable FSM action). "B" is just a sequence of actions. It sends no events, not even an explicit FINISHED and it doesn't loop on itself.
When "B" has executed its last action it kind of stops, I assume. But then, what happens exactly to "B" and/or "A"? In particular, where does the control (which was in "B") go?

Thanks for your help.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: An FSM terminates. OK. Then what?
« Reply #1 on: October 02, 2017, 10:46:17 AM »
Hi,
I am not sure what you mean,
but when you play and the state is active, the greyed out actions have done what they suppose to do, if you have an action whit every frame on you will see that it keeps running.

When the fsm's are done they simply do nothing any more, the same way if you would c# scripts :)

thierry_st_malo

  • Junior Playmaker
  • **
  • Posts: 58
Re: An FSM terminates. OK. Then what?
« Reply #2 on: October 03, 2017, 02:58:08 AM »
Understood, thank you. So, enabling an FSM isn't equivalent to calling a subroutine.

Thierry

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: An FSM terminates. OK. Then what?
« Reply #3 on: October 03, 2017, 11:50:30 AM »
Hi,
Maybe you can look into using 'run fsm' , but i never used it myself yet.
(I really should look into it tho  ;) )

I usually use Global events if i need to trigger a sequence multiple times (for exaple when pressing a button)
and 'Set Fsm' Actions if i need to set some variables.