bsimser / Inventory-Pro

https://devdog.io
MIT License
2 stars 0 forks source link

Easy Save 2 Error #136

Closed bsimser closed 8 years ago

bsimser commented 8 years ago

Original report by Vaibhav Nair (Bitbucket: Warbard, ).


Hello,

I am using the Stats health bar from Inventory pro, Item Property editor. In the Canvas on Health bar I have attached "EasySave2CollectionSaverLoader" script, for saving purpose using EasySave2.

Now given below error's are showing in the Console;

---------------------------------------Error1 ES2InvalidDataException: Easy Save 2 Error: The file provided does not contain data that is readable by Easy Save. Please make sure that file was created by Easy Save. ES2Reader.Next () ES2Reader.ScanToTag (System.String tag) ES2Reader.ProcessHeader (Key expectedCollectionType, .ES2Type expectedValue, .ES2Type expectedKey, System.String tag) ES2Reader.Read[ItemCollectionSerializationModel] (System.String tag) Devdog.InventorySystem.Integration.EasySave2.EasySave2CollectionSaverLoader.LoadItems (System.Action1 callback) (at Assets/InventorySystem/Scripts/Integration/EasySave2/EasySave2CollectionSaverLoader.cs:47) Devdog.InventorySystem.CollectionSaverLoaderBase.Awake () (at Assets/InventorySystem/Scripts/Modules/Serialization/CollectionSaverLoaderBase.cs:41) ------------------------------------------------------Error 2 ES2InvalidDataException: Easy Save 2 Error: The file provided does not contain data that is readable by Easy Save. Please make sure that file was created by Easy Save. ES2Reader.Next () ES2Reader.DeleteTags (ICollection1 tags, .ES2Writer writer) ES2Writer.Delete () ES2Writer.Save (Boolean checkForOverwrite) ES2Writer.Save () Devdog.InventorySystem.Integration.EasySave2.EasySave2CollectionSaverLoader.SaveItems (System.Object serializedData, System.Action`1 callback) (at Assets/InventorySystem/Scripts/Integration/EasySave2/EasySave2CollectionSaverLoader.cs:31) Devdog.InventorySystem.CollectionSaverLoaderBase.OnApplicationQuit () (at Assets/InventorySystem/Scripts/Modules/Serialization/CollectionSaverLoaderBase.cs:66)

bsimser commented 8 years ago

Original comment by Joris Huijbregts (Bitbucket: jjahuijbregts, ).


You attached the EasySave2CollectionSaverLoader to the healthbar? This isn't allowed, as the name implies EasySave2CollectionSaverLoader can only be used on collections (inventory, bank, etc)

Item containers can also be saved (lootables, treasure chests, vendors, anything that keeps items in an instance object).

Stats can't be saved at this point.

bsimser commented 8 years ago

Original comment by Vaibhav Nair (Bitbucket: Warbard, ).


Oh, Thank you for the information

bsimser commented 8 years ago

Original comment by Vaibhav Nair (Bitbucket: Warbard, ).


I have attached "EasySave2CollectionSaverLoader" script to Inventory and Character Window in Canvas, but it is showing the below error:

----------------Inventory ES2InvalidDataException: Easy Save 2 Error: The file provided does not contain data that is readable by Easy Save. Please make sure that file was created by Easy Save. ES2Reader.Next () ES2Reader.ScanToTag (System.String tag) ES2Reader.ProcessHeader (Key expectedCollectionType, .ES2Type expectedValue, .ES2Type expectedKey, System.String tag) ES2Reader.Read[ItemCollectionSerializationModel] (System.String tag) Devdog.InventorySystem.Integration.EasySave2.EasySave2CollectionSaverLoader.LoadItems (System.Action`1 callback) (at Assets/InventorySystem/Scripts/Integration/EasySave2/EasySave2CollectionSaverLoader.cs:47) Devdog.InventorySystem.CollectionSaverLoaderBase.Awake () (at Assets/InventorySystem/Scripts/Modules/Serialization/CollectionSaverLoaderBase.cs:41)

-----second error: ES2InvalidDataException: Easy Save 2 Error: The file provided does not contain data that is readable by Easy Save. Please make sure that file was created by Easy Save. ES2Reader.Next () ES2Reader.DeleteTags (ICollection1 tags, .ES2Writer writer) ES2Writer.Delete () ES2Writer.Save (Boolean checkForOverwrite) ES2Writer.Save () Devdog.InventorySystem.Integration.EasySave2.EasySave2CollectionSaverLoader.SaveItems (System.Object serializedData, System.Action1 callback) (at Assets/InventorySystem/Scripts/Integration/EasySave2/EasySave2CollectionSaverLoader.cs:31) Devdog.InventorySystem.CollectionSaverLoaderBase.OnApplicationQuit () (at Assets/InventorySystem/Scripts/Modules/Serialization/CollectionSaverLoaderBase.cs:66)

