Forum rules - please read before posting.

Playing around with Options and PlayerPrefs totally broke AC - Help!

edited February 2015 in Technical Q&A
Hi there.

Today I totally broke AC. I played around with Saving and PlayerPrefs. I backed up my project before and then I changed a few things in Options.cs, OptionsData.cs and SettingsManager.cs and tried to add a "Scenario" options field. As expected it didn't work, so I reverted everything - BUT since then I get endless errors shown as soon I click the Settings Menu Tab of the AC Game Editor, the tab disappears and is unresponsive. It even seems to be broken when I load older versions of my game. 

So I totally removed Unity 4.6.2 from my PC (Win7 64 bit), cleaned all Unity and Monobehavior related stuff in several /AppData etc. places, restarted the computer, installed Unity new, downloaded and imported AC 1.42c and started a new AC project. With exactly the same results. Everything is broken as soon I click the "settings" menu tab - even with a completely fresh project. 

I'm a bit desperate now, because it blocks me from working. I'm no programmer and only know the absolute unity basics. Does anyone have an idea how I can fix this?? 

Thank you soooo much!!

edit: I just started my project on another pc, and there everything seems to run fine. So something definitely got messed up on my PC here, but I have no idea what :(
SerializationException: Field "Scenario" not found in class OptionsData
System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadTypeMetadata (System.IO.BinaryReader reader, Boolean isRuntimeObject, Boolean hasTypeInfo) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs:691)
System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadObjectInstance (System.IO.BinaryReader reader, Boolean isRuntimeObject, Boolean hasTypeInfo, System.Int64& objectId, System.Object& value, System.Runtime.Serialization.SerializationInfo& info) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs:269)
System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadObject (BinaryElement element, System.IO.BinaryReader reader, System.Int64& objectId, System.Object& value, System.Runtime.Serialization.SerializationInfo& info) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs:195)
System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadObject (BinaryElement element, System.IO.BinaryReader reader, System.Int64& objectId, System.Object& value, System.Runtime.Serialization.SerializationInfo& info) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs:223)
System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadNextObject (BinaryElement element, System.IO.BinaryReader reader) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs:130)
System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadObjectGraph (BinaryElement elem, System.IO.BinaryReader reader, Boolean readHeaders, System.Object& result, System.Runtime.Remoting.Messaging.Header[]& headers) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs:104)
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.NoCheckDeserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryFormatter.cs:179)
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryFormatter.cs:136)
AC.Serializer.DeserializeObjectBinary[OptionsData] (System.String pString) (at Assets/AdventureCreator/Scripts/Save system/Serializer.cs:111)
AC.SettingsManager.ShowGUI () (at Assets/AdventureCreator/Scripts/Managers/SettingsManager.cs:530)
AdventureCreator.OnGUI () (at Assets/AdventureCreator/Scripts/Managers/Editor/AdventureCreator.cs:138)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

Comments

  • It's not recommended to edit the save scripts, but keep in mind that 1.42 brings new methods to save both global and local data.
  • Yes, I know now. But I totally wasn't aware that playing around in the code could cause AC to be broken even after reinstalling and stuff :(
  • I had the same issue and broke everything by saving with an old version (and then updating) ;) even after reverting to a working project the problem persisted.

    I solved it by removing everything related to the game from the windows registry. (i removed everything unity related aswell, but i'm not sure that's needed) - search for your game name and company with regedit, but only edit/delete entries if you know what you are doing ;) )
  • edited February 2015
    Ah, thanks for the tip, I didn't look into the registry. I'll try that after I finished my current project (which is running ok again btw. But new AC projects still are broken).
  • edited March 2015
    Before I upgraded to Unity 5 today I deinstalled Unity 4.6.2, deleted all unity- and Adventure Creator related files from my system drive and from the windows registry. Now everything works perfectly again, no nasty errors anymore, yay :)
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.