Manual save of float doesn't work

Discussion and help for Easy Save 3
Post Reply
apehead
Posts: 3
Joined: Thu Dec 01, 2022 3:57 pm

Manual save of float doesn't work

Post by apehead »

Hi,

I'm trying to store and load a simple float for my project:

Code: Select all

ES3.Save("time.es3", timeManager.GetActualTime());

Code: Select all

float time = ES3.Load<float>("time.es3", 0f);
But unfortunately nothing happens. I configured the Location to be "file" and the directory to be "Persistant Data Path", but I don't see the file time.es3 created in that directory. There also is no error message, it just doesn't seem to do anything.

What may be the problem here?

Cheers!
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Manual save of float doesn't work

Post by Joel »

Hi there,

You have the parameters wrong. The first parameter is the key, the second parameter the value you’re saving (or the defaultValue in the case of ES3.Load), and the third parameter the filename.

See the API reference for more info:

https://docs.moodkie.com/easy-save-3/es3-api/es3-class/

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
apehead
Posts: 3
Joined: Thu Dec 01, 2022 3:57 pm

Re: Manual save of float doesn't work

Post by apehead »

Hi Joel,

I'm sorry but after reading in the API I don't really get why my code shouldn't work. Here it states that the filePath is optional. So where is the data saved when I omit the file path?

As I understand it my code:

Code: Select all

ES3.Save("time.es3", timeManager.GetActualTime());
should store the float returned by GetActualTime under the key "time.es3" (I just changed it to just "time" but it won't work either). Or did I misunderstood something? Without a file path is the data saved in the same file as the autosave values?

Cheers!
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Manual save of float doesn't work

Post by Joel »

Hi there,

Your code should technically work, but it won't create a file named time.es3. It will save it as a key named time.es3 in the default save file (usually SaveFile.es3) in the persistent data path (which you can open by going to Tools > Easy Save 3 > Open Persistent Data Path).

If this isn't happening for you, please could you create a new script which I can drop into a new scene of a new project which replicates your issue so I can see what is happening, as I've had no other reports of this and it appears to work fine for me.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
apehead
Posts: 3
Joined: Thu Dec 01, 2022 3:57 pm

Re: Manual save of float doesn't work

Post by apehead »

Hi,

it was a totally unrelated problem. Thanks for the help! :)

Cheers.
Last edited by apehead on Fri Dec 02, 2022 2:04 pm, edited 1 time in total.
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Manual save of float doesn't work

Post by Joel »

Glad you managed to solve it, let me know if you run into any other issues :)

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply