PropaneDragon / RushHour

Citizens act like real people when deciding what to do based on the time of day. No more school at 3 am!
33 stars 19 forks source link

Issue building from source - EventPopupManager._panel = null? #51

Open Jonno12345 opened 8 years ago

Jonno12345 commented 8 years ago

Hey, I realise this may be an issue with my build set up, I just can't seem to understand where.

Upon building the latest source and adding the mod, I get the following:

The Mod D:\SteamLibrary\steamapps\common\Cities_Skylines\Files\Mods\RushHour [CimTools.dll, RushHour.dll] has caused an error [ModException]

Details:
System.NullReferenceException: Object reference not set to an instance of an object
  at RushHour.Events.EventPopupManager.Initialise () [0x00000] in <filename unknown>:0 
  at RushHour.Events.EventPopupManager.get_Instance () [0x00000] in <filename unknown>:0 
  at RushHour.LoadingExtension.OnLevelLoaded (LoadMode mode) [0x00000] in <filename unknown>:0 
  at LoadingWrapper.OnLevelLoaded (UpdateMode mode) [0x00000] in <filename unknown>:0 

Trying to debug the issue, it seems like _panel never initialises with an object:

image

image

It seems that _panel = LoadingExtension._mainUIGameObject.AddComponent<EventPopupPanel>(); doesn't seem to be returning an object.

Have you come across this before? I'm guessing this is something not working within UnityEngine, but thought I'd check if you've come across it..!

PropaneDragon commented 8 years ago

That's really strange. It does definitely seem like Unity isn't creating the panel right, but I can't understand why. Maybe the mainUIGameObject isn't getting created correctly. I can't say I've ever come across this before though.

Jonno12345 commented 8 years ago

Hmm, fair enough. Must be a problem my end, although I'm not quite sure where..! Just wondered if you'd experienced it at all. Please file this issue as appropriate, will do some further digging my side :)

Jonno12345 commented 8 years ago

Do you know if it's possible to see Unity debug output anywhere? I'm not sure if it could be showing me a more useful failure log somewhere hidden away.

PropaneDragon commented 8 years ago

Unity creates an output_log.txt file in the game directory. It might be advantageous for you to use ModTools to debug, as it has a better output and allows you to debug the UI which is probably what you want.