FINDarkside / TLD-Save-Editor

Edit The Long Dark save files
http://www.moddb.com/mods/the-long-dark-save-editor-2/downloads
MIT License
77 stars 31 forks source link

Failed to Load Save #5

Closed dvdblueray closed 5 years ago

dvdblueray commented 5 years ago

Version 2.13.3 Error converting value "SprainPain" to type 'The_Long_Dark_Save_Editor_2.Game_data.AfflictionType'. Path 'm_LogDayInfoList[0].m_Afflictions[1]', line 1, position 219. Newtonsoft.Json.JsonSerializationException: Error converting value "SprainPain" to type 'The_Long_Dark_Save_Editor_2.Game_data.AfflictionType'. Path 'm_LogDayInfoList[0].m_Afflictions[1]', line 1, position 219. ---> System.ArgumentException: Requested value 'SprainPain' was not found. at System.Enum.EnumResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgument) at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult) at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType) --- End of inner exception stack trace --- at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings) at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value) at The_Long_Dark_Save_Editor_2.Helpers.Util.DeserializeObject[T](String json) at The_Long_Dark_Save_Editor_2.Game_data.GlobalSaveGameData..ctor(String data) at The_Long_Dark_Save_Editor_2.GameSave.LoadSave(String path) at The_Long_Dark_Save_Editor_2.MainWindow.CurrentSaveSelectionChanged(Object sender, SelectionChangedEventArgs e)

SteveS8 commented 5 years ago

The recent update obviously changed things

FINDarkside commented 5 years ago

Yeah, I'm not sure when I have time to try to fix these. The change to IL2CPP also makes developing this save editor a lot more time consuming.

vyrondrosos commented 5 years ago

Sorry for off topic, but I'm trying to manually edit my (latest version) savefile, specifically to disable passive wildlife (I'm using a custom difficulty). Is that a simple flag in the savefile, and if so, could you point me to it's location, or any way to find it? Thanks for your time

FINDarkside commented 5 years ago

Custom difficulty is stored here: GlobalData.cs, but it's base64 of the whole stuff. It's probably easiest to create new custom mode and take the custom mode string you want from it.

Not sure if you got to that point already, but this isn't something you can do with text editor, as the save file is composed of nested and compressed json strings stored as byte arrays. What's currently on master should work if you want to edit the custom mode string (if you can build it), but I haven't tested it.

vyrondrosos commented 5 years ago

Thanks a lot for the reply. I managed to build the project and run it successfully, and I can confirm that changing difficulty works. Other stats such as condition, inventory etc also seem to show correctly, although I didn't try modifying those.

One question, when choosing difficulty I was limited to the stock ones. There was a custom option, but when choosing it, no input prompt for the string appeared. Any ideas?

FINDarkside commented 5 years ago

Hi @vyrondrosos, fixed with 9cf035a1d8fdd04ac92999098a3c312f92499821

vyrondrosos commented 5 years ago

Tested it, works like a charm. Cheers

FINDarkside commented 5 years ago

This should be fixed with 2.14