Skip to content

API Query Troop troop_any

SolWayward edited this page Dec 22, 2025 · 2 revisions

gm.query.troop_any

Endpoint: gm.query.troop_any

Syntax

gm.query.troop_any [search_terms...] [type_flags...] [sort:field[:order]]

Description

Search for troops matching ANY of the specified types (OR logic). All other parameters work the same as gm.query.troop. Useful for comparing different troop types or finding alternatives across multiple categories.

Parameters

Parameter Type Required Description
search_terms string No Text to match against troop name or ID
type_flags flags No Filter by troop types using OR logic (see Type Flags below)
sort:field[:order] string No Sort results (see Sorting Options below)

Type Flags

Same as gm.query.troop:

Formation Types: infantry, ranged, cavalry, horsearcher, mounted

Troop Line Types: regular, noble, militia, mercenary, caravan, peasant, minorfaction

Equipment Types: shield, 2h/twohanded, polearm, bow, crossbow, throwing

Tier Keywords: tier0 through tier6, tier6plus

Culture Keywords: empire, vlandia, sturgia, aserai, khuzait, battania, nord, bandit

Sorting Options

  • sort:id - Sort by StringId (default)
  • sort:name - Sort alphabetically by name
  • sort:tier - Sort by tier level
  • 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

Add :desc for descending order or :asc for ascending (default)

OR Logic Explanation

When using gm.query.troop_any, the command matches troops that have ANY of the specified type flags. For example:

  • gm.query.troop bow crossbow (AND logic) - Finds troops with BOTH bows AND crossbows (usually none)
  • gm.query.troop_any bow crossbow (OR logic) - Finds troops with EITHER bows OR crossbows

Examples

Find any ranged unit (archers OR crossbowmen):

gm.query.troop_any bow crossbow

Find cavalry OR horse archers:

gm.query.troop_any cavalry horsearcher

Find tier 4 OR tier 5 infantry:

gm.query.troop_any infantry tier4 tier5

Find Empire OR Vlandia troops:

gm.query.troop_any empire vlandia tier3

Find noble OR mercenary troops:

gm.query.troop_any noble mercenary tier4

With sorting:

gm.query.troop_any bow crossbow tier5 sort:level:desc
gm.query.troop_any cavalry horsearcher sort:name
gm.query.troop_any empire battania noble sort:tier:desc

Compare different troop lines:

gm.query.troop_any regular noble militia tier3 sort:culture

Find multiple equipment types:

gm.query.troop_any shield polearm 2h tier4 sort:level:desc

Output

Success:

Found N troop(s) matching ANY of [criteria]:
[StringId]    [Name]    [Category]    Tier: [Tier]    Level: [Level]    Culture: [Culture]    Formation: [Formation]

Notes

TIP: Use troop_any to compare different troop types side-by-side (e.g., bow vs crossbow units).

TIP: Excellent for finding alternatives when recruiting troops with multiple specializations.

Related Commands

Last Updated: 2025-12-16

Quick Links

🏠 Home | Quick Reference | Syntax Guide


Hero Commands
Clan Commands
Kingdom Commands
Settlement Commands
Item Commands
Troop Commands
Caravan Commands
Bandit Commands
Query Commands

Clone this wiki locally