Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: thatnzguy on April 20, 2015, 07:51:07 PM
-
I want a management FSM to start two other FSMs, then have the management continue to the next state when they are done.
What is an elegant way of starting some FSMs, and waiting for them all to finish?
(I don't want to use Run FSM and templates here)
Thanks!
Joel
-
i think a bool all true action is a good option here.
so instead that the other events would send an event back when they are done,
let them set a global bool to true for each other fsm.
then us a bool all true action to check if all are true.
greetings,
Dino
-
Hey, thanks for the response!
The problem with that is each FSM would have to have a unique corresponding bool, which doesn't work if I want to repeat this action, or have an arbitrary number of 'sub'FSMs
-
One way off the top of my head would be to have an empty gameobject(with FSM) in the scene for each unique FSM you want to control by the master FSM. The master could enable the gameobject thus starting the FSM. The unique FSM object could deactivate themselves when the FSM has completed. Then the master could wait until both object are null before it proceeds.
-
you can reset the bool @ the start of each fsm maybe?
or when the management FSM Continued?
another way is using int add, so @ the end of each fsm to add 1 to a global int
and in the master do an int compare,
if the int is equal to the required amount, continue and set the int to 0
greetings,
Dino