playMaker

Author Topic: Activating and deactivating actions on a FSM through a variable send event  (Read 3262 times)

alternativee30

  • Playmaker Newbie
  • *
  • Posts: 24
I am wondering if this functionality exists. the reason i would want this is to be able to make certain actions on a FSM fire off once features are unlocked in the game. the actions would start in the deactivated state but as you progress in the game more actions become available in the FSM's.

Maybe there is a different way to do this other then activating and deactivating actions through events?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Hi,

currently, I don't think its possible as is, Maybe the PlayMaker exposes this possibility, but when I have to deal with such implementation, I tend to do the following:

 1: either activate deactivate gameObjects
 2: either activate deactivate Fsm Components
 3: implement the logic via events that move into different states all together.

I don't see anything wrong in moving into different states based on the progress. It's normal that several Fsm react to a global event and work together to provide a feature. This is the only way to create rich features. so for example send a global event PLAYER JUMP. If he won the bonus to jump higher, the fsm responsible for jumping can either not implement computation for the jump height, and simply use a global var or get the height from another fsm, which would know about this case and adjust the height when the user won the bonus. This way the Fsm responsible for the feature is aware of the minimum tasks, while other Fsm revolve around this feature to adjust the properties ( and are aware of the context of the jump for example)

Hope this make sense :)

 bye,

 Jean

alternativee30

  • Playmaker Newbie
  • *
  • Posts: 24
Thank you for the reply. I am not quite to the point where i need to implement this but i will use your answer when i get to that point.

alternativee30

  • Playmaker Newbie
  • *
  • Posts: 24
I think i will add custom events inside my FSM to switch to different state machines altogether when game components are unlocked.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Hi,

 ok. Also keep in mind that it's good to have as few as possible actions per state when possible. Then you can really re direct the flow of states and transitions easily.

bye,

 Jean