playMaker

Author Topic: Getting notified of state changes  (Read 1183 times)

Guillaume Portes

  • Playmaker Newbie
  • *
  • Posts: 4
Getting notified of state changes
« on: August 15, 2014, 07:06:33 AM »
Hello!

One of the main reason I want to use PlayMaker (great tool by the way!!) in Production is to describe state machines visually (i.e. I'm not *that* interested in the action side of things at the moment).
Essentially I want to be able to be notified whenever an FSM changes state and fires an event.
For state changes I implemented a simple MonoBehaviour that polls the FSM's current state (name), compares it to the last one, and fires a message to whoever's interested if it has indeed changed.
The issue with this is that some state changes of course take place over the same frame, which means I just cannot use this approach.
My next step before I (probably) give up and start coding everything is to build a custom structure from an FSM definition, so to use PlayMaker purely as an FSM description tool. Not great, but probably still better than hard coding my state machines.
Regarding getting notified on sent events I haven't found any way it would be remotely possible.

Can anyone help with this?

Thanks!

Guillaume.