-
Notifications
You must be signed in to change notification settings - Fork 0
COMMAND_SYNTAX_GUIDE
This guide explains the enhanced command syntax features available in Bannerlord.GameMaster console commands.
All commands follow the basic structure:
gm.category.command_name <required_arg> [optional_arg]
-
Required arguments are shown in angle brackets
<> -
Optional arguments are shown in square brackets
[]
When you need to pass multi-word text (like names with spaces), use SINGLE QUOTES:
gm.clan.create_clan 'House Torivon'
gm.hero.create_lord 'Sir Galahad' vlandia male
gm.settlement.rename pen 'Castle of Stone'Important: Use SINGLE quotes (') not double quotes ("). The TaleWorlds console system removes double quotes before passing arguments.
- Text inside single quotes is treated as a single argument
- Example:
'House Torivon'becomes one argument:House Torivon - Without quotes:
House Torivonwould be two separate arguments:HouseandTorivon
Named arguments allow you to specify arguments in any order using the syntax argName:argContent (no spaces around the colon).
argName:value
- Specify arguments in any order
- Skip optional arguments without using placeholders
- Clearer command intent
gm.hero.generate_lords 10 vlandia,battania male player_faction 0.8gm.hero.generate_lords count:10 cultures:vlandia,battania gender:male clan:player_faction randomFactor:0.8gm.hero.generate_lords 10 cultures:vlandia,battania gender:male# Want to specify clan but not cultures or gender? Use named args!
gm.hero.generate_lords count:10 clan:player_factionCombine quotes with named arguments:
gm.clan.create_clan name:'House Stark' kingdom:sturgia createParty:trueWhen specifying cultures, use commas (not semicolons) to separate multiple cultures:
gm.hero.generate_lords 10 vlandiagm.hero.generate_lords 10 vlandia,battania,sturgia
gm.clan.generate_clans 5 aserai,khuzaitUse predefined culture groups:
-
main_cultures- All main factions (Vlandia, Sturgia, Empire, Aserai, Khuzait, Battania) -
bandit_cultures- All bandit cultures -
all_cultures- Every culture in the game
gm.hero.generate_lords 20 main_cultures
gm.clan.generate_clans 10 all_cultures- Main: vlandia, sturgia, empire, aserai, khuzait, battania, nord
- Bandits: looters, desert_bandits, forest_bandits, mountain_bandits, steppe_bandits, sea_raiders
- Special: darshi, vakken
# Positional arguments
gm.hero.generate_lords 15 vlandia,battania male player_faction
# Named arguments
gm.hero.generate_lords count:15 cultures:vlandia,battania gender:male clan:player_faction
# Mixed approach
gm.hero.generate_lords 15 cultures:vlandia,battania gender:male
# With level and age
gm.hero.generate_lords count:10 cultures:vlandia clan:player_faction level:20 age:30# Positional
gm.hero.create_lord 'Sir Percival' vlandia male player_faction true
# Named arguments
gm.hero.create_lord name:'Sir Percival' cultures:vlandia gender:male clan:player_faction withParty:true
# Named with defaults
gm.hero.create_lord name:'Sir Percival' clan:player_faction
# With level and age
gm.hero.create_lord name:'Lady Elara' cultures:empire gender:female level:15 age:22
# Without party, at a settlement
gm.hero.create_lord name:'Sir Aldric' clan:player_faction withParty:false settlement:pen_cannoc level:25# Positional
gm.hero.create_companions 5 player vlandia,battania female
# Named arguments
gm.hero.create_companions count:5 hero:player cultures:vlandia,battania gender:female
# Skip optional arguments
gm.hero.create_companions count:5 hero:player gender:female
# With level and age
gm.hero.create_companions count:3 hero:player cultures:empire level:10 age:25# Positional
gm.clan.create_clan 'House Stark' null sturgia true 5
# Named arguments (clearer!)
gm.clan.create_clan name:'House Stark' kingdom:sturgia createParty:true companionCount:5
# Skip optional arguments
gm.clan.create_clan name:'House Stark' kingdom:sturgia# Positional
gm.clan.generate_clans 10 vlandia,battania empire true 3
# Named arguments
gm.clan.generate_clans count:10 cultures:vlandia,battania kingdom:empire createParties:true companionCount:3
# Using defaults
gm.clan.generate_clans count:10 cultures:vlandia,battania# Positional
gm.settlement.spawn_wanderer pen 'Wandering Bard' vlandia,empire female 0.8
# Named arguments
gm.settlement.spawn_wanderer settlement:pen name:'Wandering Bard' cultures:vlandia,empire gender:female randomFactor:0.8
# Auto-generate name
gm.settlement.spawn_wanderer settlement:pen cultures:vlandia gender:female# Multi-word names require quotes
gm.settlement.rename pen 'Castle of Stone'
# Named argument version
gm.settlement.rename settlement:pen name:'Castle of Stone'# Positional
gm.item.add imperial_sword 5 player masterwork
# Named arguments
gm.item.add item:imperial_sword count:5 hero:player modifier:masterwork
# Without modifier
gm.item.add item:imperial_sword count:5 hero:player- Use quotes for multi-word text: Always use single quotes for names with spaces
- Use named arguments for clarity: When commands have many optional parameters, named arguments make intent clearer
- Mix approaches as needed: You can use positional for required args and named for optionals
-
Use commas for cultures: Separate multiple cultures with commas (no spaces):
vlandia,battania,empire -
No spaces around colons: Named arguments must be
name:valuenotname: valueorname :value
'text with spaces' # Correct - single quotes
"text with spaces" # Wrong - double quotes don't work
text_without_spaces # OK - no quotes neededname:value # Correct
name:value # Correct - no spaces
name: value # Wrong - space after colon
name :value # Wrong - space before colon
name : value # Wrong - spaces around colonvlandia,battania,empire # Correct - commas, no spaces
vlandia, battania # Wrong - space after comma
vlandia;battania # Old syntax - no longer works
main_cultures # Correct - predefined groupIf you have old commands using semicolons, update them to use commas:
gm.hero.generate_lords 10 vlandia;battania;sturgia
gm.clan.generate_clans 5 aserai;khuzait empiregm.hero.generate_lords 10 vlandia,battania,sturgia
gm.clan.generate_clans 5 aserai,khuzait empireIssue: Multi-word names not working
gm.clan.create_clan House Stark # Wrong - treated as two argumentsSolution: Use single quotes
gm.clan.create_clan 'House Stark' # CorrectIssue: Named argument not recognized
gm.hero.generate_lords count: 10 # Wrong - space after colonSolution: Remove spaces
gm.hero.generate_lords count:10 # CorrectIssue: Cultures not parsing
gm.hero.generate_lords 10 vlandia;battania # Wrong - semicolons no longer workSolution: Use commas
gm.hero.generate_lords 10 vlandia,battania # Correct- Quote parsing: Single-quoted strings are combined into single arguments
-
Named argument detection: Arguments containing
:are parsed as name:value pairs - Positional argument extraction: Remaining arguments are treated as positional
- All commands support both positional and named arguments
- Old commands without named arguments still work as before
- Mixing positional and named arguments is fully supported
- Quote parsing is handled automatically by the
Cmd.Runwrapper
For more examples and command-specific documentation, use the help commands:
gm.help
gm.hero.help
gm.clan.help🏠 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_owner
- gm.settlement.set_owner_clan
- 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