Saving and Loading not carrying over to next play.

Discussion and help for Easy Save 3
Amateur Programmer
Posts: 9
Joined: Thu Jul 02, 2020 4:37 am

Saving and Loading not carrying over to next play.

Post by Amateur Programmer »

I have spent 3 hours playing around with this as someone who's not a great programmer. Using example function and code from "Getting Started" Click play; click save (bound to Keycode.S); click load (bound to L); this loads integer; click stop in unity; click play; click load; does not load!

Please explain, thank you.
User avatar
Joel
Moodkie Staff
Posts: 4846
Joined: Wed Nov 07, 2012 10:32 pm

Re: Saving and Loading not carrying over to next play.

Post by Joel »

Hi there,

Please could you show me the code you are using so I can understand what is happening?

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Amateur Programmer
Posts: 9
Joined: Thu Jul 02, 2020 4:37 am

Re: Saving and Loading not carrying over to next play.

Post by Amateur Programmer »

Here you go, hopefully easiest enough to understand
Attachments
SandLTrial.cs
(621 Bytes) Downloaded 161 times
Amateur Programmer
Posts: 9
Joined: Thu Jul 02, 2020 4:37 am

Re: Saving and Loading not carrying over to next play.

Post by Amateur Programmer »

Apologies for putting this in ES2, this post should be in ES3. I also appreciate you looking at this. The script uses I to increment the int, D to log the int, S to save the int and L to load int. Other than that it uses the code from "Getting started".
User avatar
Joel
Moodkie Staff
Posts: 4846
Joined: Wed Nov 07, 2012 10:32 pm

Re: Saving and Loading not carrying over to next play.

Post by Joel »

Thanks for sending that over.

I've tried it at my end and it appears to work fine for me. Note that if you try to load data before you've saved anything, it will throw an error as you're not currently providing the defaultValue parameter. Note that these are the steps I took:
  1. Press 'Play'
  2. Press 'I' multiple times to increment myInt
  3. Press 'S' to save
  4. Press the Play button to stop playing
  5. Press the Play button again to start playing
  6. Press 'L' to load the data
  7. Press 'D' to output the loaded value
Have you changed anything in the Settings window at all? Would you be able to show me a screenshot of Window > Easy Save 3 > Settings?

I also recommend putting Debug.Log calls immediately before your ES3 calls to ensure that they're actually being called.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Amateur Programmer
Posts: 9
Joined: Thu Jul 02, 2020 4:37 am

Re: Saving and Loading not carrying over to next play.

Post by Amateur Programmer »

I think my problems could be solved if I knew where a step by step guide was to setting up?
User avatar
Joel
Moodkie Staff
Posts: 4846
Joined: Wed Nov 07, 2012 10:32 pm

Re: Saving and Loading not carrying over to next play.

Post by Joel »

Hi there,

The Getting Started guide should be enough to get set up with Easy Save, and the code you're using is indeed correct and working at my end.

If the code you showed me isn't working for you then this indicates that there's an issue somewhere else in your project. Please could you send me a screenshot of your settings so I can see if that is the issue?

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Amateur Programmer
Posts: 9
Joined: Thu Jul 02, 2020 4:37 am

Re: Saving and Loading not carrying over to next play.

Post by Amateur Programmer »

Thank you Joel, I really appreciate the reply. The problem was just simply the default value. I don't understand the purpose of the default value, is there anywhere I can read about it? I just made my own variable called defaultvalue and ran it through, that worked fine but I don't know why it worked which worries me!

Thanks again, Cheers from Aus.
User avatar
Joel
Moodkie Staff
Posts: 4846
Joined: Wed Nov 07, 2012 10:32 pm

Re: Saving and Loading not carrying over to next play.

Post by Joel »

Hi there,

The default value is the value returned if no data exists. If you don't set a default value, an exception will be thrown if you try to load data which doesn't exist (i.e. data which hasn't been saved yet).

You can find out about the default value in the page for ES3.Load:
https://docs.moodkie.com/easy-save-3/es ... /es3-load/

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Amateur Programmer
Posts: 9
Joined: Thu Jul 02, 2020 4:37 am

Re: Saving and Loading not carrying over to next play.

Post by Amateur Programmer »

Hi Joel,
I appreciate you taking the time but Ive reached the point where I sadly will be applying for a refund, reviewing and just saving with my own scripts (Edit: if I cant get it working today, ive just spent too much time trying to figure it out). Its just not as described "Easy to save". If for some reason you can explain what Im doing wrong then I will be stoked. Please find attached code. I press play it saves and loads upon the next play. Doing it a third does not load the save anymore. Unity project then gets an asterix stuck next to it even when I hit File save for unity and then easy save no longer carries saves over to the next run until using a new key. Please see attached, again, thanks for taking the time out of your day to at least try to help. No scripts interfere with this script as im still just trying to figure out your software! At the end of the day what you have might be excellent but there is just no clear instructions on how to get it working, videos could be much easier than the getting started page, its just to simple with lack of direction imo from an amateur programmer pov (4 years ish). Hope this helps for helping others of my low level of understanding.
Kind Regards
Attachments
SandLTrial.cs
(697 Bytes) Downloaded 153 times
Post Reply