-
Notifications
You must be signed in to change notification settings - Fork 0
API Troop Overview
Category: Troop Management Commands: 7 commands API Version: 1.3.13.1 Status: STABLE
Troop management commands provide control over military units in Mount & Blade II: Bannerlord. These commands enable you to add troops (nameless soldiers) to hero parties, upgrade existing troops to higher tiers, grant experience points for troop progression, and manage army composition. Build powerful armies, reinforce companions, or strengthen allied lords for military campaigns.
Troops are CharacterObjects representing nameless military units such as infantry, archers, cavalry, and specialized units. Unlike heroes, troops exist as quantities rather than individual characters. The troop management system allows you to rapidly assemble armies of specific unit types, create balanced force compositions, upgrade troops through their progression trees, and test military scenarios without the time investment of traditional recruitment and training.
All troop commands require campaign mode to be active. Heroes must have valid parties to receive troops, and standard party size limits still apply. Troops are added immediately to party rosters, ready for deployment in battles and sieges.
| Command | Description | Category | Status |
|---|---|---|---|
| gm.troops.give_hero_troops | Add specific troops to hero party | Distribution | STABLE |
| gm.troops.add_basic | Add basic tier troops from leader's culture | Bulk Addition | STABLE |
| gm.troops.add_elite | Add elite tier troops from leader's culture | Bulk Addition | STABLE |
| gm.troops.add_mercenary | Add random mercenary troops | Bulk Addition | STABLE |
| gm.troops.add_mixed | Add mixed tier troops (basic, elite, mercenary) | Bulk Addition | STABLE |
| gm.troops.upgrade_troops | Upgrade all troops to specified tier with ratio control | Troop Progression | STABLE |
| gm.troops.give_xp | Add experience points to all troops in party | Troop Progression | STABLE |
Commands for distributing specific military units to hero parties.
gm.troops.give_hero_troops - Adds a specified number of troops to a hero's party. This is the primary method for adding specific troop types. Supports any troop type (infantry, archers, cavalry, etc.) and can add up to 10,000 troops per command. The hero must have a party, and the troop cannot be a hero character (only regular units). Works for any hero in a party, not just party leaders.
Commands for quickly adding culture-based troops to party leaders. These commands only work for heroes who are party leaders.
gm.troops.add_basic - Adds basic tier troops from the party leader's culture. The troop type is automatically determined by the leader's culture (e.g., Vlandian Recruits, Imperial Recruits). Quick way to build entry-level armies without specifying exact troop IDs.
gm.troops.add_elite - Adds elite tier troops from the party leader's culture. Provides high-tier units based on the culture's elite troop pool. Useful for creating powerful armies quickly without looking up specific elite unit names.
gm.troops.add_mercenary - Adds random mercenary troops from the party leader's culture. Troops are randomly selected from the culture's mercenary pool, providing variety and specialized units.
gm.troops.add_mixed - Adds mixed tier troops (basic, elite, and mercenary) in equal proportions. The count parameter specifies how many of EACH type to add, resulting in 3x total troops. Perfect for creating balanced, diverse armies quickly.
Commands for upgrading existing troops and managing their experience. These commands only work for party leaders.
gm.troops.upgrade_troops - Upgrades all troops in the party to a specified tier (default tier 7) while maintaining desired unit type ratios. Intelligently upgrades troops through their upgrade trees, respecting maximum tier limits for each troop type. Allows customization of infantry, ranged, and cavalry ratios to create specialized army compositions.
gm.troops.give_xp - Adds experience points to all troops in the party. Provides rapid troop progression without requiring combat. Troops gain XP and can naturally level up and become eligible for upgrades. Essential for quickly preparing armies for battle or testing different troop progression scenarios.
The troop query parameter accepts:
-
StringId - Exact troop identifier (e.g.,
imperial_recruit,battanian_fian_champion) -
Partial Name - Substring match in troop name (e.g.,
imperial,fian,knight) - Searches all CharacterObjects representing troops
The hero query parameter accepts:
-
StringId - Exact hero identifier (e.g.,
lord_1_1,wanderer_empire_1) - Partial Name - Substring match in hero name
-
Special Keywords -
playerfor the player character
- Range: 1 to 10,000 troops per command
- Type: Integer
- Troops are added immediately to party roster
Create a balanced force using culture-based commands:
gm.troops.add_mixed player 20
Result: Player receives 60 troops (20 basic + 20 elite + 20 mercenary) from their culture.
Create a basic balanced force for the player:
gm.troops.give_hero_troops player imperial_recruit 50
gm.troops.give_hero_troops player battanian_tribesman 50
gm.troops.give_hero_troops player aserai_recruit 30
Result: Player receives 130 recruits from multiple cultures for diverse army composition.
Build a powerful army quickly:
gm.troops.add_elite player 50
Result: Player receives 50 elite troops from their culture.
Or build with specific high-tier troops:
gm.troops.give_hero_troops player imperial_legionary 30
gm.troops.give_hero_troops player battanian_fian_champion 20
gm.troops.give_hero_troops player vlandian_knight 15
gm.troops.give_hero_troops player imperial_elite_cataphract 10
Result: Player has an elite 75-troop force with specialized high-tier units.
Strengthen allied party leaders:
gm.troops.add_basic derthert 100
gm.troops.add_elite derthert 30
Result: Derthert receives 100 basic and 30 elite Vlandian troops.
Give troops to companions in your party (note: companions are usually not party leaders):
gm.troops.give_hero_troops companion_name imperial_infantry 25
gm.troops.give_hero_troops companion_name empire_horseman 10
Result: Companion receives 35 troops for independent operations.
Create a tactically balanced force:
gm.troops.give_hero_troops player imperial_legionary 40
gm.troops.give_hero_troops player imperial_archer 30
gm.troops.give_hero_troops player imperial_cavalry 20
gm.troops.give_hero_troops player imperial_cataphract 10
Result: 100-troop army with 40% infantry, 30% archers, 30% cavalry.
Upgrade existing troops to battle-ready status:
gm.troops.give_xp player 2000
gm.troops.upgrade_troops player 6
Result: All troops gain 2000 XP and are upgraded to tier 6, creating an elite fighting force.
Create a specialized cavalry-focused army:
gm.troops.upgrade_troops player 7 0.3 0.2 0.5
Result: Army upgraded to tier 7 with 30% infantry, 20% ranged, 50% cavalry - perfect for mobile warfare.
Natural progression from recruits to veterans:
gm.troops.give_hero_troops player imperial_recruit 100
gm.troops.give_xp player 1000
gm.troops.upgrade_troops player 4
Result: Start with 100 recruits, give them combat experience, upgrade to tier 4 - simulating campaign progression.
Before adding troops, use query commands to find exact troop identifiers:
gm.query.troop imperial tier3
gm.query.troop battanian ranged tier4
gm.query.troop cavalry tier5 sort:level:desc
This ensures you're adding the correct troop type and helps discover available units.
When building armies, consider troop upgrade trees:
- Add lower-tier troops for natural progression
- Add high-tier troops for immediate power
- Mix tiers for balanced costs and effectiveness
Remember that party size limits still apply:
- Check hero's party size capacity before adding troops
- Commands may fail if party is at maximum capacity
- Clan tier affects maximum party size
Create effective armies with balanced composition:
- 40-50% Infantry (frontline, shield wall)
- 30-40% Archers (ranged support)
- 20-30% Cavalry (flanking, pursuit)
Adjust ratios based on tactical preferences and terrain.
Combine XP and upgrade commands for optimal army development:
- Use
gm.troops.give_xpto prepare troops for upgrades - Then use
gm.troops.upgrade_troopsto execute upgrades with desired ratios - Start with lower tiers for cost-effective progression
- Jump to high tiers when immediate power is needed
Different cultures have specialized strengths:
- Imperial - Balanced units, strong heavy infantry
- Vlandia - Excellent heavy cavalry
- Sturgia - Superior infantry
- Aserai - Fast cavalry, mobile archers
- Khuzait - Mounted archers, horse archers
- Battania - Elite archers (Fian Champions)
Heroes must belong to a party to receive troops:
- Wanderers without parties cannot receive troops
- Imprisoned heroes typically lack parties
- Dead heroes cannot receive troops
Use hero query commands to verify party status first.
The command only accepts regular troop CharacterObjects:
- Heroes (lords, companions, wanderers) cannot be added as troops
- Named characters must be recruited through normal game mechanics
- Attempting to add heroes generates an error
If a hero is not their party's leader (e.g., companion in player party):
- Troops are still added successfully
- Troops go to the party the hero belongs to
- Party leader retains command of all troops
- This is normal behavior for party members
Troops are added to the party roster immediately:
- No recruitment time required
- No morale impact from instant addition
- Troops are ready for immediate deployment
- Party wages increase based on troop count and tier
Higher-tier troops provide:
- Better combat performance
- Higher wages (increased costs)
- Better equipment
- Superior stats and abilities
Balance cost vs. effectiveness based on your needs.
- Hero Management Commands - Manage heroes who command troops
- Clan Management Commands - Clan resources for troop wages
- Query Commands - Search for troop types
For finding specific troops before adding:
-
gm.query.troop- Search troops by name, culture, tier -
gm.query.troop <name> <filters>- Filter by tier, equipment type -
gm.query.troop <culture> <tier> sort:level:desc- Sorted results
- Cultures Reference - Cultural troop specializations
- Factions Reference - Faction-specific units
- Quick Start Guide - Getting started with GameMaster commands
- Best Practices - Recommended usage patterns
- Troubleshooting - Common issues and solutions
Last Updated: 2025-12-27 API Version: 1.3.13.1
🏠 Home | Quick Reference | Syntax Guide
Hero Commands
- gm.hero.abort_pregnancy
- gm.hero.add_gold
- gm.hero.add_hero_to_party
- gm.hero.create_companions
- gm.hero.create_lord
- gm.hero.create_party
- gm.hero.divorce
- gm.hero.edit_appearance
- gm.hero.edit_party
- gm.hero.equip_hero
- gm.hero.export_character
- gm.hero.generate_lords
- gm.hero.give_birth
- gm.hero.heal
- gm.hero.import_character
- gm.hero.impregnate
- gm.hero.imprison
- gm.hero.kill
- gm.hero.list_appearances
- gm.hero.list_characters
- gm.hero.list_developments
- gm.hero.list_traits
- gm.hero.load_appearance
- gm.hero.load_character
- gm.hero.load_development
- gm.hero.load_traits
- gm.hero.marry
- gm.hero.open_inventory
- gm.hero.release
- gm.hero.remove_clan
- gm.hero.rename
- gm.hero.save_appearance
- gm.hero.save_development
- gm.hero.save_traits
- gm.hero.set_age
- gm.hero.set_clan
- gm.hero.set_culture
- gm.hero.set_gold
- gm.hero.set_relation
- gm.hero.start_convrsation
Clan Commands
- gm.clan.add_gold
- gm.clan.add_gold_leader
- gm.clan.add_hero
- gm.clan.add_renown
- gm.clan.create_clan
- gm.clan.create_minor_clan
- gm.clan.destroy
- gm.clan.edit_banner
- gm.clan.equip_heroes
- gm.clan.generate_clans
- gm.clan.give_gold
- gm.clan.rename
- gm.clan.set_culture
- gm.clan.set_gold
- gm.clan.set_leader
- gm.clan.set_renown
- gm.clan.set_tier
- gm.clan.sync_kingdom_colors
Kingdom Commands
- gm.kingdom.add_clan
- gm.kingdom.call_ally_to_war
- gm.kingdom.create_kingdom
- gm.kingdom.declare_alliance
- gm.kingdom.declare_war
- gm.kingdom.destroy
- gm.kingdom.edit_banner
- gm.kingdom.equip_heroes
- gm.kingdom.generate_kingdoms
- gm.kingdom.get_tribute_info
- gm.kingdom.make_peace
- gm.kingdom.pay_tribute
- gm.kingdom.remove_clan
- gm.kingdom.rename
- gm.kingdom.set_ruler
- gm.kingdom.sync_vassal_banners
- gm.kingdom.trade_agreement
Settlement Commands
- gm.settlement.add_militia
- gm.settlement.fill_garrison
- gm.settlement.give_food
- gm.settlement.give_gold
- gm.settlement.rename
- gm.settlement.reset_names
- gm.settlement.set_culture
- gm.settlement.set_hearths
- gm.settlement.set_loyalty
- gm.settlement.set_prosperity
- gm.settlement.set_security
- gm.settlement.set_village_bound_settlement
- gm.settlement.set_village_trade_bound_settlement
- gm.settlement.spawn_wanderer
- gm.settlement.upgrade_buildings
Item Commands
- gm.item.add
- gm.item.equip
- gm.item.equip_slot
- gm.item.list_equipped
- gm.item.list_inventory
- gm.item.load_equipment
- gm.item.load_equipment_both
- gm.item.load_equipment_civilian
- gm.item.remove
- gm.item.remove_all
- gm.item.remove_equipped
- gm.item.remove_equipped_modifier
- gm.item.save_equipment
- gm.item.save_equipment_both
- gm.item.save_equipment_civilian
- gm.item.set_equipped_modifier
- gm.item.set_inventory_modifier
- gm.item.transfer
- gm.item.unequip
- gm.item.unequip_all
- gm.item.unequip_slot
Query Commands
- gm.query.character_objects
- gm.query.character_objects_any
- gm.query.character_objects_info
- gm.query.clan
- gm.query.clan_any
- gm.query.clan_info
- gm.query.culture
- gm.query.culture_info
- gm.query.hero
- gm.query.hero_any
- gm.query.hero_info
- gm.query.item
- gm.query.item_any
- gm.query.item_info
- gm.query.kingdom
- gm.query.kingdom_any
- gm.query.kingdom_info
- gm.query.modifier_info
- gm.query.modifiers
- gm.query.settlement
- gm.query.settlement_any
- gm.query.settlement_info
- gm.query.troop
- gm.query.troop_any
- gm.query.troop_info