Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Razieln64 on October 14, 2011, 01:57:34 PM

Title: Having a disabled FSM pause on its current state
Post by: Razieln64 on October 14, 2011, 01:57:34 PM
Hi,

I was wondering if it was possible to disable an FSM but keep its current state paused. I'm asking this in order to have the least updates running at the same time. Since we have controlled environments in our game, I'd like to be able to disable FSMs when the player goes from an area to another.

Re-enabling an FSM is also needed (resuming its state as when it's paused). I tried disabling an FSM but when it is disabled while in the middle of a state, it will be messed up when it is re-enabled again.

For example, I have enemies that need to turn around 180 degrees when they collide with objects/ other enemies (I'm using float animations and/or iTweens). If I disable their FSM when the rotation isn't finished, they will walk side ways when the FSM is resumed.

Right now my current solution is to have an event to which all states will respond, but only after they're completed. Then the FSM will disable itself in a state where it will get back to normal when it is re-enabled. This makes for complicated FSMs. Is there a better solution for this?
Title: Re: Having a disabled FSM pause on its current state
Post by: Alex Chouls on October 17, 2011, 08:58:37 PM
Let me think about this a bit... it might make sense to add an option to keep the current state when disabled, but I need to investigate and think it through a bit...
Title: Re: Having a disabled FSM pause on its current state
Post by: Razieln64 on October 18, 2011, 01:03:22 AM
Thanks for the reply.

Maybe this feature could be added in the next version... :)