emipa606 / MoreFactionInteraction

Repository for the Rimworld mod named More Faction Interaction (Continued)
https://steamcommunity.com/sharedfiles/filedetails/?id=2379076640
MIT License
2 stars 3 forks source link

Map quests that have a click through dialog freeze with empty mouse position stack #2

Open stubkan opened 1 year ago

stubkan commented 1 year ago

There is a discussion thread on the steam workshop page but I read that github issues are preferred for visibility.

https://steamcommunity.com/workshop/filedetails/discussion/2379076640/4943253385022306914/

Since multiple people appear to be having this issue, I'm posting here with what I've found as I have a save before a pawn enters the expo quest which will freeze every time.

The first time, it pulled me out of colony view straight to world map - where I got the empty mouse stack error - the icons on the world map were wrong ones, and the error came up every time I tried to click to continue. No way to proceed other than alt-f4.

EQbcybe

Second time, I waited on the world map for the quest, but was still stopped by inability to click. I noticed that the mouse cursor was able to move the map selection hex around in the background (underneath the quest dialog)... Perhaps its an issue with which layer the mouse is being registered on.

20221227010249_1 20221227010327_1

I'll unload a few of my map related mods to see if anything changes.

stubkan commented 1 year ago

Verified steam files, removed as many non-savegame breaking mods as I could (map preview, rocketman, inventory GUI, etc), deleted all mod files from workshop content and let steam re-download them all... etc.. Couldnt get the error to go away.

Heres the log exercpt for the error.


Exception filling window for Verse.Dialog_NodeTree: System.NullReferenceException: Object reference not set to an instance of an object
  at (wrapper dynamic-method) MoreFactionInteraction.More_Flavour.Buff_Chemfuel.MoreFactionInteraction.More_Flavour.Buff_Chemfuel.Description_Patch0(MoreFactionInteraction.More_Flavour.Buff_Chemfuel)
  at (wrapper dynamic-method) MoreFactionInteraction.EventRewardWorker_ScienceFaire.MoreFactionInteraction.EventRewardWorker_ScienceFaire.GenerateBuff_Patch0(MoreFactionInteraction.EventRewardWorker_ScienceFaire,RimWorld.TechLevel,Verse.Pawn,RimWorld.Planet.Caravan,System.Predicate`1<Verse.ThingDef>,RimWorld.ThingSetMakerDef)
  at MoreFactionInteraction.EventRewardWorker_ScienceFaire.GenerateRewards (Verse.Pawn pawn, RimWorld.Planet.Caravan caravan, System.Predicate`1[T] globalValidator, RimWorld.ThingSetMakerDef thingSetMakerDef) [0x00017] in <f3786688aa0e4fdea467e844348d9368>:0 
  at MoreFactionInteraction.More_Flavour.AnnualExpoDialogue.DetermineOutcome (System.String& annualExpoDialogueOutcome) [0x000e2] in <f3786688aa0e4fdea467e844348d9368>:0 
  at MoreFactionInteraction.More_Flavour.AnnualExpoDialogue+<>c__DisplayClass6_0.<DialogueOptions>b__0 () [0x00000] in <f3786688aa0e4fdea467e844348d9368>:0 
  at Verse.DiaOption.Activate () [0x00038] in <e349ce7a2d3c4b12accadba0fae574fc>:0 
  at Verse.DiaOption.OptOnGUI (UnityEngine.Rect rect, System.Boolean active) [0x000ac] in <e349ce7a2d3c4b12accadba0fae574fc>:0 
  at Verse.Dialog_NodeTree.DrawNode (UnityEngine.Rect rect) [0x0014e] in <e349ce7a2d3c4b12accadba0fae574fc>:0 
  at Verse.Dialog_NodeTree.DoWindowContents (UnityEngine.Rect inRect) [0x0006e] in <e349ce7a2d3c4b12accadba0fae574fc>:0 
  at Verse.Window.InnerWindowOnGUI (System.Int32 x) [0x001d3] in <e349ce7a2d3c4b12accadba0fae574fc>:0  
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 39)

Mouse position stack is not empty. There were more calls to BeginScrollView than EndScrollView. Fixing. 
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 39)

