Skip to content

API Query Kingdom kingdom_any

SolWayward edited this page Dec 22, 2025 · 2 revisions

gm.query.kingdom_any

Endpoint: gm.query.kingdom_any

Syntax

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

Description

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

Parameters

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

Type Flags

Status:

  • active - Active kingdoms
  • eliminated - Destroyed/eliminated kingdoms
  • empty - Kingdoms with no clans

Relationships:

  • player - Player's kingdom
  • atwar - Kingdoms currently at war

Sorting Options

  • sort:id - Sort by StringId (default)
  • sort:name - Sort alphabetically by name
  • sort:clans - Sort by number of clans
  • sort:heroes - Sort by number of heroes
  • sort:fiefs - Sort by number of fiefs
  • sort:strength - Sort by military strength
  • sort:ruler - Sort by ruler name
  • sort:[type_flag] - Sort by any type flag

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

  • sort:strength:desc - Sort strongest first
  • sort:clans:desc - Sort most clans first

OR Logic Explanation

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

  • gm.query.kingdom eliminated empty (AND logic) - Finds kingdoms that are BOTH eliminated AND empty
  • gm.query.kingdom_any eliminated empty (OR logic) - Finds kingdoms that are EITHER eliminated OR empty

Examples

Find kingdoms that are eliminated OR empty:

gm.query.kingdom_any eliminated empty

Find active OR at war kingdoms:

gm.query.kingdom_any active atwar

Search with text filter and OR types:

gm.query.kingdom_any empire eliminated active

Sort results by strength:

gm.query.kingdom_any active atwar sort:strength:desc

Find player or at war kingdoms:

gm.query.kingdom_any player atwar sort:clans:desc

Output

Success:

Found N kingdom(s) matching ANY of [criteria]:
[Name] ([StringId]) - Culture: [Culture], Ruler: [RulerName], Ruling Clan: [ClanName], Clans: [Count], Fiefs: [Count]

Notes

TIP: Use kingdom_any when you want to find kingdoms in multiple states simultaneously.

TIP: Combine with text search to narrow OR results to specific cultures while keeping status 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