JadHajjar / RoadBuilder-CSII

A mod for Cities: Skylines II to create endless road combinations on the fly while you’re playing the game!
MIT License
38 stars 6 forks source link

Incompatibility with Traffic Lights Enhancement mod #51

Closed gaborposz closed 2 months ago

gaborposz commented 2 months ago

It seems there is an incompatibility with the Traffic Lights Enhancement mod.

I'm getting the following exceptions (and a CTD) when the game loads:

KeyNotFoundException: The given key '4447774304008' was not present in the dictionary.
  at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) [0x0001e] in <467a840a914a47078e4ae9b0b1e8779e>:0 
  at cohtml.Net.Binder.CallbackThunk (System.IntPtr binder, System.Int32 callbackId, System.Int32 argumentsCount) [0x00000] in <4b93ef88188a4d7c88aff340ff545a71>:0 
  at (wrapper native-to-managed) cohtml.Net.Binder.CallbackThunk(intptr,int,int)
  at (wrapper managed-to-native) cohtml.Net.cohtmlNativePINVOKE.View_Advance(System.Runtime.InteropServices.HandleRef,uint,double)
  at cohtml.Net.View.Advance (System.UInt32 systemId, System.Double time) [0x00000] in <4b93ef88188a4d7c88aff340ff545a71>:0 
  at Colossal.UI.UIView.Update () [0x0001e] in <ce5d520e80344c4399056cbbdae9519f>:0 
  at Colossal.UI.UISystem.Update () [0x0001e] in <ce5d520e80344c4399056cbbdae9519f>:0 
  at Colossal.UI.UIManager.Update () [0x00015] in <ce5d520e80344c4399056cbbdae9519f>:0 
  at Game.SceneFlow.GameManager.UpdateUI () [0x00000] in <b32c7d7e7ca9498a8ce0ea5e934fb7a7>:0 
  at Game.SceneFlow.GameManager.Update () [0x00031] in <b32c7d7e7ca9498a8ce0ea5e934fb7a7>:0 
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
Colossal.Logging.CustomLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)
[RoadBuilder] [ERROR]  Object reference not set to an instance of an object System.NullReferenceException: Object reference not set to an instance of an object
  at cohtml.Net.View.ExecuteEvent (cohtml.Net.Exporter& exporter, System.String& name, System.Byte argumentsCount, System.Action actions) [0x00023] in <4b93ef88188a4d7c88aff340ff545a71>:0 
  at cohtml.Net.View.TriggerEvent[T1] (System.String name, T1 argument1) [0x0001e] in <4b93ef88188a4d7c88aff340ff545a71>:0 
  at C2VM.TrafficLightsEnhancement.Systems.UISystem.UISystem.CallUpdateLocale () [0x00077] in C:\Users\Sam\Documents\Cities2-TrafficLightsEnhancement\TrafficLightsEnhancement\Systems\UISystem\UISystem.cs:128 
  at C2VM.TrafficLightsEnhancement.Systems.UISystem.Patches.NotifyActiveDictionaryChanged () [0x00000] in C:\Users\Sam\Documents\Cities2-TrafficLightsEnhancement\TrafficLightsEnhancement\Systems\UISystem\Patches.cs:16 
  at (wrapper dynamic-method) Colossal.Localization.LocalizationManager.Colossal.Localization.LocalizationManager.NotifyActiveDictionaryChanged_Patch1(Colossal.Localization.LocalizationManager)
  at Colossal.Localization.LocalizationManager.ReloadActiveLocale () [0x00065] in <d65fdbb3db55460c89d085c251aa587e>:0 
  at RoadBuilder.Systems.RoadBuilderNetSectionsSystem.DoCustomSectionSetup () [0x00044] in E:\Programming\RoadBuilder-CSII\RoadBuilder\Systems\RoadBuilderNetSectionsSystem.cs:124 
  at RoadBuilder.Systems.RoadBuilderNetSectionsSystem.OnUpdate () [0x000cb] in E:\Programming\RoadBuilder-CSII\RoadBuilder\Systems\RoadBuilderNetSectionsSystem.cs:76 
      at <unknown> <0xffffffff>
      at cohtml.Net.cohtmlNativePINVOKE:View_Advance <0x000ae>
      at cohtml.Net.View:Advance <0x0006a>
      at Colossal.UI.UIView:Update <0x0007a>
      at Colossal.UI.UISystem:Update <0x0006a>
      at Colossal.UI.UIManager:Update <0x0005a>
      at Game.SceneFlow.GameManager:UpdateUI <0x0002a>
      at Game.SceneFlow.GameManager:Update <0x000ba>
      at System.Object:runtime_invoke_void__this__ <0x00087>

Tried to change the load order of the two mods, but it did not help. However, if disable either Road Builder or Traffic Lights Enhancement then the game can load again.

UPDATE: The Gooee mod also have to play a role in this issue, because the crash is only reproducible if I have all these 3 mods enabled. If I disable Gooee then I can load my savegame, but without the mod UI I can hardly do anything :(

JadHajjar commented 2 months ago

Hello, thanks for pointing out the Gooee relation to all this

gaborposz commented 2 months ago

I tried with the v.0.1.2 version, and it is still crashing during main menu load with the same exceptions as before :( Player.log

See also: Cities2-TrafficLightsEnhancement - Compatibility with Rod Builder mod #107

gaborposz commented 2 months ago

With some hints in the other linked issue I finally figured out the solution:

To fix the compatibility issue between Road Builder and Traffic Lights Enhancement it was not enough to disable or remove the Gooee mod and delete the C:\Users\<your_username>\LocalLow\Colossal Order\Cities Skylines II\.cache\Mods\mods_subscribed\ folder, because there were also some additional orphaned Gooee folders on my machine:

C:\Users\<your_username>\LocalLow\Colossal Order\Cities Skylines II\Mods\Gooee
C:\Users\<your_username>\LocalLow\Colossal Order\Cities Skylines II\ModsData\Gooee

I have deleted these, and now the mod UIs are back, and the compatibility issue is also gone.