Exception filling window for Verse.Dialog_NodeTree: System.NullReferenceException: Object reference not set to an instance of an object
  at MoreFactionInteraction.More_Flavour.Buff_Emanator.Apply () [0x00078] in <f3786688aa0e4fdea467e844348d9368>:0 
  at MoreFactionInteraction.More_Flavour.WorldComponent_MFI_AnnualExpo.ApplyRandomBuff (System.Predicate`1[T] validator) [0x0002d] in <f3786688aa0e4fdea467e844348d9368>:0 
  at (wrapper dynamic-method) MoreFactionInteraction.EventRewardWorker_ScienceFaire.MoreFactionInteraction.EventRewardWorker_ScienceFaire.GenerateBuff_Patch0(MoreFactionInteraction.EventRewardWorker_ScienceFaire,RimWorld.TechLevel,Verse.Pawn,RimWorld.Planet.Caravan,System.Predicate`1<Verse.ThingDef>,RimWorld.ThingSetMakerDef)
  at MoreFactionInteraction.EventRewardWorker_ScienceFaire.GenerateRewards (Verse.Pawn pawn, RimWorld.Planet.Caravan caravan, System.Predicate`1[T] globalValidator, RimWorld.ThingSetMakerDef thingSetMakerDef) [0x00017] in <f3786688aa0e4fdea467e844348d9368>:0 
  at MoreFactionInteraction.More_Flavour.AnnualExpoDialogue.DetermineOutcome (System.String& annualExpoDialogueOutcome) [0x000e2] in <f3786688aa0e4fdea467e844348d9368>:0 
  at MoreFactionInteraction.More_Flavour.AnnualExpoDialogue+<>c__DisplayClass6_0.<DialogueOptions>b__0 () [0x00000] in <f3786688aa0e4fdea467e844348d9368>:0 
  at Verse.DiaOption.Activate () [0x00038] in <e349ce7a2d3c4b12accadba0fae574fc>:0 
  at Verse.DiaOption.OptOnGUI (UnityEngine.Rect rect, System.Boolean active) [0x000ac] in <e349ce7a2d3c4b12accadba0fae574fc>:0 
  at Verse.Dialog_NodeTree.DrawNode (UnityEngine.Rect rect) [0x0014e] in <e349ce7a2d3c4b12accadba0fae574fc>:0 
  at Verse.Dialog_NodeTree.DoWindowContents (UnityEngine.Rect inRect) [0x0006e] in <e349ce7a2d3c4b12accadba0fae574fc>:0 
  at Verse.Window.InnerWindowOnGUI (System.Int32 x) [0x001d3] in <e349ce7a2d3c4b12accadba0fae574fc>:0  
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 39)

Mouse position stack is not empty. There were more calls to BeginScrollView than EndScrollView. Fixing. 
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 39)
stubkan commented 1 year ago

I noticed one of the errors had a line about chemfuel; MoreFactionInteraction.More_Flavour.Buff_Chemfuel.MoreFactionInteraction.More_Flavour.Buff_Chemfuel.Description_Patch0(MoreFactionInteraction.More_Flavour.Buff_Chemfuel)

So I had Vanilla Chemfuel Expanded, removed that mod and tried again. It did throw errors, BUT it passed onto a completion window. I could continue the game, after recieving the infinite chemreactor item. So it seems that is a mod conflict to me.

20221227045840_1

Sometimes it throws errors with the chemfuel line, other times it throws errors about the psychic emanator buff, (the first attempt after I removed the chemfuel expanded mod, it threw an error with buff to psychic emanator, but the next click succeeded which gave me the chemreactor item) so I think the reward items are incompatible with mods, perhaps.

stubkan commented 1 year ago

image

I removed every mod that had the 'PsychicEmanator' string anywhere in them (approx 10 mods) but failed to continue through with the emanator buff reward line, perhaps it just wasnt going to be the actual outcome (was still trying to give me the chemreactor)

oorzkws commented 1 year ago

Stack trace ref: https://github.com/emipa606/MoreFactionInteraction/blob/91409b033e093ee09c71c3c314bf80dbe789a837/Source/MoreFactionInteraction/World%20Incidents/Buff_Chemfuel.cs#L44 https://github.com/emipa606/MoreFactionInteraction/blob/91409b033e093ee09c71c3c314bf80dbe789a837/Source/MoreFactionInteraction/World%20Incidents/Buff_Emanator.cs#L11

emipa606 commented 1 year ago

Hopefully fixed in a87cc2f Added nullchecks to the possible rewards

stubkan commented 1 year ago

The issue persists, unfortunately.

image

Per conversation on discord - it appears the process is

  1. expo generated with list of possible quest item rewards
  2. pawn arrives at expo, then process determines which reward to choose
  3. buff to quest item applied
  4. quest item given

The quest items do exist, and my save is at between point 1 and 2. I have a psychic emanator in inventory and can spawn a chemreactor. Removing chemfuel expanded mod allows the process to pass from 1 to 4 for chemreactor reward line. Removing every mod I have that references psychic emanators does not allow process to pass through to 4 for psychic reward line.

It seems to me that the bug may not lie in checking whether or not the quest items exist, but with the applying of the buff to items or some other point between 2-4.

Perhaps it is that the item variables have been altered and that is what is stopping it?

stubkan commented 1 year ago

Confirmed still a bug with new game with only 2 mods added. Harmony and More Factions Interactions.

image

Spawned science expo, psychic emanator reward doesnt work sadly.

Exception filling window for Verse.Dialog_NodeTree: System.NullReferenceException: Object reference not set to an instance of an object
  at MoreFactionInteraction.More_Flavour.Buff_Emanator.Apply () [0x00078] in <4edd226eeb7f4449aa56f81cbeff3f55>:0 
  at MoreFactionInteraction.More_Flavour.WorldComponent_MFI_AnnualExpo.ApplyRandomBuff (System.Predicate`1[T] validator) [0x0002d] in <4edd226eeb7f4449aa56f81cbeff3f55>:0 
  at MoreFactionInteraction.EventRewardWorker_ScienceFaire.GenerateBuff (RimWorld.TechLevel desiredTechLevel, Verse.Pawn pawn, RimWorld.Planet.Caravan caravan, System.Predicate`1[T] globalValidator, RimWorld.ThingSetMakerDef thingSetMakerDef) [0x00017] in <4edd226eeb7f4449aa56f81cbeff3f55>:0 
  at MoreFactionInteraction.EventRewardWorker_ScienceFaire.GenerateRewards (Verse.Pawn pawn, RimWorld.Planet.Caravan caravan, System.Predicate`1[T] globalValidator, RimWorld.ThingSetMakerDef thingSetMakerDef) [0x00017] in <4edd226eeb7f4449aa56f81cbeff3f55>:0 
  at MoreFactionInteraction.More_Flavour.AnnualExpoDialogue.DetermineOutcome (System.String& annualExpoDialogueOutcome) [0x000e2] in <4edd226eeb7f4449aa56f81cbeff3f55>:0 
  at MoreFactionInteraction.More_Flavour.AnnualExpoDialogue+<>c__DisplayClass6_0.<DialogueOptions>b__0 () [0x00000] in <4edd226eeb7f4449aa56f81cbeff3f55>:0 
  at Verse.DiaOption.Activate () [0x00038] in <e349ce7a2d3c4b12accadba0fae574fc>:0 
  at Verse.DiaOption.OptOnGUI (UnityEngine.Rect rect, System.Boolean active) [0x000ac] in <e349ce7a2d3c4b12accadba0fae574fc>:0 
  at Verse.Dialog_NodeTree.DrawNode (UnityEngine.Rect rect) [0x0014e] in <e349ce7a2d3c4b12accadba0fae574fc>:0 
  at Verse.Dialog_NodeTree.DoWindowContents (UnityEngine.Rect inRect) [0x0006e] in <e349ce7a2d3c4b12accadba0fae574fc>:0 
  at Verse.Window.InnerWindowOnGUI (System.Int32 x) [0x001d3] in <e349ce7a2d3c4b12accadba0fae574fc>:0 
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Verse.Log:Error (string)
Verse.Window:InnerWindowOnGUI (int)
UnityEngine.GUI:CallWindowDelegate (UnityEngine.GUI/WindowFunction,int,int,UnityEngine.GUISkin,int,single,single,UnityEngine.GUIStyle)

Mouse position stack is not empty. There were more calls to BeginScrollView than EndScrollView. Fixing.
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Verse.Log:Error (string)
Verse.Widgets:EnsureMousePositionStackEmpty ()
Verse.Root:Update ()
Verse.Root_Play:Update ()

image

stubkan commented 1 year ago

I think the error might lie with the buff function not working, perhaps looking at the buff effect or removing it (but still just giving the reward item) may allow the expo to continue functioning - and the buff can be reexamined later or redone?