BL Coding Troop mod crashing on Story mode "Rescue Family" quest trigger, trying to identify why

Users who are viewing this thread


Hi, I have been working on my own mod - it's not very complicated, and only involves changes to npccharacters, partytemplates, and spcultures, all in XML / XSLT. I'm not a pro by any measure!

Everything is working fine UNTIL the initiation of the Story mode Rescue Family quest - which, after reaching the "Reestablish your clan" quest criteria, triggers when you next enter a settlement.

I suspect it's because a troop I've removed from the game is included in some kind of party that is created at this point in Story mode. The reason I think that is that the "Error parsing solution.json Object reference not set to an instance of an object." error, to my understanding, occurs when an object (like a party template) references the ID of another object (like the character ID) that doesn't exist anymore. But I can't identify any party template in either the Sandbox or Story Mode party template files that could be responsible. Does anyone have any ideas if there is something in Story mode - like the creation of a raider party or something - that might be referencing a troop ID that I've deleted? Or how else I might isolate the issue?

Using "Better Exceptions" mod, this is the readout following the error:

Error parsing solution.json Object reference not set to an instance of an object.

Better exception window unhandled exception: Object reference not set to an instance of an object.
   at TaleWorlds.CampaignSystem.Roster.TroopRoster.AddToCountsAtIndex(Int32 index, Int32 countChange, Int32 woundedCountChange, Int32 xpChange, Boolean removeDepleted)
   at TaleWorlds.CampaignSystem.Roster.TroopRoster.AddToCounts(CharacterObject character, Int32 count, Boolean insertAtFront, Int32 woundedCount, Int32 xpChange, Boolean removeDepleted, Int32 index)
   at StoryMode.Quests.PlayerClanQuests.RescueFamilyQuestBehavior.RescueFamilyQuest.CreateRaiderParty(Int32 number, Boolean isBanditBossParty)
   at StoryMode.Quests.PlayerClanQuests.RescueFamilyQuestBehavior.RescueFamilyQuest.CheckIfHideoutIsReady()
   at StoryMode.Quests.PlayerClanQuests.RescueFamilyQuestBehavior.RescueFamilyQuest..ctor()
   at StoryMode.Quests.PlayerClanQuests.RescueFamilyQuestBehavior.OnSettlementEntered(MobileParty party, Settlement settlement, Hero hero)
   at TaleWorlds.CampaignSystem.MbEvent`3.InvokeList(EventHandlerRec`3 list, T1 t1, T2 t2, T3 t3)
   at TaleWorlds.CampaignSystem.CampaignEvents.OnSettlementEntered(MobileParty party, Settlement settlement, Hero hero)
   at TaleWorlds.CampaignSystem.CampaignEventDispatcher.OnSettlementEntered(MobileParty party, Settlement settlement, Hero hero)
   at TaleWorlds.CampaignSystem.Actions.EnterSettlementAction.ApplyInternal(Hero hero, MobileParty mobileParty, Settlement settlement, EnterSettlementDetail detail, Object subject, Boolean isPlayerInvolved)
   at TaleWorlds.CampaignSystem.Actions.EnterSettlementAction.ApplyForParty(MobileParty mobileParty, Settlement settlement)
   at TaleWorlds.CampaignSystem.Encounters.PlayerEncounter.Init(PartyBase attackerParty, PartyBase defenderParty, Settlement settlement)
   at TaleWorlds.CampaignSystem.EncounterManager.StartSettlementEncounter(MobileParty attackerParty, Settlement settlement)
   at TaleWorlds.CampaignSystem.Settlements.Settlement.OnPartyInteraction(MobileParty mobileParty)
   at TaleWorlds.CampaignSystem.EncounterManager.HandleEncounterForMobileParty(MobileParty mobileParty, Single dt)
   at TaleWorlds.CampaignSystem.Party.MobilePartyAi.CheckPartyNeedsUpdate()
   at TaleWorlds.CampaignSystem.Campaign.RealTick(Single realDt)
   at TaleWorlds.CampaignSystem.GameState.MapState.OnMapModeTick(Single dt)
   at TaleWorlds.CampaignSystem.GameState.MapState.OnTick(Single dt)
   at TaleWorlds.Core.GameStateManager.OnTick(Single dt)
   at TaleWorlds.Core.Game.OnTick(Single dt)
   at TaleWorlds.Core.GameManagerBase.OnTick(Single dt)
   at TaleWorlds.MountAndBlade.Module.OnApplicationTick_Patch1(Module this, Single dt)
Top Bottom