Discussion and help for Easy Save 3
doodlinbee
Posts: 23 Joined: Sat Sep 05, 2020 12:53 pm
Post
by doodlinbee » Sat Sep 05, 2020 1:00 pm
Saving code :
Code: Select all
public void SaveSequentially(int slot)
{
using (ES3Writer writer = ES3Writer.Create(filePath: GetSaveName(slot), settings))
{
writer.Write(SceneManager.GetActiveScene().name);
writer.Write(true);
writer.Write(false);
}
}
The output :
Loading code :
Code: Select all
public void LoadSequentially(int slot)
{
using (ES3Reader reader = ES3Reader.Create(GetSaveName(slot), settings))
{
print(reader.Read<string>());
print(reader.Read<bool>());
print(reader.Read<bool>());
}
}
When loading, the first read string is ok, but the read bool is not ok. I've got the FormatException: String was not recognized as a valid Boolean
Any ideas ?
Last edited by
doodlinbee on Sat Sep 05, 2020 11:04 pm, edited 1 time in total.
Joel
Moodkie Staff
Posts: 4849 Joined: Wed Nov 07, 2012 10:32 pm
Post
by Joel » Sat Sep 05, 2020 6:30 pm
Hi there,
You should only use classes and methods which are documented here. As ES3Writer and ES3Reader are only used internally, they will not work as you expect.
In your case you should follow the instructions here if you want to improve performance:
https://docs.moodkie.com/easy-save-3/es ... rformance/
All the best,
Joel
doodlinbee
Posts: 23 Joined: Sat Sep 05, 2020 12:53 pm
Post
by doodlinbee » Sat Sep 05, 2020 8:02 pm
Hi there,
I don't quite understand the cache system. How to save values in it? Like how to do the equivalent of my OP with the cache?
(I'm looking for performance improvements because i have thousands of keys to store and doing the 'Getting started' way with "ES3.Save" took several minutes to save)
Joel
Moodkie Staff
Posts: 4849 Joined: Wed Nov 07, 2012 10:32 pm
Post
by Joel » Sat Sep 05, 2020 8:23 pm
Hi there,
The equivalent would be:
Code: Select all
var settings = new ES3Settings(ES3.Location.Cache);
ES3.Save("myKey1", SceneManager.GetActiveScene().name, GetSaveName(slot), settings);
ES3.Save("myKey2", true, GetSaveName(slot), settings);
ES3.Save("myKey3", false, GetSaveName(slot), settings);
ES3.StoreCachedFile(GetSaveName(slot));
All the best,
Joel
doodlinbee
Posts: 23 Joined: Sat Sep 05, 2020 12:53 pm
Post
by doodlinbee » Sat Sep 05, 2020 11:03 pm
Alright thanks for the help !