Cannot load cached file with custom path.

Discussion and help for Easy Save 3
Post Reply
Arde
Posts: 4
Joined: Tue Jan 16, 2024 7:29 am

Cannot load cached file with custom path.

Post by Arde »

Sorry to bother again but I cannot get loading to work with custom path. Everything works with default settings but with custom path i can see the file being saved and its size to change but loading doesn't work.

These work

Code: Select all

ES3.CacheFile();
          	settings = new ES3Settings(ES3.Location.Cache); 
          	 if (ES3.KeyExists(ItemTypes[whichItemType].name + "inventory"))
       		 {
            	List<InventoryItem> listFromSave = ES3.Load(ItemTypes[whichItemType].name + "inventory",  emptyList,settings);
            	List<InventoryItem> changedList = SetPhysicalWeaponsInListAndReturn(ItemTypes[whichItemType].name,listFromSave);         
            	return changedList;
        	}
        	
        	ES3.StoreCachedFile();
These doesn't and are the current settings

Code: Select all

	ES3.CacheFile($"{Application.persistentDataPath}/{SaveProfileEtcControl.CurrentSaveProfFolder}/SaveFile.es3");
          	settings = new ES3Settings($"{Application.persistentDataPath}/{SaveProfileEtcControl.CurrentSaveProfFolder}/SaveFile.es3", 		ES3.Location.Cache); 
          	 if (ES3.KeyExists(ItemTypes[whichItemType].name + "inventory"))
       		 {
            	List<InventoryItem> listFromSave = ES3.Load(ItemTypes[whichItemType].name + "inventory",  emptyList,settings);
            	List<InventoryItem> changedList = SetPhysicalWeaponsInListAndReturn(ItemTypes[whichItemType].name,listFromSave);         
            	return changedList;
        	}
        	
        	ES3.StoreCachedFile($"{Application.persistentDataPath}/{SaveProfileEtcControl.CurrentSaveProfFolder}/SaveFile.es3");
          	
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Cannot load cached file with custom path.

Post by Joel »

There's an error in your code. Your ES3.KeyExists call is checking for the key in the default file, not your custom file.
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Arde
Posts: 4
Joined: Tue Jan 16, 2024 7:29 am

Re: Cannot load cached file with custom path.

Post by Arde »

Oh, didn't realize it also needed path.
Thank you!
Post Reply