Es3.Load<string> exception
Posted: Mon Jan 15, 2024 10:18 pm
I have no issues using the ES3.Load for a number of different data types however, when I try and use it to load in a string that was saved, I get an exception. It appears it is trying to use the Key as the filename for some reason.
If I check to see if the key exists and then load it, it succeeds. However if I call Load<string> with a default string, it gets an exception and when I trace into the ode it is trying to open a save file with the name of the strings key. So if I call the string "test" it would try and open a save file named test.
Here is an example showing how it works and how it fails:
From the documentation, it seems I am calling the Load<string> correctly. So what am I doing wrong?
If I check to see if the key exists and then load it, it succeeds. However if I call Load<string> with a default string, it gets an exception and when I trace into the ode it is trying to open a save file with the name of the strings key. So if I call the string "test" it would try and open a save file named test.
Here is an example showing how it works and how it fails:
Code: Select all
string SupportGUID = "";
// this works
if (ES3.KeyExists("SupportGUID"))
{
SupportGUID = ES3.Load<string>("SupportGUID");
}
// This fails with an exception because it tries to open a save file named "SupportGUID"
SupportGUID = ES3.Load<string>("SupportGUID", "");