ES3.KeyExists syntax not working

Discussion and help for Easy Save 3
Post Reply
User avatar
scubotica
Posts: 1
Joined: Mon Jan 06, 2020 5:03 pm

ES3.KeyExists syntax not working

Post by scubotica »

Hello,
new to this forum :) First would like to thank you for this awesome asset!

I have a problem trying to use "ES3.KeyExists" method. Scenario:
1. I'm saving multiple files with all information I need -> this works fine.
2. Game is scalable, I would like to implement new features in the future updates, thus I will need to add new Keys in saving which are logically not exist from the beginning.
3. I tried to use KeyExists as following example (checking for a new Key in the existing file):

Code: Select all

if(ES3.KeyExists("myInt", "myDirectory/myFile.es3")) myInt = ES3.Load<int>("myInt", "myDirectory/myFile.es3");
but "KeyExists" method has no effect in my case for some reason?
I followed every tips in tutorials - still no luck.

Btw, to check for non-existing directory works fine:

Code: Select all

if(ES3.DirectoryExists("myDirectory/")) myKey = ES3.Load<int>("myInt", "myDirectory/myFile.es3");
What am I missing here? wrong syntax, something else?
User avatar
Joel
Moodkie Staff
Posts: 4848
Joined: Wed Nov 07, 2012 10:32 pm

Re: ES3.KeyExists syntax not working

Post by Joel »

Hi there,

Please could you show me the code you're using to save the data you're trying to check the existence of, and the save file itself? Hopefully I will be able to see what is happening.

I've tried to replicate it with this code and it appears to work fine at my end:
ES3.Save<int>("myInt", 123, "myDirectory/myFile.es3");
Debug.Log(ES3.KeyExists("myInt", "myDirectory/myFile.es3"));
All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply