playMaker

Author Topic: [SOLVED] Return to previous FSM state after entering global transition  (Read 3145 times)

ryf9059

  • Full Member
  • ***
  • Posts: 100
I'm trying to make a FSM that controls character and found it rather difficult.

I used 2 FSM: input and animation, input is for collecting input and send those event to animation FSM, animation is for playing animation.

I have the FSMs setup like this:



One thing I find difficult is that the player must be in a certain animation state at a time and those states are closely bound by the input axis (right and idle relations), and this graph become self contained and there is no good way to detect things such as fire button down unless I check the input in every substate but as the animation graph gets bigger things will become more complex and hard to manage. So I plan to use fire and jump button down as global transition so it can break out the graph. But the question is how do I return to the previous state graph once the global transition is complete? And is there a more efficient way of organizing those relations?

Please advise.
« Last Edit: June 10, 2013, 01:38:21 AM by ryf9059 »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Return to previous FSM state after entering global transition
« Reply #1 on: June 09, 2013, 12:37:14 PM »
I would split this into multiple FSMs that run at the same time.
Any behavior that runs independently of other behaviors can be it's own FSM.
You can also turn this FSM on/off as desired.

Or use the Run FSM action to run an FSM while a state is active.

But there is also a Goto Previous State action if you need it...

ryf9059

  • Full Member
  • ***
  • Posts: 100
Re: Return to previous FSM state after entering global transition
« Reply #2 on: June 09, 2013, 03:28:13 PM »
I would split this into multiple FSMs that run at the same time.
Any behavior that runs independently of other behaviors can be it's own FSM.
You can also turn this FSM on/off as desired.

Or use the Run FSM action to run an FSM while a state is active.

But there is also a Goto Previous State action if you need it...

In this senario do you suggest using Goto Previous or not?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Return to previous FSM state after entering global transition
« Reply #3 on: June 09, 2013, 04:06:05 PM »
With your current setup Goto Previous State should help.

With multiple parallel FSMs you generally don't need to use Goto Previous State as much...