0 of 0

File information

Last updated

Original upload

Created by

sam6358

Uploaded by

sam6358

Virus scan

Safe to use

Tags for this mod

About this mod

This mod is "PARTY AI OVERHAUL AND COMMANDS" for the game version v1.0.3.

Requirements
Permissions and credits
Translations
  • Ukrainian
  • Turkish
  • Spanish
  • Russian
  • Portuguese
  • Polish
  • Korean
Changelogs
This mod is "PARTY AI OVERHAUL AND COMMANDS" for the game version v1.0.3.

I revised this original source code.
https://gitlab.com/octaviusmods/bannerlord-party-ai-overhaul-and-commands

Thank you to the author.


---------------------------------------------------

Required Mod
+ Harmony

Order of the mods


Q. I have disabled this mod and my save data crashes in vanilla. What should I do?
A. You will need to reset the elements that utilize the functionality of this mod.
e.g.
If you join the kingdom as a mercenary and use the features of this mod to create an army, you must disband the army before disabling this mod.
Because in vanilla mercenaries cannot be army leaders.


Q. How do I translate into different languages?
A. You can use "Localization_english.xml" as a template for translation.

How to create a translation file
+ Localization template file : PartyAIOverhaulCommands\ModuleData\Languages\English\Localization_english.xml
+ Copy the "English" folder and rename it appropriately.
+ Rename "Localization_english.xml" in the folder to an appropriate name.
+ Please change the value of "tag language" in the xml file to the language you want to translate.
   (The language displayed in the Gameplay - Language section of the game options.)
* The game will load the files located under the ModuleData\Languages folder at startup.
   If you change the contents of the translation file, you will need to re-launch the launcher.
* Please note that changes to the English text will not be reflected in the game.

Q. How do I use My Little Warband and this mod together?
A. Please refer to the following guide.
I can confirm that using My Little Warband (1.7) with Party AI Overhaul Commands Rebuild (1.7) does allow your parties to recruit your custom troops exclusively. Following these steps will cause any troops your parties recruit to automatically transform into your custom troops, regardless of what faction they recruit from*:

