playMaker

Author Topic: How to Set Up Logic For An FSM  (Read 1476 times)

G-Kaiser

  • Playmaker Newbie
  • *
  • Posts: 34
How to Set Up Logic For An FSM
« on: December 13, 2014, 06:52:22 AM »
I would like to disable an FSM if certain conditions are met: If up and right are pressed within a certain amount of time it will disable the FSM. How can I go about doing such a thing? I know that I have to use boolean variables, but how can set up the logic to make it work?
« Last Edit: December 13, 2014, 01:05:14 PM by G-Kaiser »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How to Set Up Logic For An FSM
« Reply #1 on: December 16, 2014, 02:53:34 AM »
Hi,

many ways to achieve this:

one way:
 
-- one fsm will watch the up time and send a global event "UP LONG PRESS" or soemthing
-- a second fsm will watch the right and send a global event "RIGHT LONG PRESS"

-- both will also fire a "COMBO CANCELED" is the up or right key is released before the time out.

a third fsm will listen to these three events, and if it get both long press, disable the targeted fsm using the action "enable behavior"

You can certaintly create a more complex fsm, but there is nothing wrong in having multiple fsm.


 Experiment with this. If you are going nowhere :) I'll do a sample.

Bye,

 Jean