Skip to content

API Troop give_xp

SolWayward edited this page Dec 27, 2025 · 1 revision

give_xp

Endpoint: gm.troops.give_xp

Syntax

gm.troops.give_xp <partyLeader> <xp>

Parameters

Parameter Type Required Description
partyLeader string Yes Query to find the party leader hero (e.g., "player", "raganvad")
xp integer Yes Amount of experience points to add to all troops

Requirements

  • Hero must be a party leader
  • Hero must have a party with troops
  • Experience value must be positive

Description

Adds the specified amount of experience points to all troops in the hero's party. This allows rapid troop progression without waiting for combat experience. Troops will automatically level up and become eligible for upgrades as they gain sufficient experience.

The experience is distributed equally to every troop in the party, making this an efficient way to prepare armies for upcoming battles or to quickly level up newly recruited troops.

Examples

Example 1: Give experience to player's troops

gm.troops.give_xp player 1000

Output:

Added 1000 XP to all troops in Player's party.
Party: Player's Army
Total troops affected: 85

Example 2: Rapidly level companion troops

gm.troops.give_xp companion_name 5000

Output:

Added 5000 XP to all troops in Companion Name's party.
Party: Companion Name's Party
Total troops affected: 30

Example 3: Prepare lord's army for war

gm.troops.give_xp raganvad 2500

Output:

Added 2500 XP to all troops in Raganvad's party.
Party: Raganvad's Army
Total troops affected: 120

Example 4: Moderate experience boost

gm.troops.give_xp derthert 500

Output:

Added 500 XP to all troops in Derthert's party.
Party: Derthert's Army
Total troops affected: 95

Example 5: Massive experience injection

gm.troops.give_xp lord_1_1 10000

Output:

Added 10000 XP to all troops in Lord's party.
Party: Lord's Army
Total troops affected: 75

Notes

NOTE: Use gm.query.hero to find exact hero IDs if needed.

NOTE: Troops must still meet upgrade requirements (available upgrade path, sufficient XP) to actually upgrade.

NOTE: Experience is added to ALL troops in the party simultaneously.

TIP: Use moderate XP amounts (500-2000) for realistic progression, or large amounts (5000+) for immediate battle readiness.

TIP: Combine with gm.troops.upgrade_troops after giving XP to immediately upgrade troops that have gained sufficient experience.

TIP: Useful for testing army compositions at various experience levels without prolonged combat grinding.

WARNING: This command only works for party leaders, not party members.

WARNING: Extremely high XP values may cause troops to hit their maximum tier immediately, which could skip intended progression.

Common Use Cases

Battle Preparation

Quickly prepare armies for important battles:

gm.troops.give_xp player 2000
gm.troops.upgrade_troops player 6

New Recruit Training

Speed up training for newly recruited troops:

gm.troops.give_hero_troops player imperial_recruit 50
gm.troops.give_xp player 1500

Allied Reinforcement

Strengthen allied lords before military campaigns:

gm.troops.give_xp raganvad 3000
gm.troops.give_xp caladog 3000
gm.troops.give_xp lucon 3000

Experience Requirements

Different troop tiers require different amounts of XP to level up:

  • Tier 1 to 2: ~100-300 XP
  • Tier 2 to 3: ~300-600 XP
  • Tier 3 to 4: ~600-1000 XP
  • Tier 4 to 5: ~1000-1500 XP
  • Tier 5 to 6: ~1500-2500 XP
  • Tier 6 to 7: ~2500-4000 XP

Note: Exact values vary by troop type and upgrade tree.

Related Commands

Last Updated: 2025-12-27 API Version: 1.3.13.1

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