1.) Using My Little Warband (default settings), create your custom desired troops for both recruit and elite trees.
2.) Using Party AI Overhaul (default settings), after forming your desired party, talk to the party leader.
3.) Select > "Let's review your party's composition plan."
4.) Select > "Let's decide what troops you should recruit."
5.) Under "Available Troop Trees" hit the transfer all button until all the troops on the right are transferred to the left.
6.) Select > "Let's have a closer look."
7.) Do not change anything here. Select > Done.
8.) Finally, you will be asked if you wish to recruit from prisoners. Select > "No." (Choosing "Yes" will allow them to recruit looters. However, after testing, looter troops recruited by parties stay looters and do not transform into your custom troops. So Select > "Yes" if you don't mind having looters mixed in with your custom troops.)

For some reason, I personally have found that doing this any other way causes the party never to recruit anyone.

*Please note that this will allow only the player's parties the ability to recruit your custom troops. If you would like other AI lords to be able to recruit your custom troops also, then you will need to change the xml settings in My Little Warband.
This guide was created by arcwolf9.

About the option "DEBUG : Detection of the lords party with no leader hero"
If this option is enabled, the mod will detect the appearance of a party of lords without a leader hero.
Detection results are written to a harmony.log.txt file that is created on the desktop.


* When a leader hero is set, the mod remembers the location where the setting command was issued.
* The location where the first null setting command is issued is written to the log file as "**StackTrace (General type)".
* If a party is found with the leader hero set to null, the in-game date/party information/leader hero setting history is written to the log file.


If a party is found without a leader hero, there may be a hint in the setting history as to which mod is involved.

Q. Why are parties whose leader hero is set to null in General type sometimes not detected?
A. Parties managed by the game system are not subject to detection.

The following is an example of detection results.
* A party without a leader hero was detected on "Autumn 12, 1100".
* On "Autumn 11, 1100" the leader hero of the party was set to "Mitela".
* The code executed on "Autumn 12, 1100" resulted in the leader hero being null.
* Therefore, there is most likely a problem with the code executed on "Autumn 12, 1100".
================================ harmony.log.txt ================================
**StackTrace (General type) : Mitela's Party : null : lord_4_24_2_party_19896
at TaleWorlds.DotNet.Managed.GetStackTraceStr(Int32 skipCount)
at PartyAiOverhaulAndCommands.Behaviors.PAO_DetectNoLeaderHeroParty.PAO_ChangePartyLeaderPatch.Postfix(PartyComponent __instance, Hero newLeader)
at TaleWorlds.CampaignSystem.Party.PartyComponents.LordPartyComponent.ChangePartyLeader_Patch2(LordPartyComponent this, Hero newLeader)
at TaleWorlds.CampaignSystem.Roster.TroopRoster.AddToCountsAtIndex_Patch1(TroopRoster this, Int32 index, Int32 countChange, Int32 woundedCountChange, Int32 xpChange, Boolean removeDepleted)
at TaleWorlds.CampaignSystem.Roster.TroopRoster.AddToCounts_Patch2(TroopRoster this, CharacterObject character, Int32 count, Boolean insertAtFront, Int32 woundedCount, Int32 xpChange, Boolean removeDepleted, Int32 index)
at TaleWorlds.CampaignSystem.Clan.CreateNewMobileParty(Hero hero)
at Helpers.MobilePartyHelper.CreateNewClanMobileParty(Hero partyLeader, Clan clan, Boolean& leaderCameFromMainParty)
at PartyAiOverhaulAndCommands.Behaviors.PAO_DetectNoLeaderHeroParty.ForceCreateLordParty(List`1 strings)
at TaleWorlds.Library.CommandLineFunctionality.CallFunction(String concatName, String concatArguments, Boolean& found)
at ManagedCallbacks.LibraryCallbacksGenerated.Managed_CallCommandlineFunction(IntPtr functionName, IntPtr arguments)



--------------------------- Autumn 12, 1100 ---------------------------
** The mod has found a party of lords with no leader hero **
MobilePartyName : Mitela's Party
     LeaderHero : null
          Owner : Mitela
           Clan : dey Cortain
        Kingdom : Vlandia
       StringID : lord_4_24_2_party_19896

**StackTrace : dey Cortain's Party : Mitela : lord_4_24_2_party_19896 : Autumn 11, 1100
at TaleWorlds.DotNet.Managed.GetStackTraceStr(Int32 skipCount)
at PartyAiOverhaulAndCommands.Behaviors.PAO_DetectNoLeaderHeroParty.PAO_ChangePartyLeaderPatch.Postfix(PartyComponent __instance, Hero newLeader)
at TaleWorlds.CampaignSystem.Party.PartyComponents.LordPartyComponent.ChangePartyLeader_Patch2(LordPartyComponent this, Hero newLeader)
at TaleWorlds.CampaignSystem.Actions.TeleportHeroAction.ApplyInternal(Hero hero, Settlement targetSettlement, MobileParty targetParty, TeleportationDetail detail)
at TaleWorlds.CampaignSystem.CampaignBehaviors.TeleportationCampaignBehavior.ApplyImmediateTeleport(TeleportationData data)
at TaleWorlds.CampaignSystem.CampaignBehaviors.TeleportationCampaignBehavior.HourlyTick()
at TaleWorlds.CampaignSystem.MbEvent.InvokeList(EventHandlerRec list)
at TaleWorlds.CampaignSystem.CampaignEvents.HourlyTick()
at TaleWorlds.CampaignSystem.CampaignEventDispatcher.HourlyTick()
at TaleWorlds.CampaignSystem.Campaign.HourlyTick(MBCampaignEvent campaignEvent, Object[] delegateParams)
at TaleWorlds.CampaignSystem.MBCampaignEvent.RunHandlers(Object[] delegateParams)
at TaleWorlds.CampaignSystem.MBCampaignEvent.CheckUpdate()
at TaleWorlds.CampaignSystem.CampaignPeriodicEventManager.SignalPeriodicEvents()
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(Single dt)
at TaleWorlds.DotNet.Managed.ApplicationTick(Single dt)


**StackTrace : Mitela's Party : null : lord_4_24_2_party_19896 : Autumn 12, 1100
at TaleWorlds.DotNet.Managed.GetStackTraceStr(Int32 skipCount)
at PartyAiOverhaulAndCommands.Behaviors.PAO_DetectNoLeaderHeroParty.PAO_ChangePartyLeaderPatch.Postfix(PartyComponent __instance, Hero newLeader)
at TaleWorlds.CampaignSystem.Party.PartyComponents.LordPartyComponent.ChangePartyLeader_Patch2(LordPartyComponent this, Hero newLeader)
at TaleWorlds.CampaignSystem.Roster.TroopRoster.AddToCountsAtIndex_Patch1(TroopRoster this, Int32 index, Int32 countChange, Int32 woundedCountChange, Int32 xpChange, Boolean removeDepleted)
at TaleWorlds.CampaignSystem.Roster.TroopRoster.AddToCounts_Patch2(TroopRoster this, CharacterObject character, Int32 count, Boolean insertAtFront, Int32 woundedCount, Int32 xpChange, Boolean removeDepleted, Int32 index)
at TaleWorlds.CampaignSystem.Clan.CreateNewMobileParty(Hero hero)
at Helpers.MobilePartyHelper.CreateNewClanMobileParty(Hero partyLeader, Clan clan, Boolean& leaderCameFromMainParty)
at PartyAiOverhaulAndCommands.Behaviors.PAO_DetectNoLeaderHeroParty.ForceCreateLordParty(List`1 strings)
at TaleWorlds.Library.CommandLineFunctionality.CallFunction(String concatName, String concatArguments, Boolean& found)
at ManagedCallbacks.LibraryCallbacksGenerated.Managed_CallCommandlineFunction(IntPtr functionName, IntPtr arguments)
================================ harmony.log.txt ================================

Tips
* All - (very rare)If the crash occurs when you let the companion party attack enemies with the Left-ALT key, you may be able to avoid it by following the steps below.
  + Start up with this mod disabled.
  + Load a save that the CTD is happening to. 
  + Save game to a new save and shut down.
  + Restart the game with mod enabled and load that new save.
* e1.6.1b to e1.6.5 - When the kingdom you belong to is at war, the auto-reunion function will work. If you want to disband an army, use the "Disband Army" button on the army management screen.
* e1.6.0 only - Leave the number of troops limit at 1 (it will crash if you increase it)

* v2.4.13 only - The troop recruitment screen will start working properly after you hit the reset button.

How to install
* Vortex (open-source mod manager from Nexus Mods)
OR
  • Download this mod
  • Extract the ZIP file (Recommend 7-ZIP)
  • Copy the "PartyAIOverhaulCommands" folder to Mount & Blade II Bannerlord / Modules
  • Running the Mount & Blade II Bannerlord Launcher
  • Press Mods to enable "PartyAIOverhaulCommands" & "Harmony"
  • Press play


Changes in version e1.6.2g
* Fixed an issue where creating a new party in vanilla would give them food that exceeded their maximum weight and slow down their movement speed.
* Attempted to fix a crash that occurred when the player became a prisoner.
* Added "Stop taking prisoners, except for the leading nobility" to roam and patrol orders.
* Localization Template is now included.


Changes in version e1.6.1d
* Fixed a crash when a player becomes a prisoner.

Changes in version e1.6.1c
* Fixed a crash when disbanding an army while the player does not belong to a kingdom.
* Fixed an issue where the army reunion option was not working.


Changes in version e1.6.1b
* Fixed an issue where the army would be forcibly disbanded when peace or war was declared.
* Fixed a bug that caused the lord to go missing.
* Added an item to the conversation screen with the companion that allows you to set options for the mod.
* If a player's army is disbanded due to lack of cohesion or party members, it will now automatically reunite.(Only if the kingdom you belong to is at war.)
+* The option has an interval to remember the members of the army.(I just noticed that it was still fixed to 3 days internally. I will fix it in the next update.)
* You can now manually upgrade your companion's troops in the troop transfer screen.(The automatic upgrade is also working.)
* Fixed an issue where troops were receiving experience when opening the item exchange screen after a battle with an enemy.
* Added the ability to reset all templates for troop composition.
* Optionally, you can add a mark at the end of the string used by this mod.
* Optionally, you can now disable the vanilla muster rules in the army composition screen and call a companion party.
* Fixed an issue where the cheat command "campaign.take_hero_prisoner" was not recognized even if the spaces in the hero name were connected with "_".

---------------------------------------------------

Support Mod "Debug Print"

If you are suffering from unexplained crashes, this mod may be able to help.
This mod accesses the runtime debug information of the game and outputs the contents to a log file.

Output file
DebugPrint/DebugMessage.txt

Output contents
If normal, the output will be in the following format.
===========================================
**Mono : opening ..\..\Modules\Native/ModuleData/action_sets.xml
**StackTrace : 
at TaleWorlds.DotNet.Managed.GetStackTraceStr(Int32 skipCount)
at DebugPrint.DebugPrint.Debug_OnPrint(String arg1, UInt64 arg2)
at TaleWorlds.Library.Debug.Print(String message, Int32 logLevel, DebugColor color, UInt64 debugFilter)
at TaleWorlds.ObjectSystem.MBObjectManager.CreateDocumentFromXmlFile(String xmlPath, String xsdPath, Boolean forceSkipValidation)
at TaleWorlds.ObjectSystem.MBObjectManager.CreateMergedXmlFile(List`1 toBeMerged, List`1 xsltList, Boolean skipValidation)
at TaleWorlds.ObjectSystem.MBObjectManager.GetMergedXmlForNative(String id, List`1& usedPaths)
at TaleWorlds.MountAndBlade.Module.CreateProcessedActionSetsXMLForNative()
===========================================
"**Mono" is the debug message that the mod got from the game.
"**StackTrace" is the function that was executed. (Read from bottom to top)

If an exception occurs, the following output format will be used.
===========================================
Exception  : ThrowArgumentException
Type       : ArgumentException
Message    : An item with the same key has already been added.
Object     : mscorlib
Module     : C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll
Sender     : TaleWorlds.MountAndBlade.Launcher.exe
StackTrace : 
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
===========================================


How to install
* Vortex
OR
* Copy the folder for this mod into the "Mount & Blade II Bannerlord / Modules" folder.