-
Notifications
You must be signed in to change notification settings - Fork 0
API Settlement Overview
Category: Settlement Management Commands: 19 commands BLGM Version: v1.3.13.4 Game Version: v1.3.13 Status: STABLE
Settlement management commands provide comprehensive control over settlements in Mount & Blade II: Bannerlord. These commands enable you to manipulate settlement properties, manage resources, control military strength, and customize settlement characteristics across all settlement types including cities, castles, villages, and hideouts.
Settlements are the core economic and military infrastructure in Bannerlord, serving as centers of trade, production, and defense. Each settlement type has unique properties and capabilities. Cities and castles have prosperity, loyalty, and security systems along with garrisons and militia. Villages have hearth values representing population and productivity. The settlement management system allows you to fine-tune economic balance, test gameplay scenarios, and customize the campaign world.
Note: Caravan creation and management commands have been moved to the Caravan Management category.
All settlement commands require campaign mode to be active. Many operations directly modify settlement state and affect gameplay mechanics, so careful consideration is recommended for maintaining game balance.
| Command | Description | Category | Status |
|---|---|---|---|
| gm.settlement.set_prosperity | Set city/castle prosperity | Properties | STABLE |
| gm.settlement.set_hearths | Set village hearth value | Properties | STABLE |
| gm.settlement.set_village_bound_settlement | Change village bound settlement | Village | STABLE |
| gm.settlement.set_village_trade_bound_settlement | Change village trade bound settlement | Village | STABLE |
| gm.settlement.rename | Rename any settlement | Properties | STABLE |
| gm.settlement.reset_name | Reset settlement to original name | Properties | STABLE |
| gm.settlement.reset_all_names | Reset all settlements to original names | Properties | STABLE |
| gm.settlement.set_culture | Change settlement culture | Properties | STABLE |
| gm.settlement.set_loyalty | Set city/castle loyalty | Properties | STABLE |
| gm.settlement.set_security | Set city/castle security | Properties | STABLE |
| gm.settlement.set_owner | Change settlement owner to hero | Ownership | STABLE |
| gm.settlement.set_owner_clan | Change settlement owner clan | Ownership | STABLE |
| gm.settlement.set_owner_kingdom | Change settlement owner kingdom | Ownership | STABLE |
| gm.settlement.upgrade_buildings | Upgrade all buildings to level | Resources | STABLE |
| gm.settlement.give_food | Add/remove food stock | Resources | STABLE |
| gm.settlement.give_gold | Add/remove treasury gold | Resources | STABLE |
| gm.settlement.add_militia | Add militia troops | Military | STABLE |
| gm.settlement.fill_garrison | Fill garrison to capacity | Military | STABLE |
| gm.settlement.spawn_wanderer | Spawn wanderer hero | NPCs | STABLE |
Commands for managing core settlement properties and characteristics.
gm.settlement.set_prosperity - Sets prosperity level for cities and castles. Prosperity affects tax income, available goods, and settlement growth. Higher prosperity increases economic output but makes settlements more valuable targets. Valid range: 0-20000.
gm.settlement.set_hearths - Sets hearth value for villages, which represents population and productivity. Hearths affect tax income, militia recruitment, and production capacity. Higher hearth values increase village economic contribution. Valid range: 0-2000.
gm.settlement.rename - Changes the display name of any settlement type. Useful for customization, role-playing scenarios, or localizing settlement names. Works on cities, castles, villages, and hideouts. Names persist through save/load cycles.
gm.settlement.reset_name - Resets a single settlement to its original game name after it has been renamed. Useful for reverting custom names.
gm.settlement.reset_all_names - Resets all renamed settlements to their original game names in one command. Useful for clearing all custom names at once.
gm.settlement.set_culture - Changes the culture of a settlement, affecting available troops, architecture style, and settlement character. Valid cultures: empire, sturgia, aserai, vlandia, battania, khuzait.
gm.settlement.set_loyalty - Sets loyalty level for cities and castles. Loyalty affects rebellion risk, tax efficiency, and local support. Low loyalty can trigger rebellion events. Valid range: 0-100.
gm.settlement.set_security - Sets security level for cities and castles. Security affects crime rate, bandit spawns, and local stability. Higher security reduces criminal activity and improves settlement safety. Valid range: 0-100.
Commands for changing settlement ownership between heroes, clans, and kingdoms.
gm.settlement.set_owner - Changes the settlement owner to a specific hero. Also updates the owner clan to the hero's clan and map faction to the hero's faction. Applies to cities and castles.
gm.settlement.set_owner_clan - Changes the settlement owner clan to a specific clan. Also updates the owner to the clan leader and map faction to the clan's kingdom. Applies to cities and castles.
gm.settlement.set_owner_kingdom - Changes the settlement owner to a kingdom's ruling clan. Also updates the owner to the kingdom ruler and map faction to the kingdom. Applies to cities and castles.
Commands for managing settlement economic resources and construction.
gm.settlement.add_construction - Adds construction points to cities and castles for building projects. Construction points determine how quickly building upgrades complete. Useful for accelerating settlement development or testing building mechanics.
gm.settlement.upgrade_buildings - Instantly upgrades all buildings in a city or castle to the specified level (0-3). Bypasses normal construction time and costs. WARNING: Level 4+ will crash the game. Useful for quickly developing settlements or creating test scenarios.
gm.settlement.give_food - Adds or removes food from settlement food stock. Food affects population growth, garrison upkeep, and siege resistance. Can use negative values to reduce food stocks. Essential for managing settlement economics and siege scenarios.
gm.settlement.give_gold - Adds or removes gold from settlement treasury. Treasury gold is used for garrison wages, construction projects, and settlement upkeep. Can use negative values to reduce treasury. Important for managing settlement financial health.
Commands for managing settlement military strength and defense.
gm.settlement.add_militia - Adds militia troops to cities and castles. Militia provide passive defense and reinforce garrisons during sieges. Militia troops are automatically generated based on settlement properties but can be manually adjusted for testing or balance.
gm.settlement.fill_garrison - Automatically fills garrison to maximum capacity using proportional troop composition. Analyzes existing garrison troops and adds more of the same types proportionally until reaching party size limit. Requires at least one troop in garrison as template.
Commands for spawning NPCs and creating caravans in settlements.
gm.settlement.spawn_wanderer - Spawns a random wanderer hero in a city or castle. The wanderer is created from available templates with proper name, portrait, and stats (age 25-35). Wanderers appear as notables and can be recruited as companions.
gm.settlement.create_notable_caravan - Creates a caravan owned by a notable in a city. Automatically finds an available notable without a caravan and assigns the new caravan to them. The caravan will trade between settlements and generate income for the notable.
gm.settlement.create_player_caravan - Creates a caravan for the player's clan in a city. Optionally assign a companion hero to lead the caravan. The caravan generates trade profits for the player's clan and can be managed like other party assets.
Most commands accept flexible settlement identification:
-
StringId - Exact game identifier (e.g.,
town_ES1,castle_B1,village_EN1) -
Partial Name - Substring match in settlement name (e.g.,
pen,pravend,zeonica)
Different commands apply to specific settlement types:
- Cities - Towns with prosperity, loyalty, security, garrisons, and militias
- Castles - Fortifications with prosperity, loyalty, security, garrisons, and militias
- Villages - Rural settlements with hearth values
- Hideouts - Bandit camps (limited functionality, mainly rename)
- Prosperity - 0 to 20000 (cities/castles only)
- Hearths - 0 to 2000 (villages only)
- Loyalty - 0 to 100 (cities/castles only)
- Security - 0 to 100 (cities/castles only)
- Construction - 0 to 100000 (cumulative points)
- Food - Any integer (can be negative to remove)
- Gold - Any integer (can be negative to remove)
- Militia - 0 to 1000 (cities/castles only)
Transform a struggling settlement into a thriving city:
gm.settlement.set_prosperity pen 15000
gm.settlement.set_loyalty pen 100
gm.settlement.set_security pen 100
gm.settlement.give_gold pen 50000
gm.settlement.give_food pen 1000
gm.settlement.add_militia pen 200
Result: Penraic becomes a highly prosperous, loyal, and secure city with substantial resources and strong defenses.
Adjust settlement economics across different territories:
gm.settlement.set_prosperity vostrum 8000
gm.settlement.give_gold vostrum 20000
gm.settlement.set_prosperity zeonica 12000
gm.settlement.give_gold zeonica 35000
Result: Balanced economic development across multiple settlements.
Improve village productivity and population:
gm.settlement.set_hearths car_pherpi 1500
gm.settlement.give_food car_pherpi 500
Result: Village has high productivity with substantial food reserves.
Prepare settlements for defensive scenarios:
gm.settlement.add_militia pravend 150
gm.settlement.fill_garrison pravend
gm.settlement.give_food pravend 2000
gm.settlement.set_loyalty pravend 100
Result: Settlement has full garrison, strong militia, ample food, and high loyalty for siege defense.
Accelerate building projects for testing:
gm.settlement.add_construction zeonica 5000
gm.settlement.give_gold zeonica 100000
Result: Settlement has substantial construction points and funds for immediate building upgrades.
Create themed or localized settlements:
gm.settlement.rename pen NewPenraic
gm.settlement.rename pravend Pravendtown
gm.settlement.rename vostrum TheVostrum
Result: Settlements have customized names for role-playing or localization.
Add wanderers and caravans to settlements:
gm.settlement.spawn_wanderer pen
gm.settlement.spawn_wanderer pravend
gm.settlement.create_notable_caravan pen
gm.settlement.create_player_caravan vostrum companion_hero
Result: Settlements have new wanderers for recruitment and active caravans for trade.
Always consider settlement type when using commands:
- Cities and castles support: prosperity, loyalty, security, militia, garrisons
- Villages only support: hearths (not prosperity)
- All settlement types support: rename, food, gold
- Attempting to set prosperity on a village will error (use
set_hearthsinstead)
Maintain balance across settlement properties:
gm.settlement.set_prosperity pen 10000
gm.settlement.set_loyalty pen 80
gm.settlement.set_security pen 70
gm.settlement.add_militia pen 100
Balanced properties provide realistic gameplay without extreme advantages.
Before using fill_garrison, ensure garrison has diverse troop types:
// First add some troops manually for diversity
gm.troop.give_hero_troops player imperial_recruit 20
gm.troop.give_hero_troops player imperial_infantry 10
// Then transfer to garrison and fill
gm.settlement.fill_garrison pen
This ensures a balanced troop composition when filling.
Prepare settlements for siege scenarios:
gm.settlement.give_food target_city 5000
gm.settlement.fill_garrison target_city
gm.settlement.set_loyalty target_city 100
High food stocks, full garrison, and maximum loyalty maximize siege resistance.
Speed up development for testing:
gm.settlement.add_construction test_city 10000
gm.settlement.give_gold test_city 200000
Large construction points allow immediate building upgrades.
Create multiple caravans for economic growth:
gm.settlement.create_player_caravan pen companion_1
gm.settlement.create_player_caravan pravend companion_2
gm.settlement.create_notable_caravan vostrum
Player caravans generate clan income, while notable caravans add to world economy.
Use wanderers to expand companion options:
gm.settlement.spawn_wanderer pen
gm.settlement.spawn_wanderer pravend
gm.settlement.spawn_wanderer vostrum
Wanderers can be recruited as companions or left as settlement notables.
Understanding the distinction:
- Cities/Castles use prosperity (0-20000)
- Villages use hearths (0-2000)
- These are separate systems - villages do NOT have prosperity
- Attempting to set prosperity on villages will fail
- Use
set_hearthsfor villages,set_prosperityfor cities/castles
Some commands use reflection to modify read-only properties:
-
add_construction- Modifies private_constructionfield -
add_militia- Modifies private_militiafield -
rename- Modifies private_namefield
This is necessary due to Bannerlord API design where these properties are read-only. These operations are stable but may be affected by game version updates.
fill_garrison respects maximum party size limits:
- Party size limit varies by settlement and faction
- Garrison will not exceed this limit
- Excess capacity may be available through upgrades
- Check party size settings if garrison seems incomplete
The give_food and give_gold commands accept negative values:
gm.settlement.give_food pen -1000 // Removes 1000 food
gm.settlement.give_gold pen -5000 // Removes 5000 gold
Be cautious with negative values to avoid depleting resources below functional levels. Settlements with insufficient food or gold may have gameplay issues.
Low loyalty can trigger rebellion events:
- Loyalty below 25 significantly increases rebellion risk
- Rebellions can cause settlement to change ownership
- Monitor loyalty after reducing it
- Set loyalty to 50+ for stable gameplay
Property changes affect gameplay mechanics:
- Prosperity - Increases tax income, trade goods, recruitment
- Hearths - Increases village production, tax income, militia
- Loyalty - Affects rebellion risk, tax efficiency, garrison morale
- Security - Reduces crime, bandit spawns, improves prosperity growth
- Militia - Provides passive defense during sieges
Balance these properties for intended gameplay experience.
Caravans can only be created in cities:
- Cities - Supported for both notable and player caravans
- Castles - Not supported
- Villages - Not supported
- Hideouts - Not supported
Notable caravans require an available notable without existing caravans. Player caravans can optionally have companion leaders.
Wanderers can be spawned in:
- Cities - Supported
- Castles - Supported
- Villages - Not supported
- Hideouts - Not supported
Spawned wanderers have age 25-35 and appear as settlement notables.
- Settlement Query Commands - Search and find settlements
- Kingdom Management Commands - Manage settlement ownership through kingdoms
- Troop Management Commands - Manage garrison troops
- Settlement Types Reference - Settlement categories and mechanics
- Factions Reference - Faction control and ownership
- Quick Start Guide - Getting started with GameMaster commands
- Best Practices - Recommended usage patterns
- Troubleshooting - Common issues and solutions
Last Updated: 2025-01-07 API Version: v1.3.13.3
🏠 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