playMaker

Author Topic: Easy Save 2 Load and Save Values  (Read 13554 times)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Easy Save 2 Load and Save Values
« on: May 31, 2013, 06:46:38 AM »
Hi,

 Following some work on ArrayMaker to support Easy Save 2, I made also two convenient actions that works with regular Fsm Variables and Easy Save.

Easy Save provides already custom actions to load and save variable, but it's one action per variable type, here, these actions works with FsmVar and lists, so you can add many variables or any types in one action.


Bye,

 Jean

jess84

  • Hero Member
  • *****
  • Posts: 515
Re: Easy Save 2 Load and Save Values
« Reply #1 on: March 08, 2014, 09:07:11 AM »
Those are great actions, very useful.

I was wondering whether you'd be able to make a modified version, if it's a quick task...

It would be handy to have just 1 action for both save and load, but with a dropdown to select between the functions.... so if I want to save 20 variables, I can do that, then copy&paste the action and just switch one dropdown to load all 20 - rather than having to readd them manually.

Would that be possible/easy?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Easy Save 2 Load and Save Values
« Reply #2 on: March 11, 2014, 07:23:42 AM »
Hi,

 Well, it goes a bit against the principle of clarity for actions, cause if an aciton can either get or set, load or save, then it will be difficult at time to debug or clearly understand what is currently at stake. I would consider other approaches like using arrayMaker to load save an entire array or hashtable of data, that would be the solution I would push forward for this.

also, another approach is to go more object oriented. What are these values you want to save, can you give us a sample of what they are?

bye,

 Jean

craigz

  • Beta Group
  • Full Member
  • *
  • Posts: 234
    • Haven Made
Re: Easy Save 2 Load and Save Values
« Reply #3 on: October 12, 2016, 01:21:23 AM »
Hi Jean!

Sorry for the necro, but these actions were exactly what I've been looking for! (to replace my stacks of loading variables... xD)

Unfortunately they seem to have issues when loading and saving float values. (so far)

It saves out all the tags with "/' in front of them, *edit: even with variables set to none.

Getting an EndOfStreamException error. Any thoughts?

No doubt there's been multiple ES2 updates since this original post...

Code: [Select]
EndOfStreamException: Failed to read past end of stream.
System.IO.BinaryReader.FillBuffer (Int32 numBytes) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/BinaryReader.cs:119)
System.IO.BinaryReader.ReadSingle () (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/BinaryReader.cs:506)
ES2_float.Read (.ES2Reader reader)
ES2Reader.Read[Single] (.ES2Type es2type)
ES2Reader.Read[Single] (System.String tag)
ES2.Load[Single] (System.String identifier)
HutongGames.PlayMaker.Actions.ES2LoadValue.OnEnter () (at Assets/PlayMaker Custom Actions/ES2LoadValue.cs:72)
HutongGames.PlayMaker.FsmState.ActivateActions (Int32 startIndex) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:201)
HutongGames.PlayMaker.FsmState.OnEnter () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:169)
HutongGames.PlayMaker.Fsm.EnterState (HutongGames.PlayMaker.FsmState state) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2603)
HutongGames.PlayMaker.Fsm.SwitchState (HutongGames.PlayMaker.FsmState toState) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2561)
HutongGames.PlayMaker.Fsm.UpdateStateChanges () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2489)
HutongGames.PlayMaker.Fsm.Start () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:1796)
PlayMakerFSM.Start () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:470)

Hope to hear back soon!

Thanks Jean! :D
« Last Edit: October 12, 2016, 01:33:37 AM by craigz »

craigz

  • Beta Group
  • Full Member
  • *
  • Posts: 234
    • Haven Made
Re: Easy Save 2 Load and Save Values
« Reply #4 on: October 18, 2016, 03:27:16 PM »
Wanted to bump this and see if anyone has any ideas? :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Easy Save 2 Load and Save Values
« Reply #5 on: October 19, 2016, 02:12:45 AM »
Hi,

  I'll have a look, thanks for the bump, I need this ( almost four browser windows with filled up with tabs of pending threads... :) )

 Bye,

 Jean

