Custom culture crash

Users who are viewing this thread

Created a custom culture. When I own a town and it changes to my custom culture (with changing culture mod) I get a crash each time:

- Reasons

Source: TaleWorlds.CampaignSystem
Object reference not set to an instance of an object.

- Inner exception

Source: No module
No inner exception was thrown

- Callstacks

Protip: Use a debugger like dnSpy or Visual studio to trace the source of error, by stepping the program line by line. You can restart with dnSpy attached.
Inner exception callstack:No inner exception was thrown
Outer exception callstack: at TaleWorlds.CampaignSystem.SandBox.CampaignBehaviors.RecruitmentCampaignBehavior.FindTotalMercenaryProbability(CharacterObject mercenaryTroop, Single probabilityOfTroop)
at TaleWorlds.CampaignSystem.SandBox.CampaignBehaviors.RecruitmentCampaignBehavior.UpdateCurrentMercenaryTroopAndCount(Town town, Boolean forceUpdate)
at TaleWorlds.CampaignSystem.SandBox.CampaignBehaviors.RecruitmentCampaignBehavior.DailyTickTown(Town town)
at TaleWorlds.CampaignSystem.MbEvent`1.InvokeList(EventHandlerRec`1 list, T t)
at TaleWorlds.CampaignSystem.CampaignEvents.DailyTickTown(Town town)
at TaleWorlds.CampaignSystem.CampaignEventDispatcher.DailyTickTown(Town town)
at TaleWorlds.CampaignSystem.CampaignPeriodicEventManager.PeriodicTicker`1.PeriodicTickSome(Double timeUnitsElapsed)
at TaleWorlds.CampaignSystem.CampaignPeriodicEventManager.PeriodicDailyTick()
at TaleWorlds.CampaignSystem.Campaign.Tick()
at TaleWorlds.CampaignSystem.MapState.OnMapModeTick(Single dt)
at TaleWorlds.CampaignSystem.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)


Any thoughts on a fix anyone?
 
Hi,

Thanks. you are correct I missed this.
Now works fine. But came across another issue:
created a kingdom with the custom culture and wanted to updrade comapanion to a lord (gave him fief, clan name, etc.)
came across this crash:

- Exception

Exception information
Type: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
CallStack:

  1. at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
  2. at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
  3. at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
  4. at TaleWorlds.Library.Common.InvokeWithLog(MethodInfo methodInfo, Object obj, Object[] args)
  5. at TaleWorlds.Library.ViewModel.ExecuteCommand_Patch1(ViewModel this, String commandName, Object[] parameters)
  6. at TaleWorlds.GauntletUI.Data.GauntletView.OnCommand(String command, Object[] args)
  7. at TaleWorlds.GauntletUI.Widget.EventFired(String eventName, Object[] args)
  8. at TaleWorlds.GauntletUI.ButtonWidget.HandleClick()
  9. at TaleWorlds.GauntletUI.ButtonWidget.OnMouseReleased()
  10. at TaleWorlds.GauntletUI.EventManager.MouseUp()
  11. at TaleWorlds.GauntletUI.UIContext.UpdateInput(InputType handleInputs)
  12. at TaleWorlds.Engine.Screens.ScreenManager.Update()
  13. at TaleWorlds.Engine.Screens.ScreenManager.Tick_Patch2(Single dt)

Inner Exception information
Type: System.InvalidOperationException
Message: Sequence contains no elements
Source: System.Core
CallStack:

  1. at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
  2. at SandBox.Source.CampaignComponents.CompanionRolesCampaignBehavior.GetNewEquipmentForCompanion(Hero companionHero, Boolean isCivilian)
  3. at SandBox.Source.CampaignComponents.CompanionRolesCampaignBehavior.AdjustCompanionsEquipment(Hero companionHero)
  4. at SandBox.Source.CampaignComponents.CompanionRolesCampaignBehavior.ClanNameSelectionIsDone(String clanName)
  5. at TaleWorlds.Core.ViewModelCollection.PopUpVM.ExecuteProcess()
is it something to do with sanboxcore_equipment_sets_xml?
 
Upvote 0
After 1.72 update it crashes and I cannot add custom culture the way I previously did. Is there any solution to this or is it not possible at the moment?
 
Upvote 0
Inner exception callstack:No inner exception was thrown
Outer exception callstack: at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at TaleWorlds.CampaignSystem.CampaignBehaviors.CompanionsCampaignBehavior.InitializeCompanionTemplateList()
at TaleWorlds.CampaignSystem.CampaignBehaviors.CompanionsCampaignBehavior.OnNewGameCreated(CampaignGameStarter starter)
at TaleWorlds.CampaignSystem.MbEvent`1.InvokeList(EventHandlerRec`1 list, T t)
at TaleWorlds.CampaignSystem.CampaignEvents.OnNewGameCreated(CampaignGameStarter campaignGameStarter)
at TaleWorlds.CampaignSystem.CampaignEventDispatcher.OnNewGameCreated(CampaignGameStarter campaignGameStarter)
at TaleWorlds.CampaignSystem.Campaign.OnNewGameCreated(CampaignGameStarter gameStarter)
at TaleWorlds.CampaignSystem.Campaign.DoLoadingForGameType(GameTypeLoadingStates gameTypeLoadingState, GameTypeLoadingStates& nextState)
at TaleWorlds.Core.GameType.DoLoadingForGameType()
at SandBox.SandBoxGameManager.DoLoadingForGameManager(GameManagerLoadingSteps gameManagerLoadingStep, GameManagerLoadingSteps& nextStep)
at TaleWorlds.Core.GameManagerBase.DoLoadingForGameManager()
at TaleWorlds.MountAndBlade.GameLoadingState.OnTick(Single dt)
at TaleWorlds.Core.GameStateManager.OnTick(Single dt)
at TaleWorlds.MountAndBlade.Module.OnApplicationTick_Patch1(Module this, Single dt)
Inner exception callstack:No inner exception was thrown
Outer exception callstack: at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at TaleWorlds.CampaignSystem.CampaignBehaviors.CompanionsCampaignBehavior.InitializeCompanionTemplateList()
at TaleWorlds.CampaignSystem.CampaignBehaviors.CompanionsCampaignBehavior.OnNewGameCreated(CampaignGameStarter starter)
at TaleWorlds.CampaignSystem.MbEvent`1.InvokeList(EventHandlerRec`1 list, T t)
at TaleWorlds.CampaignSystem.CampaignEvents.OnNewGameCreated(CampaignGameStarter campaignGameStarter)
at TaleWorlds.CampaignSystem.CampaignEventDispatcher.OnNewGameCreated(CampaignGameStarter campaignGameStarter)
at TaleWorlds.CampaignSystem.Campaign.OnNewGameCreated(CampaignGameStarter gameStarter)
at TaleWorlds.CampaignSystem.Campaign.DoLoadingForGameType(GameTypeLoadingStates gameTypeLoadingState, GameTypeLoadingStates& nextState)
at TaleWorlds.Core.GameType.DoLoadingForGameType()
at SandBox.SandBoxGameManager.DoLoadingForGameManager(GameManagerLoadingSteps gameManagerLoadingStep, GameManagerLoadingSteps& nextStep)
at TaleWorlds.Core.GameManagerBase.DoLoadingForGameManager()
at TaleWorlds.MountAndBlade.GameLoadingState.OnTick(Single dt)
at TaleWorlds.Core.GameStateManager.OnTick(Single dt)
at TaleWorlds.MountAndBlade.Module.OnApplicationTick_Patch1(Module this, Single dt)
 
Last edited:
Upvote 0
You need to make sure that your culture has wanderer templates under "notable_and_wanderer_templates", if it's a main culture

Code:
<Culture id="empire"
         name="{=empirefaction}Empire"
         is_main_culture="true">
    <notable_and_wanderer_templates>
    ......
    </notable_and_wanderer_templates>
</Culture>
 
Upvote 0
You need to make sure that your culture has wanderer templates under "notable_and_wanderer_templates", if it's a main culture

Code:
<Culture id="empire"
         name="{=empirefaction}Empire"
         is_main_culture="true">
    <notable_and_wanderer_templates>
    ......
    </notable_and_wanderer_templates>
</Culture>
it does. However I copied the sturgia templates:
<notable_and_wanderer_templates>
<template name="NPCCharacter.spc_wanderer_sturgia_0" />
<template name="NPCCharacter.spc_wanderer_sturgia_1" />
<template name="NPCCharacter.spc_wanderer_sturgia_2" />
<template name="NPCCharacter.spc_wanderer_sturgia_3" />
<template name="NPCCharacter.spc_wanderer_sturgia_4" />
<template name="NPCCharacter.spc_wanderer_sturgia_5" />
<template name="NPCCharacter.spc_wanderer_sturgia_6" />
<template name="NPCCharacter.spc_wanderer_sturgia_7" />
<template name="NPCCharacter.spc_wanderer_sturgia_8" />
<template name="NPCCharacter.spc_wanderer_sturgia_9" />
<template name="NPCCharacter.spc_notable_sturgia_0" />
<template name="NPCCharacter.spc_notable_sturgia_0b" />
<template name="NPCCharacter.spc_notable_sturgia_1" />
<template name="NPCCharacter.spc_notable_sturgia_2" />
<template name="NPCCharacter.spc_notable_sturgia_2b" />
<template name="NPCCharacter.spc_notable_sturgia_3" />
<template name="NPCCharacter.spc_notable_sturgia_3b" />
<template name="NPCCharacter.spc_notable_sturgia_3c" />
<template name="NPCCharacter.spc_notable_sturgia_4" />
<template name="NPCCharacter.spc_notable_sturgia_5" />
<template name="NPCCharacter.spc_notable_sturgia_6" />
<template name="NPCCharacter.spc_notable_sturgia_7" />
<template name="NPCCharacter.spc_notable_sturgia_8" />
<template name="NPCCharacter.spc_notable_sturgia_9" />
<template name="NPCCharacter.spc_notable_sturgia_10" />
<template name="NPCCharacter.spc_sturgia_headman_1" />
<template name="NPCCharacter.spc_sturgia_headman_2" />
<template name="NPCCharacter.spc_sturgia_headman_3" />
</notable_and_wanderer_templates>

does this need to be uniqe for my custom culture?
 
Upvote 0
it does. However I copied the sturgia templates:
<notable_and_wanderer_templates>
<template name="NPCCharacter.spc_wanderer_sturgia_0" />
<template name="NPCCharacter.spc_wanderer_sturgia_1" />
<template name="NPCCharacter.spc_wanderer_sturgia_2" />
<template name="NPCCharacter.spc_wanderer_sturgia_3" />
<template name="NPCCharacter.spc_wanderer_sturgia_4" />
<template name="NPCCharacter.spc_wanderer_sturgia_5" />
<template name="NPCCharacter.spc_wanderer_sturgia_6" />
<template name="NPCCharacter.spc_wanderer_sturgia_7" />
<template name="NPCCharacter.spc_wanderer_sturgia_8" />
<template name="NPCCharacter.spc_wanderer_sturgia_9" />
<template name="NPCCharacter.spc_notable_sturgia_0" />
<template name="NPCCharacter.spc_notable_sturgia_0b" />
<template name="NPCCharacter.spc_notable_sturgia_1" />
<template name="NPCCharacter.spc_notable_sturgia_2" />
<template name="NPCCharacter.spc_notable_sturgia_2b" />
<template name="NPCCharacter.spc_notable_sturgia_3" />
<template name="NPCCharacter.spc_notable_sturgia_3b" />
<template name="NPCCharacter.spc_notable_sturgia_3c" />
<template name="NPCCharacter.spc_notable_sturgia_4" />
<template name="NPCCharacter.spc_notable_sturgia_5" />
<template name="NPCCharacter.spc_notable_sturgia_6" />
<template name="NPCCharacter.spc_notable_sturgia_7" />
<template name="NPCCharacter.spc_notable_sturgia_8" />
<template name="NPCCharacter.spc_notable_sturgia_9" />
<template name="NPCCharacter.spc_notable_sturgia_10" />
<template name="NPCCharacter.spc_sturgia_headman_1" />
<template name="NPCCharacter.spc_sturgia_headman_2" />
<template name="NPCCharacter.spc_sturgia_headman_3" />
</notable_and_wanderer_templates>

does this need to be uniqe for my custom culture?
looks like it does :smile: I`ve changed all of the above and it worked.
Thanks a ton!!! Very helpfull as always!
 
Upvote 0
Happy to help :smile:
and me agian,
came accross another crash possibly related to custom culture. On my playthrough one castle with its villages changed to my custom culture (changing culture mod). After a brief moment crash:

- Reasons
Source: TaleWorlds.CampaignSystem
Object reference not set to an instance of an object.

- Inner exception
Source: No module
No inner exception was thrown

- Callstacks
Protip: Use a debugger like dnSpy or Visual studio to trace the source of error, by stepping the program line by line. You can restart with dnSpy attached.

Inner exception callstack:
No inner exception was thrown
Outer exception callstack:
at TaleWorlds.CampaignSystem.Party.MobileParty.FillPartyStacks(PartyTemplateObject pt, Int32 troopNumberLimit)
at TaleWorlds.CampaignSystem.Party.PartyComponents.MilitiaPartyComponent.InitializeMilitiaPartyProperties(MobileParty mobileParty, Settlement settlement)
at TaleWorlds.CampaignSystem.Party.MobileParty.CreateParty(String stringId, PartyComponent component, OnPartyComponentCreatedDelegate delegateFunction)
at TaleWorlds.CampaignSystem.Party.PartyComponents.MilitiaPartyComponent.CreateMilitiaParty(String stringId, Settlement settlement)
at TaleWorlds.CampaignSystem.Settlements.Settlement.SpawnMilitiaParty()
at TaleWorlds.CampaignSystem.Settlements.Settlement.set_Militia(Single value)
at TaleWorlds.CampaignSystem.Settlements.Village.DailyTick()
at TaleWorlds.CampaignSystem.MbEvent`1.InvokeList(EventHandlerRec`1 list, T t)
at TaleWorlds.CampaignSystem.CampaignEvents.DailyTickSettlement(Settlement settlement)
at TaleWorlds.CampaignSystem.CampaignEventDispatcher.DailyTickSettlement(Settlement settlement)
at TaleWorlds.CampaignSystem.CampaignPeriodicEventManager.PeriodicTicker`1.PeriodicTickSome(Double timeUnitsElapsed)
at TaleWorlds.CampaignSystem.CampaignPeriodicEventManager.PeriodicDailyTick()
at TaleWorlds.CampaignSystem.CampaignPeriodicEventManager.TickPeriodicEvents()
at TaleWorlds.CampaignSystem.Campaign.Tick()
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)

any help would be much appreciated
 
Upvote 0
Back
Top Bottom