playMaker

Author Topic: Easy Save - Best practice for saving FSM Variables on Playmaker Templates?  (Read 2454 times)

gumbomasta

  • Playmaker Newbie
  • *
  • Posts: 13
Hi,

I posted this over on the Easy Save board, but perhaps the Playmaker community could help me out, too.

As a new user of Easy Save, I'd like to know what you'd recommend is the best practice in saving unique variable data for objects that use Playmaker FSM Templates.  If I'm not mistaken, at runtime, Templates are no longer are templates, and are simply identical FSM component objects that still allow for unique variables. 

My game makes ample use of Playmaker templates, and depending on the template, there will be ten-twenty of them in a given scene.  While these templates contain unique variable data, they share the same names of variables, given their nature as Templates.

Using the Save All action inside Playmaker doesn't seem to work for me, as it overwrites the target file of whichever template got saved last, resulting in identical saved variable data across all the objects that share the Template.  Saving individual variables causes a similar problem, as they all seem to be overwriting each other, even with unique tags.

The approach that comes to mind right now is to save each FSM into it's own unique text file, but I'm wondering if there's a more elegant way.  I'm imagining quite a lot of .txt files being generated as a result of this.

Guidance appreciated,

-g

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Hi,
Maybe add a "Set Fsm int/float/...."
Have a string variable to set your 'variable name' and set 'inspector' on.
In the inspector set a unique name for each template variable on that string variable.

Then have a game object with an fsm and make variables with the names you made.
and then save from there.