-
Notifications
You must be signed in to change notification settings - Fork 0
API Query Troop troop
Endpoint: gm.query.troop
gm.query.troop [search_terms...] [type_flags...] [sort:field[:order]]
Search and list troops based on search terms, type filters, tier levels, and sorting options. Supports AND logic (all specified filters must match). The system automatically filters out heroes, lords, and non-combat NPCs to show only actual military units.
| Parameter | Type | Required | Description |
|---|---|---|---|
search_terms |
string | No | Text to match against troop name or ID |
type_flags |
flags | No | Filter by troop types (see Type Flags below) |
sort:field[:order] |
string | No | Sort results (see Sorting Options below) |
Formation Types:
-
infantry- Infantry formation troops -
ranged- Ranged formation troops (archers) -
cavalry- Cavalry formation troops (mounted melee) -
horsearcher- Horse archer formation troops (mounted ranged) -
mounted- All mounted troops (cavalry + horse archers)
Troop Line Types:
-
regular- Regular/main culture troop line -
noble- Noble/elite troop line (knights, nobles) -
militia- Militia/garrison troops -
mercenary- Mercenary troops -
caravan- Caravan guards, caravan masters, armed traders -
peasant- Combat-capable villagers and townsfolk -
minorfaction- Minor faction troops (Eleftheroi, Brotherhood, etc.)
Equipment Types:
-
shield- Troops with shields -
2h/twohanded- Troops with two-handed weapons -
polearm- Troops with polearms -
bow- Troops with bows -
crossbow- Troops with crossbows -
throwing- Troops with throwing weapons
Tier Keywords:
-
tier0throughtier6- Tier 0-6 troops -
tier6plus- Tier 6+ troops (includes tier 7+ if modded)
Culture Keywords:
-
empire- Empire culture troops -
vlandia- Vlandian culture troops -
sturgia- Sturgian culture troops -
aserai- Aserai culture troops -
khuzait- Khuzait culture troops -
battania- Battanian culture troops -
nord- Nord culture troops (Warsails DLC) -
bandit- Bandit culture troops
-
sort:id- Sort by StringId (default) -
sort:name- Sort alphabetically by name -
sort:tier- Sort by tier level (0-6+) -
sort:level- Sort by troop level -
sort:culture- Sort by culture name -
sort:occupation- Sort by occupation type -
sort:formation- Sort by formation class -
sort:[type_flag]- Sort by any type flag (e.g.,sort:noble,sort:cavalry)
Add :desc for descending order or :asc for ascending (default):
-
sort:tier:desc- Sort by tier, highest first -
sort:level:desc- Sort by level, highest first
Basic search by name:
gm.query.troop legionary
gm.query.troop archer
gm.query.troop knightFilter by formation type:
gm.query.troop infantry
gm.query.troop ranged
gm.query.troop cavalry
gm.query.troop horsearcherFilter by equipment type:
gm.query.troop shield
gm.query.troop bow
gm.query.troop crossbow
gm.query.troop polearmFilter by tier:
gm.query.troop tier3
gm.query.troop tier5
gm.query.troop tier6plusFilter by culture:
gm.query.troop empire
gm.query.troop vlandia
gm.query.troop battaniaCombined filtering:
gm.query.troop imperial infantry tier3
gm.query.troop battania ranged bow tier4
gm.query.troop empire cavalry noble tier5
gm.query.troop vlandia infantry shield tier2Sort results:
gm.query.troop sort:name
gm.query.troop sort:tier:desc
gm.query.troop cavalry sort:level:desc
gm.query.troop infantry sort:cultureComplex queries:
gm.query.troop empire cavalry noble tier5 sort:level:desc
gm.query.troop battania infantry shield tier3 sort:name
gm.query.troop aserai horsearcher tier4 sort:tierSuccess:
Found N troop(s) matching [criteria]:
[StringId] [Name] [Category] Tier: [Tier] Level: [Level] Culture: [Culture] Formation: [Formation]
Example output:
Found 3 troop(s) matching search: 'imperial', types: cavalry:
imperial_cavalry Imperial Cavalry [Regular] Tier: 3 Level: 18 Culture: Empire Formation: Cavalry
imperial_elite_cavalry Imperial Elite Cavalry [Noble/Elite] Tier: 5 Level: 30 Culture: Empire Formation: Cavalry
imperial_cataphract Imperial Cataphract [Noble/Elite] Tier: 6 Level: 32 Culture: Empire Formation: Cavalry
The system automatically excludes:
- Heroes and lords (use hero query commands)
- Town NPCs (merchants, blacksmiths, etc.)
- Wanderers and companions
- Children and teenagers
- Templates and test characters
- Non-combat civilians
NOTE: Troops are CharacterObjects representing nameless units. Heroes and lords are NOT troops - use hero query commands for them.
TIP: The category display (e.g., [Regular], [Noble/Elite]) helps quickly identify troop classification.
TIP: Start broad with formation type, then narrow with tier and culture filters.
-
gm.query.troop_any- Search with OR logic -
gm.query.troop_info- Get detailed troop information -
API-Query-Overview- All query commands
Last Updated: 2025-12-16
🏠 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