playMaker

Author Topic: Having a disabled FSM pause on its current state  (Read 2916 times)

Razieln64

  • Playmaker Newbie
  • *
  • Posts: 21
Having a disabled FSM pause on its current state
« 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?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Having a disabled FSM pause on its current state
« Reply #1 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...

Razieln64

  • Playmaker Newbie
  • *
  • Posts: 21
Re: Having a disabled FSM pause on its current state
« Reply #2 on: October 18, 2011, 01:03:22 AM »
Thanks for the reply.

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