playMaker

Author Topic: Saving and loading FSMs in intermediate states  (Read 1743 times)

haikugames

  • Playmaker Newbie
  • *
  • Posts: 25
Saving and loading FSMs in intermediate states
« on: March 25, 2014, 03:05:16 PM »
I'm making an adventure game. In the game I have a lot of FSMs which represent objects the player can interact with.  For example, I have a Sprite with a PlaymakerFSM which is a box.  It starts unopened, and then when the player taps on it, I change the Sprite to a box open sprite with an item inside, and when the player taps again the item is taken.  My FSM represents each of these states.

My question is what's the best way to save all this.  I want the player to be able to load the level and see all the objects in the state s/he left them in (so if they opened the box but didn't take the item, it looks like that).  As far as I can tell, it's hard to load FSMs in an intermediate state.  I tried Unity Serializer but it appears unsupported and I ran into an immediate issue found here:
http://whydoidoit.com/forums/topic/need-help-locating-playmaker-serializer-error/

Any advice?

mweyna

  • Full Member
  • ***
  • Posts: 242
Re: Saving and loading FSMs in intermediate states
« Reply #1 on: March 25, 2014, 03:49:03 PM »
So off the top of my head, you could use EasySave and have each FSM save out a string or bool variable on each step (So When an FSM went into STEP 2, it sets SetBool02 to true). Then have an FSM on load bring in each bool, and send an event based on which Bool is true to those respective FSMs. This approach is definitely a lot of work to rig up but should do the job. Maybe someone has a faster way of doing it though.

haikugames

  • Playmaker Newbie
  • *
  • Posts: 25
Re: Saving and loading FSMs in intermediate states
« Reply #2 on: March 26, 2014, 12:15:00 PM »
Wow very creative.  It does sound pretty painful to rig up though! Crossing my fingers some others have ideas here.  :)