I had scene switching set up properly and after that started working on making sure that everything that needed to be saved (animations, visibility, hotspots, etc) was saved properly. Now when I go from scene 1 to scene 2 it works (scene 2 has no saving scripts yet) but when I come back to scene 1 I get an error (posted on the bottom of this message) and the game just puts the player at the 0,0,0 position instead of any player start which keeps the camera from fading in. I am no programmer so I can't make anything out of this error. Hope somebody here can tell me what's going on. In the meantime I will start evaluating all the added save components starting with the 'remember animator' ones.
Error Message:
InvalidOperationException: <VisibilityData xmlns=''> was not expected
System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadRoot (System.Xml.Serialization.XmlTypeMapping rootMap)
System.Xml.Serialization.XmlSerializationReaderInterpreter.ReadRoot ()
System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.Serialization.XmlSerializationReader reader)
Rethrow as InvalidOperationException: There is an error in XML document.
System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.Serialization.XmlSerializationReader reader)
System.Xml.Serialization.XmlSerializer.Deserialize (System.Xml.XmlReader xmlReader)
System.Xml.Serialization.XmlSerializer.Deserialize (System.IO.Stream stream)
AC.Serializer.DeserializeObjectXML[AnimatorData] (System.String pXmlizedString) (at Assets/AdventureCreator/Scripts/Save system/Serializer.cs:354)
AC.Serializer.DeserializeObject[AnimatorData] (System.String dataString) (at Assets/AdventureCreator/Scripts/Save system/Serializer.cs:234)
AC.Serializer.LoadScriptData[AnimatorData] (System.String dataString) (at Assets/AdventureCreator/Scripts/Save system/Serializer.cs:665)
AC.RememberAnimator.LoadData (System.String stringData) (at Assets/AdventureCreator/Scripts/Save system/RememberAnimator.cs:56)
AC.ConstantID.LoadData (System.String stringData, Boolean restoringSaveFile) (at Assets/AdventureCreator/Scripts/Save system/ConstantID.cs:75)
AC.LevelStorage.SendDataToScene (AC.SingleLevelData levelData, Boolean restoringSaveFile, AC.SubScene subScene) (at Assets/AdventureCreator/Scripts/Save system/LevelStorage.cs:136)
AC.LevelStorage.ReturnCurrentLevelData (Boolean restoringSaveFile) (at Assets/AdventureCreator/Scripts/Save system/LevelStorage.cs:77)
AC.SceneSettings.OnStart () (at Assets/AdventureCreator/Scripts/Game engine/SceneSettings.cs:107)
AC.MultiSceneChecker.Start () (at Assets/AdventureCreator/Scripts/Game engine/MultiSceneChecker.cs:72)
Comments
If need be, you could animate the visibility of the object within the Animator as well, but there shouldn't generally be an issue with having two Remember components on the same object.
What version are you using, and what platform are you building to?
Open Serializer.cs, and replace the function DeserializeObjectXML with the following:
private static object DeserializeObjectXML <T> (string pXmlizedString)
{
XmlSerializer xs = new XmlSerializer (typeof (T));
MemoryStream memoryStream = new MemoryStream (StringToUTF8ByteArray (pXmlizedString));
try
{
object deserializedObject = xs.Deserialize (memoryStream);
if (deserializedObject is T)
{
return (T) deserializedObject;
}
}
catch {}
return null;
}
That fixes it on my end. How about you?