-----------------------------Character Window: ES2InvalidDataException: Easy Save 2 Error: The file provided does not contain data that is readable by Easy Save. Please make sure that file was created by Easy Save. ES2Reader.Next () ES2Reader.ScanToTag (System.String tag) ES2Reader.ProcessHeader (Key expectedCollectionType, .ES2Type expectedValue, .ES2Type expectedKey, System.String tag) ES2Reader.Read[ItemCollectionSerializationModel] (System.String tag) Devdog.InventorySystem.Integration.EasySave2.EasySave2CollectionSaverLoader.LoadItems (System.Action`1 callback) (at Assets/InventorySystem/Scripts/Integration/EasySave2/EasySave2CollectionSaverLoader.cs:47) Devdog.InventorySystem.CollectionSaverLoaderBase.Awake () (at Assets/InventorySystem/Scripts/Modules/Serialization/CollectionSaverLoaderBase.cs:41)

-----second error:

ES2InvalidDataException: Easy Save 2 Error: The file provided does not contain data that is readable by Easy Save. Please make sure that file was created by Easy Save. ES2Reader.Next () ES2Reader.DeleteTags (ICollection1 tags, .ES2Writer writer) ES2Writer.Delete () ES2Writer.Save (Boolean checkForOverwrite) ES2Writer.Save () Devdog.InventorySystem.Integration.EasySave2.EasySave2CollectionSaverLoader.SaveItems (System.Object serializedData, System.Action1 callback) (at Assets/InventorySystem/Scripts/Integration/EasySave2/EasySave2CollectionSaverLoader.cs:31) Devdog.InventorySystem.CollectionSaverLoaderBase.OnApplicationQuit () (at Assets/InventorySystem/Scripts/Modules/Serialization/CollectionSaverLoaderBase.cs:66)

bsimser commented 8 years ago

Original comment by Joris Huijbregts (Bitbucket: jjahuijbregts, ).


This is most likely caused by the fact that it was previously on the stats, which saved a file to EasySave, and it's now trying to load faulty data that it can't interpret. To clear the old save preferences you can go to Assets/EasySave2/Settings/Clear default save folder.

bsimser commented 8 years ago

Original comment by Vaibhav Nair (Bitbucket: Warbard, ).


Thank you for the information. I have cleared the old save preferences, but still Items are not getting saved...

After clearing Default saved folder: when i stat the game it is showing this message 2 times "Can't load from file myFile.txt file does not exist" in Console.

when i stop the game the given below errors are showing: Error1: Easy Save does not support saving of this type. For more information on supported types, and how to add support for your own types...

Error2: Easy Save does not support saving of type Devdog.InventorySystem.Models.ItemCollectionSerializationModel.

Error3: Easy Save does not support saving of this type. For more information on supported types, and how to add support for your own types...

Error4: Easy Save does not support saving of type Devdog.InventorySystem.Models.ItemCollectionSerializationModel...

Error5: ES2InvalidDataException: Easy Save 2 Error: The file provided does not contain data that is readable by Easy Save...

Info in Console: Saved collection CharacterCollection UnityEngine.Debug:Log(Object)...

bsimser commented 8 years ago

Original comment by Joris Huijbregts (Bitbucket: jjahuijbregts, ).


Did you follow the setup guide? ( http://devdog.nl/documentation/easy-save-2/ )

bsimser commented 8 years ago

Original comment by Vaibhav Nair (Bitbucket: Warbard, ).


Thank you for your support... It is working now. the issue was in ES2Init.cs script, the 2 lines of code was not in the script. i believe I did not save the script properly. but the Inventory is working now.

bsimser commented 8 years ago

Original comment by Vaibhav Nair (Bitbucket: Warbard, ).


Resolve thanks to Joris Huijbregts

bsimser commented 6 years ago

Original comment by Joris Huijbregts (Bitbucket: jjahuijbregts, ).


Removing milestone: v3 (automated comment)

bsimser commented 6 years ago

Original comment by Joris Huijbregts (Bitbucket: jjahuijbregts, ).


Removing version: V2.2.1 (automated comment)