Skip to content

API Query Hero hero_any

SolWayward edited this page Dec 22, 2025 · 2 revisions

gm.query.hero_any

Endpoint: gm.query.hero_any

Syntax

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

Description

Search for heroes using OR logic (matches ANY of the specified type criteria instead of ALL). Useful for broader searches across multiple types. Text search still applies to all results.

Parameters

Parameter Type Required Description
search_terms string No Text to search in hero names, IDs, clan names, and kingdom names
type_flags flags No Filter by hero types using OR logic (see Type Flags below)
sort:field[:order] string No Sort results by field (see Sorting Options below)

Type Flags

Status Types:

  • lord - Noble lords
  • wanderer - Companions available in taverns
  • notable - Settlement notables
  • merchant - Merchant heroes
  • child - Child heroes
  • alive - Living heroes
  • dead - Deceased heroes
  • prisoner - Imprisoned heroes
  • fugitive - Heroes on the run

Gender:

  • female - Female heroes
  • male - Male heroes

Roles:

  • clanleader - Clan leaders
  • kingdomruler - Kingdom rulers
  • partyleader - Party leaders

Relationships:

  • married - Married heroes
  • withoutclan - Heroes without a clan
  • withoutkingdom - Heroes without a kingdom

Sorting Options

  • sort:id - Sort by StringId (default)
  • sort:name - Sort alphabetically by name
  • sort:age - Sort by age
  • sort:clan - Sort by clan name
  • sort:kingdom - Sort by kingdom name
  • sort:[type_flag] - Sort by any type flag (e.g., sort:wanderer, sort:lord)

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

  • sort:name:desc - Sort Z to A
  • sort:age:desc - Sort oldest first

OR Logic Explanation

When using gm.query.hero_any, the command matches heroes who have ANY of the specified type flags, rather than requiring ALL of them. For example:

  • gm.query.hero lord wanderer (AND logic) - Finds heroes who are BOTH lords AND wanderers (usually none)
  • gm.query.hero_any lord wanderer (OR logic) - Finds heroes who are EITHER lords OR wanderers

Examples

Find anyone who is a lord OR wanderer:

gm.query.hero_any lord wanderer

Find clan leaders OR kingdom rulers:

gm.query.hero_any clanleader kingdomruler

Find female OR child heroes:

gm.query.hero_any female child

Search with text filter and OR types:

gm.query.hero_any empire lord wanderer

Sort results by name:

gm.query.hero_any lord wanderer sort:name

Find dead OR prisoner heroes:

gm.query.hero_any dead prisoner

Output

Success:

Found N hero(es) matching ANY of [criteria]:
[Name] ([StringId]) - Clan: [ClanName], Kingdom: [KingdomName], Age: [Age], Status: [Alive/Dead/Prisoner]

Notes

TIP: Use hero_any when you want to cast a wider net and find heroes matching multiple categories simultaneously.

TIP: Combine with text search to narrow OR results to specific kingdoms or clans while keeping type flexibility.

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