hello i tried commenting on the mod i think is involved but get no anwsers there so i might aswell try here. i keep getting a crash mid battle. 540 vs 220. the exception states
Exception information Type: System.IndexOutOfRangeException Message: Index was outside the bounds of the array. Source: TaleWorlds.CampaignSystem CallStack:
at int TaleWorlds.CampaignSystem.Roster.TroopRoster.AddToCountsAtIndex(int index, int countChange, int woundedCountChange, int xpChange, bool removeDepleted)
at void TaleWorlds.CampaignSystem.Roster.TroopRoster.RemoveTroop(CharacterObject troop, int numberToRemove, UniqueTroopDescriptor troopSeed, int xp)
at void TaleWorlds.CampaignSystem.MapEvents.MapEventParty.OnTroopKilled(UniqueTroopDescriptor troopSeed)
at void TaleWorlds.CampaignSystem.MapEvents.MapEventSide.OnTroopKilled(UniqueTroopDescriptor troopDesc1)
at void TaleWorlds.CampaignSystem.TroopSuppliers.PartyGroupTroopSupplier.OnTroopKilled(UniqueTroopDescriptor troopDescriptor)
at void TaleWorlds.CampaignSystem.AgentOrigins.PartyGroupAgentOrigin.SetKilled()
at void SandBox.Missions.MissionLogics.BattleAgentLogic.OnAgentRemoved(Agent affectedAgent, Agent affectorAgent, AgentState agentState, KillingBlow killingBlow)
at void TaleWorlds.MountAndBlade.Mission.OnAgentRemoved(Agent affectedAgent, Agent affectorAgent, AgentState agentState, KillingBlow killingBlow)
at void ManagedCallbacks.CoreCallbacksGenerated.Mission_OnAgentRemoved(int thisPointer, int affectedAgent, int affectorAgent, AgentState agentState, KillingBlow killingBlow)
at void TaleWorlds.MountAndBlade.Agent.Die(Blow b, KillInfo overrideKillInfo)
at bool RBMCombat.DamageRework+HandleBlowPatch.Prefix(ref Agent __instance, ref Blow b, AgentLastHitInfo ____lastHitInfo, in AttackCollisionData collisionData) in D:/SteamLibrary/steamapps/common/Mount & Blade II Bannerlord/Modules/RealisticBattleProject/RealisticBattleCombatModule/CombatModule/DamageRework.cs:line 1414
at void TaleWorlds.MountAndBlade.Agent.HandleBlow_Patch1(Agent this, ref Blow b, in AttackCollisionData collisionData)
at bool TaleWorlds.MountAndBlade.Mission.MissileHitCallback_Patch2(Mission this, out int extraHitParticleIndex, ref AttackCollisionData collisionData, Vec3 missileStartingPosition, Vec3 missilePosition, Vec3 missileAngularVelocity, Vec3 movementVelocity, MatrixFrame attachGlobalFrame, MatrixFrame affectedShieldGlobalFrame, int numDamagedAgents, Agent attacker, Agent victim, GameEntity hitEntity)
at bool ManagedCallbacks.CoreCallbacksGenerated.Mission_MissileHitCallback(int thisPointer, out int extraHitParticleIndex, ref AttackCollisionData collisionData, Vec3 missileStartingPosition, Vec3 missilePosition, Vec3 missileAngularVelocity, Vec3 movementVelocity, MatrixFrame attachGlobalFrame, MatrixFrame affectedShieldGlobalFrame, int numDamagedAgents, int attacker, int victim, NativeObjectPointer hitEntity)
at void TaleWorlds.MountAndBlade.Mission.Tick_Patch1(Mission this, float dt)
Hey can anyone help me with this it keeps happening in sieges alot! And its driving me crazy!
Exception information Type: System.IndexOutOfRangeException Message: Index was outside the bounds of the array. Source: TaleWorlds.Library CallStack:
at void TaleWorlds.Library.MBList2D.set_Item(int index1, int index2, T value)
at void TaleWorlds.MountAndBlade.LineFormation.RemoveUnit(IFormationUnit unit, bool fillInTheGap, bool isRemovingFromAnUnavailablePosition)
at void TaleWorlds.MountAndBlade.LineFormation.ShiftUnitsBackwardsForNarrowingFormation(LineFormation formation, int fileCountFromLeftFlank, int fileCountFromRightFlank)
at void TaleWorlds.MountAndBlade.LineFormation.NarrowFormation(LineFormation formation, int fileCountFromBothFlanks)
at void TaleWorlds.MountAndBlade.LineFormation.TryToKeepDepth()
at void TaleWorlds.MountAndBlade.LineFormation.RemoveUnit(IFormationUnit unit, bool fillInTheGap, bool isRemovingFromAnUnavailablePosition)
at void TaleWorlds.MountAndBlade.Formation.RemoveUnit(Agent unit)
at void TaleWorlds.MountAndBlade.Agent.set_Formation(Formation value)
at void TaleWorlds.MountAndBlade.Agent.OnRemove()
at void TaleWorlds.MountAndBlade.Mission.OnAgentRemoved(Agent affectedAgent, Agent affectorAgent, AgentState agentState, KillingBlow killingBlow)
at void ManagedCallbacks.CoreCallbacksGenerated.Mission_OnAgentRemoved_Patch1(int thisPointer, int affectedAgent, int affectorAgent, AgentState agentState, KillingBlow killingBlow)
Here is another one - seems to be trying to move off a wall or jump off a wall / or a troop touching this area
Exception information Type: System.IndexOutOfRangeException Message: Index was outside the bounds of the array. Source: TaleWorlds.Library CallStack:
at void TaleWorlds.Library.MBList2D.set_Item(int index1, int index2, T value)
at void TaleWorlds.MountAndBlade.LineFormation.RelocateUnit(IFormationUnit unit, int fileIndex, int rankIndex)
at void TaleWorlds.MountAndBlade.LineFormation.FillInTheGapsOfFileAux(LineFormation formation, int fileIndex, int rankIndex)
at void TaleWorlds.MountAndBlade.LineFormation.FillInTheGapsOfFile(LineFormation formation, int fileIndex, int rankIndex, bool isCheckingLastRankForEmptiness)
at void TaleWorlds.MountAndBlade.LineFormation.RemoveUnit(IFormationUnit unit, bool fillInTheGap, bool isRemovingFromAnUnavailablePosition)
at void TaleWorlds.MountAndBlade.Formation.RemoveUnit(Agent unit)
at void TaleWorlds.MountAndBlade.Agent.set_Formation(Formation value)
at void TaleWorlds.MountAndBlade.Formation.TransferUnitsAux(Formation target, int unitCount, bool isPlayerOrder, bool useSelectivePop)
at IEnumerable TaleWorlds.MountAndBlade.OrderController.SplitFormation(Formation formation, int count)
at IEnumerable TaleWorlds.MountAndBlade.Formation.Split(int count)
at void TaleWorlds.MountAndBlade.TacticDefendCastle.CarryOutDefense(List defendedLanes, List lanesToBeRetaken, bool isEnemyInside, bool doRangedJoinMelee, out bool hasTransferOccurred)
at void TaleWorlds.MountAndBlade.TacticDefendCastle.CheckAndChangeState()
at void TaleWorlds.MountAndBlade.TacticDefendCastle.TickOccasionally()
at void TaleWorlds.MountAndBlade.TeamAIComponent.TickOccasionally_Patch1(TeamAIComponent this)
at void TaleWorlds.MountAndBlade.TeamAIComponent.Tick(float dt)
at void TaleWorlds.MountAndBlade.TeamAISiegeComponent.Tick(float dt)
at void TaleWorlds.MountAndBlade.Team.Tick(float dt)
at void TaleWorlds.MountAndBlade.Mission.TickAgentsAndTeamsImp(float dt)
at void ManagedCallbacks.CoreCallbacksGenerated.Mission_TickAgentsAndTeams_Patch1(int thisPointer, float dt)
Hello mate, been getting this crash constantly and this is the second playthrough that has been messed up. I'm pretty sure it is the Bannerkings or Serve as a soldier mod that causes the problems but possibly the Distinguished service one too. here is the crash file
Exception information Type: System.IndexOutOfRangeException Message: Index was outside the bounds of the array. Source: TaleWorlds.Library CallStack:
at void TaleWorlds.Library.MBList2D.set_Item(int index1, int index2, T value)
at void TaleWorlds.MountAndBlade.LineFormation.RelocateUnit(IFormationUnit unit, int fileIndex, int rankIndex)
at void TaleWorlds.MountAndBlade.LineFormation.FillInTheGapsOfFileAux(LineFormation formation, int fileIndex, int rankIndex)
at void TaleWorlds.MountAndBlade.LineFormation.FillInTheGapsOfFile(LineFormation formation, int fileIndex, int rankIndex, bool isCheckingLastRankForEmptiness)
at void TaleWorlds.MountAndBlade.LineFormation.RemoveUnit(IFormationUnit unit, bool fillInTheGap, bool isRemovingFromAnUnavailablePosition)
at void TaleWorlds.MountAndBlade.Formation.RemoveUnit(Agent unit)
at void TaleWorlds.MountAndBlade.Agent.set_Formation(Formation value)
at void TaleWorlds.MountAndBlade.Formation.TransferUnitsAux(Formation target, int unitCount, bool isPlayerOrder, bool useSelectivePop)
at IEnumerable TaleWorlds.MountAndBlade.OrderController.SplitFormation(Formation formation, int count)
at IEnumerable TaleWorlds.MountAndBlade.Formation.Split(int count)
at void TaleWorlds.MountAndBlade.TacticDefendCastle.CarryOutDefense(List defendedLanes, List lanesToBeRetaken, bool isEnemyInside, bool doRangedJoinMelee, out bool hasTransferOccurred)
at void TaleWorlds.MountAndBlade.TacticDefendCastle.CheckAndChangeState()
at void TaleWorlds.MountAndBlade.TacticDefendCastle.TickOccasionally()
at void TaleWorlds.MountAndBlade.TeamAIComponent.TickOccasionally_Patch1(TeamAIComponent this)
at void TaleWorlds.MountAndBlade.TeamAIComponent.Tick(float dt)
at void TaleWorlds.MountAndBlade.TeamAISiegeComponent.Tick(float dt)
at void TaleWorlds.MountAndBlade.Team.Tick(float dt)
at void TaleWorlds.MountAndBlade.Mission.TickAgentsAndTeamsImp(float dt)
at void ManagedCallbacks.CoreCallbacksGenerated.Mission_TickAgentsAndTeams_Patch1(int thisPointer, float dt)
Thanks for these tips! I'd like to ask, I seem to be getting this error a lot and I'm unable to figure out what may be the reason. It seems to happen when I save on the campaign map and there are other units in view:
Exception information Type: System.IndexOutOfRangeException
Message: Index was outside the bounds of the array.
Source: TaleWorlds.CampaignSystem
CallStack:
at int TaleWorlds.CampaignSystem.Roster.TroopRoster.AddToCountsAtIndex(int index, int countChange, int woundedCountChange, int xpChange, bool removeDepleted)
at void TaleWorlds.CampaignSystem.Roster.TroopRoster.RemoveTroop(CharacterObject troop, int numberToRemove, UniqueTroopDescriptor troopSeed, int xp)
at void TaleWorlds.CampaignSystem.Hero.AfterLoad()
at void TaleWorlds.CampaignSystem.CampaignObjectManager+CampaignObjectType.AfterLoad()
at void TaleWorlds.CampaignSystem.CampaignObjectManager.AfterLoad()
at void TaleWorlds.CampaignSystem.Campaign.OnGameLoaded(CampaignGameStarter starter)
at void TaleWorlds.CampaignSystem.Campaign.DoLoadingForGameType(GameTypeLoadingStates gameTypeLoadingState, out GameTypeLoadingStates nextState)
at void StoryMode.CampaignStoryMode.DoLoadingForGameType(GameTypeLoadingStates gameTypeLoadingState, out GameTypeLoadingStates nextState)
at bool TaleWorlds.Core.GameType.DoLoadingForGameType()
at void SandBox.SandBoxGameManager.DoLoadingForGameManager(GameManagerLoadingSteps gameManagerLoadingStep, out GameManagerLoadingSteps nextStep)
at bool TaleWorlds.Core.GameManagerBase.DoLoadingForGameManager()
at void TaleWorlds.MountAndBlade.GameLoadingState.OnTick(float dt)
at void TaleWorlds.Core.GameStateManager.OnTick(float dt)
at void TaleWorlds.MountAndBlade.Module.OnApplicationTick_Patch1(Module this, float dt)
Thank you for your comment. I'm looking into this issue. If you don't mind, can you post the mods you used? I will write and send the answer as soon as possible
Thanks for replying! Of course, here's the list: Harmony Butterlib UiExtenderEx MCM v5 BannerKings Diplomacy Birth and Death Options Improved Garrisons Open Source Armory RBM SomeMinorTroopsAreNowFemale Hot Butter Peasants More Hero Interactions MCAmazonBody OnGovernorChangedWorkAround Detailed Character Creation
Çakışacak 4 mod var. Sıcak Tereyağı Geliştirilmiş Garnizonlar Daha Fazla Kahraman Etkileşimi OnGovernorChangedWorkAround Worst of all, mods that conflict with BK also conflict with each other. If you give me some more time, I will try to find the solution. As for my personal comment The two biggest failure modes hot butler Improved Garrisons
i had the same bug, and my game is lost because of it, can't load any savegame anymore, i tried catching it with harmony, but the game crashes again just after on something else (a null ref on a Clan getter), i tried as well just putting a prefix saying "don't run this if the index is equal or above the size of the roster" and it seemed to prevent part of the problem (because the safeguard was executed) but the crash still occurs. i couldn't dig yet further into the code to see how they're messing so hard with the indexes, i'll come check this thread again to see if you made any progress and share my advances as well.
I'm currently using 14 mods excluding bannerking. I'm pushing the system hard but currently there are no crashes. Then there is a big problem. One of the mods permanently deletes the save file of the game.
Tesekurler for looking into this! I looked through the guides and I may be confused about one thing. In Bannerlord 1.03.pdf you mention that Displomacy and BK can cause issues. In Bannerkings Mode.pdf you mention that Diplomacy and BK are compatible. Is it just better if I disable Diplomacy? Also I think you mentioned that Improved Garrisons and Hot butter produced the most failure, so what I'll do is remove those as well and see how things go. Let me know if I misunderstood!
It will work properly if you turn off corruption civil war feature of diplomacy mode. I doubt those mods, although I'm not entirely sure. Give it a try. The interesting thing is that there is no problem in your other modes, I created 2 different save files. There wasn't a single problem.
Hey guys, just coming in here to tell you how I resolved the problem. Looking at the RBM posts, I found out this is a common problem, it MAY be associated with RBM conflicting with some other mod. Either way, go here for the fix: https://pastebin.com/L69V7zYd
It worked for me, at least for now until the next issue arises :P
You are a legend, I've been loving the game with anno domini and I think you just saved my campaign. Possibly the best solution ive found via google in any game I've played haha!
Decent tips, despite the language barrier. If you want more information regarding mods that have been reported to be compatible (or not) with Banner Kings - see their Discord. There is a section for that. There is a lot of mods for both sides.
I'd like to say that from simply reading comments from the author - Kaoses Tweaks is being worked on to be compatible (or more compatible) with Banner Kings.
28 comments
the exception states
Exception information
Type: System.IndexOutOfRangeException
Message: Index was outside the bounds of the array.
Source: TaleWorlds.CampaignSystem
CallStack:
Exception information
Type: System.IndexOutOfRangeException
Message: Index was outside the bounds of the array.
Source: TaleWorlds.Library
CallStack:
Exception information
Type: System.IndexOutOfRangeException
Message: Index was outside the bounds of the array.
Source: TaleWorlds.Library
CallStack:
https://report.butr.link/EC024A.html
Exception information
Type: System.IndexOutOfRangeException
Message: Index was outside the bounds of the array.
Source: TaleWorlds.Library
CallStack:
Exception information
Type: System.IndexOutOfRangeException
Message: Index was outside the bounds of the array.
Source: TaleWorlds.CampaignSystem
CallStack:
index, int countChange, int woundedCountChange, int xpChange, bool
removeDepleted)
troop, int numberToRemove, UniqueTroopDescriptor troopSeed, int xp)
gameTypeLoadingState, out GameTypeLoadingStates nextState)
gameTypeLoadingState, out GameTypeLoadingStates nextState)
gameManagerLoadingStep, out GameManagerLoadingSteps nextStep)
Any ideas?
Harmony
Butterlib
UiExtenderEx
MCM v5
BannerKings
Diplomacy
Birth and Death Options
Improved Garrisons
Open Source Armory
RBM
SomeMinorTroopsAreNowFemale
Hot Butter
Peasants
More Hero Interactions
MCAmazonBody
OnGovernorChangedWorkAround
Detailed Character Creation
Sıcak Tereyağı
Geliştirilmiş Garnizonlar
Daha Fazla Kahraman Etkileşimi
OnGovernorChangedWorkAround
Worst of all, mods that conflict with BK also conflict with each other. If you give me some more time, I will try to find the solution. As for my personal comment
The two biggest failure modes
hot butler
Improved Garrisons
cheers
EDIT : i don't use bannerkings
It worked for me, at least for now until the next issue arises :P
...and I got to feel like a hacker on TV...
I'd like to say that from simply reading comments from the author - Kaoses Tweaks is being worked on to be compatible (or more compatible) with Banner Kings.