playMaker

Author Topic: [SOLVED] State initialization.  (Read 3132 times)

DARK_ETERNAL

  • Full Member
  • ***
  • Posts: 110
[SOLVED] State initialization.
« on: October 19, 2012, 05:51:02 PM »
Greetings.

I'm new to Playmaker. I successfully recreated a minigame I made about a year using only the editor, and now I'm trying to manipulate FSM through scripts.

For the sake of learning, I have created a simple FSM, so I can get it's data (variables, events, states, etc), and I created a custom script that receives an FSM and changes FSM's states on demand. At Start() function, I get the basic FSM data (variables and states) and I intend to get the active state info. Using PlayMakerFSM.ActiveStateName to get actual state name (as the property name implies), but I get an empty string. Now, getting the actual FSM object, using the PlayMakerFSM.Fsm (which is an Fsm object), it allows to retrieve the ActualState (the one I was looking for) and, therefore, the name. But Start() function fails to get the state object, and the name, of course, but the FSM data is retrieved. If I retrieve that state data after Start() is called, it will be successfully retrieved.

Is active state set some time after initialization functions (Awake, Start), or it's set IN a Start function? (If it was Awake, it should retrieve, since I'm calling a Start() function). If so, should I delay the function I use to get the Fsm object?

Thanks in advance.

[Oct 22 - Update]
Seems to be working now. None of my code have been changed, though. Does Anyone know about some site containing the API docs for Playmaker? The API reference shows how to create custom actions, but what I'd like to have is the API documentation, describing, for each class, it's members, functions and such data, if there is any.

[Nov 14 - Update]
As one of the new features in Playmaker 1.4.4, State initialization is done in Awake() function, according to latest release notes. Therefore I'm marking this as solved.

https://hutonggames.fogbugz.com/default.asp?W311
« Last Edit: November 14, 2012, 10:59:07 AM by DARK_ETERNAL »
Check out our new game: Nitro Chimp. Now live in App Store!

Trailer:
Download: https://itunes.apple.com/app/nitro-chimp/id557150450?l=en&mt=8