craigz

  • Beta Group
  • Full Member
  • *
  • Posts: 234
    • Haven Made
Re: Easy Save 2 Load and Save Values
« Reply #6 on: October 19, 2016, 05:09:54 PM »
Oh gosh! Jean you're crazy! :D

I hope you're working with like 4 monitors :P

But really, thank you! It means a lot to me :) after finding the action I resetup everything then found out it was broken. Foolish me :)

So just hoping to swap it over soon, I realize why you made it... all these stacks of saving variables is super crazy ><

Thanks Jean! :D

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Easy Save 2 Load and Save Values
« Reply #7 on: October 20, 2016, 02:18:15 AM »
Hi,

 odd. I tested with the latest easySave from the asset store and it works properly.

 can you try on a fresh project? maybe it's the txt file that is corrupted. Have you contacted the author? maybe he'll hint us on the possible issue with such error?

Bye,

 Jean

craigz

  • Beta Group
  • Full Member
  • *
  • Posts: 234
    • Haven Made
Re: Easy Save 2 Load and Save Values
« Reply #8 on: October 20, 2016, 05:55:29 PM »
Hi Jean,

I loaded it into a fresh project and am indeed am getting no errors! You're spot on, just needed to clear the folder data :)

But, the addition of "/" before all the tags is still present. So this is probably where I've been having an issue, because when trying to load the values separately or independently using the default actions I do get the "does not exist errors" (as expected) xD

Is there a way to make the tag values that get saved not have the "/" prefix before them when saving with these actions? So that when loading them separately using the singular action I wouldnt have to put a "/" before everything? :)

Action Cap


FileValues Cap


Will get does not exist errors when called with other actions because of not manually adding "/" (as expected)


Thank you so much for the initial solve, just let me know about the prefix saving? :D I know it's kind of cosmetic fix, but but just confusing with being able to set prefix to none and still get one :P

You rock Jean! :D

-craigz
« Last Edit: October 20, 2016, 05:57:19 PM by craigz »

craigz

  • Beta Group
  • Full Member
  • *
  • Posts: 234
    • Haven Made
Re: Easy Save 2 Load and Save Values
« Reply #9 on: October 26, 2016, 01:30:07 PM »
bump bump!  ;D

craigz

  • Beta Group
  • Full Member
  • *
  • Posts: 234
    • Haven Made
Re: Easy Save 2 Load and Save Values
« Reply #10 on: November 02, 2016, 01:04:37 AM »
sorry to bump! but here's a bump! :D

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Easy Save 2 Load and Save Values
« Reply #11 on: November 02, 2016, 05:53:41 AM »
Hi,

 ok, sorry for the delay.

 can you download it back from the Ecosystem, it should now be corrected.

 Bye,

 Jean

craigz

  • Beta Group
  • Full Member
  • *
  • Posts: 234
    • Haven Made
Re: Easy Save 2 Load and Save Values
« Reply #12 on: November 03, 2016, 11:27:22 PM »
No worries for the delay, you're a popular man! :D

Any particular search terms under Ecosystem to find it? I can't seem to get it by name or with any ES2 tags.. :-[

super pumped!

craigz

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Easy Save 2 Load and Save Values
« Reply #13 on: November 04, 2016, 04:23:44 AM »
Hi,

 It's easy save:



Bye,

 Jean

craigz

  • Beta Group
  • Full Member
  • *
  • Posts: 234
    • Haven Made
Re: Easy Save 2 Load and Save Values
« Reply #14 on: November 06, 2016, 01:15:00 AM »
Hi Jean!

I've found and downloaded it.

Looks like the version on ecosystem is still saving with the "/" beforehand xD



I went ahead and fixed it locally just deleting the "/" at line 71, huzzah! :D

But just wanted to let you know the version on ecosystem is still off xD

As an aside... here's a glorious avatar gif for you for being so cool! :D



best,

craigz