DeleteKey is not working

Discussion and help for Easy Save 3
Post Reply
hgulgen
Posts: 7
Joined: Tue Mar 26, 2019 5:34 pm

DeleteKey is not working

Post by hgulgen »

Hi, Deletekey is not working as expected and documentation is not clear to understand for me. Can you give me an example ?
I tried these. I just want to delete some keys from SaveFile01.txt. I have not success yet.

Code: Select all

        if (ES3.FileExists("SaveFile01.txt")) //Not Worked
        {
            ES3.DeleteKey("_RobotSpeed", "SaveFile01.txt");
            ES3.DeleteKey("_RobotSpeedIndex", "SaveFile01.txt");
            ES3.DeleteKey("_RobotWeightLimit", "SaveFile01.txt");
            ES3.DeleteKey("_RobotWeightIndex", "SaveFile01.txt");
            ES3.DeleteKey("_CurrentServiceRobotNumber", "SaveFile01.txt");
        }
        

        if (ES3.FileExists("SaveFile01.txt")) //Not Worked
        {
            var es3File = new ES3File("SaveFile01.txt");

            es3File.DeleteKey("_RobotSpeed");
            es3File.DeleteKey("_RobotSpeedIndex");
            es3File.DeleteKey("_RobotWeightLimit");
            es3File.DeleteKey("_RobotWeightIndex");
            es3File.DeleteKey("_CurrentServiceRobotNumber");
            es3File.Sync();         

        }

        if (ES3.FileExists("SaveFile01.txt")) //Not Worked
        {
            ES3.DeleteFile("_RobotSpeed");
            ES3.DeleteFile("_RobotSpeedIndex");
            ES3.DeleteFile("_RobotWeightLimit");
            ES3.DeleteFile("_RobotWeightIndex");
            ES3.DeleteFile("_CurrentServiceRobotNumber");
            
        }
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: DeleteKey is not working

Post by Joel »

Hi there,

I’ve tried your first attempt and it appears to be working fine at my end, and we’ve had no other reports of ES3.DeleteKey not working.

Please could you replicate your issue in a new project with a simple scene and private message it to me with instructions so I can see what is happening.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
hgulgen
Posts: 7
Joined: Tue Mar 26, 2019 5:34 pm

Re: DeleteKey is not working

Post by hgulgen »

Hi, Thanks for quick reply. I just created new project and It worked in there. I could not find any solution in my project. Is there any advice to find this problem in my project ?
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: DeleteKey is not working

Post by Joel »

Hi there,

Have you changed any of the settings in Tools > Easy Save 3 > Settings? If so, would you be able to take a screenshot of your settings so I can see what they are.

I would also recommend putting Debug.Log calls inside your braces to ensure that the ES3.FileExists line is being called.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
hgulgen
Posts: 7
Joined: Tue Mar 26, 2019 5:34 pm

Re: DeleteKey is not working

Post by hgulgen »

Hi, Thanks for reply. I solved the problem. Problem was about me. Save the game with OnApplicationPause event then override and create data again. Terrible mistake. :roll: :oops:
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: DeleteKey is not working

Post by Joel »

Glad you managed to find the solution, 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