-
Notifications
You must be signed in to change notification settings - Fork 0
API Troop upgrade_troops
Endpoint: gm.troops.upgrade_troops
gm.troops.upgrade_troops <partyLeader> [tier] [infantryRatio] [rangedRatio] [calvaryRatio]
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
partyLeader |
string | Yes | - | Query to find the party leader hero (e.g., "player", "raganvad") |
tier |
integer | No | 7 | Target tier for troop upgrades (1-7) |
infantryRatio |
float | No | 0.5 | Ratio of infantry troops to maintain (0.0-1.0) |
rangedRatio |
float | No | 0.3 | Ratio of ranged troops to maintain (0.0-1.0) |
calvaryRatio |
float | No | 0.2 | Ratio of cavalry troops to maintain (0.0-1.0) |
- Hero must be a party leader
- Hero must have a party with troops
- All ratios must add up to 1.0
- If only 1 or 2 ratios are specified, remaining ratios default to evenly split the remainder
Upgrades all troops in the hero's party to the specified tier or to the maximum tier available for that troop type if the specified tier exceeds the troop's upgrade tree. The command intelligently attempts to maintain the specified ratio of troop types (infantry, ranged, cavalry) during the upgrade process.
If a troop cannot be upgraded to the target tier (e.g., tier 7 requested but troop maxes at tier 5), the command upgrades to the highest tier possible for that troop.
Example 1: Upgrade to max tier with default ratios
gm.troops.upgrade_troops playerOutput:
Upgraded troops in Player's party to tier 7.
Infantry: 50%, Ranged: 30%, Cavalry: 20%
Party: Player's Army
Example 2: Upgrade to tier 5 with default ratios
gm.troops.upgrade_troops player 5Output:
Upgraded troops in Player's party to tier 5.
Infantry: 50%, Ranged: 30%, Cavalry: 20%
Party: Player's Army
Example 3: Upgrade with custom ratios
gm.troops.upgrade_troops raganvad 6 0.4 0.4 0.2Output:
Upgraded troops in Raganvad's party to tier 6.
Infantry: 40%, Ranged: 40%, Cavalry: 20%
Party: Raganvad's Army
Example 4: Upgrade with partial ratios
gm.troops.upgrade_troops derthert 7 0.6 0.3Output:
Upgraded troops in Derthert's party to tier 7.
Infantry: 60%, Ranged: 30%, Cavalry: 10%
Party: Derthert's Army
Note: The cavalry ratio was automatically set to 0.1 to make the total equal 1.0.
Example 5: Upgrade lord's army
gm.troops.upgrade_troops lord_1_1 6NOTE: Use gm.query.hero to find exact hero IDs if needed.
NOTE: The command respects troop upgrade trees - troops will only upgrade along their available paths.
NOTE: If a troop's maximum tier is lower than the requested tier, it will upgrade to its maximum available tier.
TIP: Use higher ratios for troop types you want to emphasize in your army composition.
TIP: Experiment with different ratios to create specialized armies (e.g., 0.7 infantry for defensive armies, 0.5 cavalry for mobile forces).
WARNING: Ratios must add up to exactly 1.0 or the command will fail validation.
WARNING: This command only works for party leaders, not party members.
The ratio system provides flexible army composition:
Default Ratios (no ratios specified):
- Infantry: 0.5 (50%)
- Ranged: 0.3 (30%)
- Cavalry: 0.2 (20%)
Partial Ratios: If you specify fewer than 3 ratios, the remaining ratios are automatically calculated to sum to 1.0:
-
gm.troops.upgrade_troops player 7 0.6→ Infantry: 0.6, Ranged: 0.2, Cavalry: 0.2 -
gm.troops.upgrade_troops player 7 0.4 0.4→ Infantry: 0.4, Ranged: 0.4, Cavalry: 0.2
Custom Ratios: All three ratios must add up to exactly 1.0:
- Valid:
0.5 0.3 0.2(sum = 1.0) - Valid:
0.33 0.33 0.34(sum = 1.0) - Invalid:
0.6 0.3 0.3(sum = 1.2)
-
gm.troops.give_xp- Give experience to all troops in party -
gm.troops.give_hero_troops- Add specific troops to party -
gm.query.troop- Search for troop types -
gm.query.hero- Search for heroes
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_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