playMaker

Author Topic: Cannot save local variables in FSM with EasySave  (Read 1168 times)

velketor

  • Junior Playmaker
  • **
  • Posts: 69
  • Multimedia Marathon Man
    • Shawn Kilian Portfolio
Cannot save local variables in FSM with EasySave
« on: September 06, 2020, 10:00:01 PM »
Hello,

I successfully save/load Global Variables with Easy Save using Save All and Load All actions but I cannot get Local Variables to save with Easy Save using Save All and Load All actions.  I even made sure to check "Save FSM Variables".  I know they only save specific to the FSM they are in, and I've made sure to use it in the FSM with the local variables.



Nothing I do will save local FSM variables.  Globals always work.  Am I stuck using Globals with Easy Save?

Please advise.  Thanks!

heavygunner

  • Sr. Member
  • ****
  • Posts: 344
Re: Cannot save local variables in FSM with EasySave
« Reply #1 on: September 06, 2020, 10:37:37 PM »
While loading, send an Error event (in-case if error occurred) to another state and come back to load state after few sec wait.

velketor

  • Junior Playmaker
  • **
  • Posts: 69
  • Multimedia Marathon Man
    • Shawn Kilian Portfolio
Re: Cannot save local variables in FSM with EasySave
« Reply #2 on: September 07, 2020, 07:51:55 AM »
Thank you for the suggestion heavygunner.  I added an error even to my save and to my load, but it never finds an error.

heavygunner

  • Sr. Member
  • ****
  • Posts: 344
Re: Cannot save local variables in FSM with EasySave
« Reply #3 on: September 07, 2020, 07:53:12 AM »
Did you fixed it ? or share screenshot of save and load fsm?
it is working fine on my end

velketor

  • Junior Playmaker
  • **
  • Posts: 69
  • Multimedia Marathon Man
    • Shawn Kilian Portfolio
Re: Cannot save local variables in FSM with EasySave
« Reply #4 on: September 07, 2020, 10:29:11 AM »


I save the local variables in my FSM and then I load them again.  It works fine in the scene, but once I restart the scene it no longer remembers local variables, only Global Variables.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Cannot save local variables in FSM with EasySave
« Reply #5 on: September 07, 2020, 03:21:57 PM »
Hi.
Before loading you need to check if a save exists.

There are a few action to do that, 'Key Exists / File Exists / Es3 File Key Exists

if not exists do a save first (with some default data)

velketor

  • Junior Playmaker
  • **
  • Posts: 69
  • Multimedia Marathon Man
    • Shawn Kilian Portfolio
Re: Cannot save local variables in FSM with EasySave
« Reply #6 on: September 07, 2020, 03:56:41 PM »
I added the exists action as you suggested and it does find it but still fails to load the local variables in the fsm.  Globals still working fine.

velketor

  • Junior Playmaker
  • **
  • Posts: 69
  • Multimedia Marathon Man
    • Shawn Kilian Portfolio
Re: Cannot save local variables in FSM with EasySave
« Reply #7 on: September 07, 2020, 04:12:47 PM »
I also noticed that Action Get fsm Variables cannot see local variables from another FSM either.

However, Get Fsm Int, Get Fsm String, Get Fsm Bool, etc all can see local variables from another FSM.  This seems to be a bug with PlayMaker calling local variables from another FSM unless you specifically pull in 1 value at a time.