Hi,
After updating to AC 1.81.2 I get the following (long) error when attempting to load an existing save (A save made in AC 1.80):
I have an "OnBeforeLoading" Action list that pauses gameplay and fades the camera. This action lists runs to its end (=disappears from AC status box) and then nothing happens. The game stays paused with the faded screen.
What could be the issue of this?
// Magnus
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Some more info on the above. I get the same error when trying to do a save.
The error also happens when going to "SettingsManager" -> "Manage save-game files"-> choosing one of the save-game files.
It may be unrelated, but I also get this this message when starting unity:
https://imgur.com/a/DW6FJpf
I thought it could be corrupt save files, so I tried deleting the save files from Explorer and do a fresh save in the empty slot, but the error happened again.
// Magnus
It may be that a couple of factors are at play.
Firstly, in reference the error reported, open up AC's AttachmentPoint script and add the following inside the class (e.g. around line 37):
In relation to viewing the Save File Manager: are any saves listed that were made before v1.80?
v1.80 introduced the AC.asmdef file in the Scripts folder - an important addition, but one that will invalidate save-games made before it. The "Upgrade notes" section of the Changelog file makes mention of this.
This looks related to the Events Editor. Unfortunately, the AC.asmdef file also invalidates previously-defined Events, so you'd need to rebuild your "Scene: Switch" event to remove this error.
Thanks.
The error:
I added the code but no difference in loading nor saving. Yes, I saw the upgrade note on saves and was fairly sure that I did the saves in v1.80, but I could be mistaken and that they were made before. In either case, I should still be able to save to empty/old-save slots? I don't mind losing the saves so should I delete them maually in Explorer?
Events editor error:
Got it. Thanks. Will rebuild the events.
You can delete unwanted saves within the Save File Manager, but indeed - new save files should work.
What's the exact error message that appears when attempting new saves, having made the addition to the AttachmentPoint script?
It may be that the broken Event is a factor here - try rebuilding it first.
I rebuilt the Events and the SettingsManager error seems to be gone.
The full error message is too long for one post so will split it in two.
(What is the Markdown markup to make a long text like this look good?)
InvalidOperationException: AC.AttachmentPointData cannot be serialized because it does not have a parameterless constructor.
Rethrow as InvalidOperationException: Cannot serialize member 'AC.PlayerData.attachmentPointDatas' of type 'AC.AttachmentPointData[]', see inner exception for more details.
System.Xml.Serialization.StructModel.CheckSupportedMember (System.Xml.Serialization.TypeDesc typeDesc, System.Reflection.MemberInfo member, System.Type type) (at <06d4f84f93654a40b99ad3980ea716bc>:0)
System.Xml.Serialization.StructModel.CheckSupportedMember (System.Xml.Serialization.TypeDesc typeDesc, System.Reflection.MemberInfo member, System.Type type) (at <06d4f84f93654a40b99ad3980ea716bc>:0)
System.Xml.Serialization.StructModel.GetFieldModel (System.Reflection.FieldInfo fieldInfo) (at <06d4f84f93654a40b99ad3980ea716bc>:0)
System.Xml.Serialization.StructModel.GetFieldModel (System.Reflection.MemberInfo memberInfo) (at <06d4f84f93654a40b99ad3980ea716bc>:0)
System.Xml.Serialization.XmlReflectionImporter.InitializeStructMembers (System.Xml.Serialization.StructMapping mapping, System.Xml.Serialization.StructModel model, System.Boolean openModel, System.String typeName, System.Xml.Serialization.RecursionLimiter limiter) (at <06d4f84f93654a40b99ad3980ea716bc>:0)
System.Xml.Serialization.XmlReflectionImporter.ImportStructLikeMapping (System.Xml.Serialization.StructModel model, System.String ns, System.Boolean openModel, System.Xml.Serialization.XmlAttributes a, System.Xml.Serialization.RecursionLimiter limiter) (at <06d4f84f93654a40b99ad3980ea716bc>:0)
System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeModel model, System.String ns, System.Xml.Serialization.XmlReflectionImporter+ImportContext context, System.String dataType, System.Xml.Serialization.XmlAttributes a, System.Boolean repeats, System.Boolean openModel, System.Xml.Serialization.RecursionLimiter limiter) (at <06d4f84f93654a40b99ad3980ea716bc>:0)
Rethrow as InvalidOperationException: There was an error reflecting type 'AC.PlayerData'.
System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeModel model, System.String ns, System.Xml.Serialization.XmlReflectionImporter+ImportContext context, System.String dataType, System.Xml.Serialization.XmlAttributes a, System.Boolean repeats, System.Boolean openModel, System.Xml.Serialization.RecursionLimiter limiter) (at <06d4f84f93654a40b99ad3980ea716bc>:0)
System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeModel model, System.String ns, System.Xml.Serialization.XmlReflectionImporter+ImportContext context, System.String dataType, System.Xml.Serialization.XmlAttributes a, System.Xml.Serialization.RecursionLimiter limiter) (at <06d4f84f93654a40b99ad3980ea716bc>:0)
System.Xml.Serialization.XmlReflectionImporter.CreateArrayElementsFromAttributes (System.Xml.Serialization.ArrayMapping arrayMapping, System.Xml.Serialization.XmlArrayItemAttributes attributes, System.Type arrayElementType, System.String arrayElementNs, System.Xml.Serialization.RecursionLimiter limiter) (at <06d4f84f93654a40b99ad3980ea716bc>:0)
System.Xml.Serialization.XmlReflectionImporter.ImportArrayLikeMapping (System.Xml.Serialization.ArrayModel model, System.String ns, System.Xml.Serialization.RecursionLimiter limiter) (at <06d4f84f93654a40b99ad3980ea716bc>:0)
System.Xml.Serialization.XmlReflectionImporter.ImportAccessorMapping (System.Xml.Serialization.MemberMapping accessor, System.Xml.Serialization.FieldModel model, System.Xml.Serialization.XmlAttributes a, System.String ns, System.Type choiceIdentifierType, System.Boolean rpc, System.Boolean openModel, System.Xml.Serialization.RecursionLimiter limiter) (at <06d4f84f93654a40b99ad3980ea716bc>:0)
System.Xml.Serialization.XmlReflectionImporter.ImportFieldMapping (System.Xml.Serialization.StructModel parent, System.Xml.Serialization.FieldModel model, System.Xml.Serialization.XmlAttributes a, System.String ns, System.Xml.Serialization.RecursionLimiter limiter) (at <06d4f84f93654a40b99ad3980ea716bc>:0)
System.Xml.Serialization.XmlReflectionImporter.InitializeStructMembers (System.Xml.Serialization.StructMapping mapping, System.Xml.Serialization.StructModel model, System.Boolean openModel, System.String typeName, System.Xml.Serialization.RecursionLimiter limiter) (at <06d4f84f93654a40b99ad3980ea716bc>:0)
2nd part of the error:
System.Xml.Serialization.XmlReflectionImporter.InitializeStructMembers (System.Xml.Serialization.StructMapping mapping, System.Xml.Serialization.StructModel model, System.Boolean openModel, System.String typeName, System.Xml.Serialization.RecursionLimiter limiter) (at <06d4f84f93654a40b99ad3980ea716bc>:0)
Rethrow as InvalidOperationException: There was an error reflecting field 'playerData'.
System.Xml.Serialization.XmlReflectionImporter.InitializeStructMembers (System.Xml.Serialization.StructMapping mapping, System.Xml.Serialization.StructModel model, System.Boolean openModel, System.String typeName, System.Xml.Serialization.RecursionLimiter limiter) (at <06d4f84f93654a40b99ad3980ea716bc>:0)
System.Xml.Serialization.XmlReflectionImporter.ImportStructLikeMapping (System.Xml.Serialization.StructModel model, System.String ns, System.Boolean openModel, System.Xml.Serialization.XmlAttributes a, System.Xml.Serialization.RecursionLimiter limiter) (at <06d4f84f93654a40b99ad3980ea716bc>:0)
System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeModel model, System.String ns, System.Xml.Serialization.XmlReflectionImporter+ImportContext context, System.String dataType, System.Xml.Serialization.XmlAttributes a, System.Boolean repeats, System.Boolean openModel, System.Xml.Serialization.RecursionLimiter limiter) (at <06d4f84f93654a40b99ad3980ea716bc>:0)
Rethrow as InvalidOperationException: There was an error reflecting type 'AC.SaveData'.
System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeModel model, System.String ns, System.Xml.Serialization.XmlReflectionImporter+ImportContext context, System.String dataType, System.Xml.Serialization.XmlAttributes a, System.Boolean repeats, System.Boolean openModel, System.Xml.Serialization.RecursionLimiter limiter) (at <06d4f84f93654a40b99ad3980ea716bc>:0)
System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeModel model, System.String ns, System.Xml.Serialization.XmlReflectionImporter+ImportContext context, System.String dataType, System.Xml.Serialization.XmlAttributes a, System.Xml.Serialization.RecursionLimiter limiter) (at <06d4f84f93654a40b99ad3980ea716bc>:0)
System.Xml.Serialization.XmlReflectionImporter.ImportElement (System.Xml.Serialization.TypeModel model, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace, System.Xml.Serialization.RecursionLimiter limiter) (at <06d4f84f93654a40b99ad3980ea716bc>:0)
System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Type type, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) (at <06d4f84f93654a40b99ad3980ea716bc>:0)
System.Xml.Serialization.XmlSerializer..ctor (System.Type type, System.String defaultNamespace) (at <06d4f84f93654a40b99ad3980ea716bc>:0)
System.Xml.Serialization.XmlSerializer..ctor (System.Type type) (at <06d4f84f93654a40b99ad3980ea716bc>:0)
AC.FileFormatHandler_Xml.SerializeObject[T] (System.Object dataObject) (at Assets/AdventureCreator/Scripts/Save system/FileFormat/FileFormatHandler_Xml.cs:29)
AC.Serializer.SerializeObject[T] (System.Object dataObject, System.Boolean addMethodName, AC.iFileFormatHandler fileFormatHandler) (at Assets/AdventureCreator/Scripts/Save system/Serializer.cs:153)
AC.SaveOperation.SendSaveToFile () (at Assets/AdventureCreator/Scripts/Save system/SaveOperation.cs:151)
AC.SaveOperation.BeginOperation (AC.SaveData& saveData, AC.SaveFile saveFile) (at Assets/AdventureCreator/Scripts/Save system/SaveOperation.cs:89)
AC.SaveSystem+d__61.MoveNext () (at Assets/AdventureCreator/Scripts/Save system/SaveSystem.cs:1076)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at :0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
Just to make sure, "rebuild events" means, delete all existing events and recreate them?
Open up the AttatchmentPoint script once more and add the following towards the bottom (inside the AttachmentPointData class):
The ActionLists that they run can be re-used, but the events listed in the Editor will have to be removed and rebuilt, yes.
Yes it works! Both Saving and loading without problem. Thanks a lot again!!
It seems I still have this error message when entering playmode, but it doesn7t seem to affect anything so I'll leave it.
Those look related to the Events - they should disappear once rebuilt.