playMaker

Author Topic: How to restore FSM state?  (Read 3381 times)

adbourdages

  • Playmaker Newbie
  • *
  • Posts: 3
How to restore FSM state?
« on: April 19, 2015, 05:18:19 PM »
Hello,

I'm evaluating PlayMaker for implementing scriptable objects inside a game, where each object would have its state/logic based on a FSM. Something I've been looking all over the docs and forum for however is how to save/restore the state of an FSM?

For instance, let's say there is a light with an FSM attached. It has 3 states:
- off
- animate-on (animate the alpha over 1s)
- on

If I restore the scene state from a save game, how can I set the proper state on this FSM? Further, if the state was animate-on, can the time left to animate be restored as well?

Thanks,
Alain-Daniel

adbourdages

  • Playmaker Newbie
  • *
  • Posts: 3
Re: How to restore FSM state?
« Reply #1 on: April 21, 2015, 11:49:47 AM »
Hello,

I'm still looking into this and I'm very puzzled. There are tons of games using Playmaker, how do they create a save point and restore to it?

In our previous framework, we can tell the Fsm to go to a specific state so that can be serialized. In addition, the internal variables of each action can also be accessed and serialized (like a Wait action that would have 0.25s left out of a 1s timer). I just can't find any utilities for that here.

I'll use a simple example: I make a blinking light using playmaker. When I save the game state, the light is either in On or Off state and there is X seconds left on the Wait action to switch to the other state. How do I restore to that?

I have to be missing something here.

Cheers,
Alain-Daniel

haikugames

  • Playmaker Newbie
  • *
  • Posts: 25
Re: How to restore FSM state?
« Reply #2 on: June 18, 2015, 07:03:40 PM »
I wanted to follow up and ask if you you ever figured this out? We use Playmaker for our game and we do not have constant saving for this reason.  We just save what scene the player has advanced to, but this is obviously not ideal.