Skip to main content
The trainer system uses two files:
  • trainertypes.txt - Defines trainer classes and their properties
  • trainers.txt - Defines individual trainer battles

trainertypes.txt

Defines trainer classes (types) like “Youngster”, “Leader”, “Elite Four”, etc.

File Format

Each line defines one trainer type:
ID,INTERNALNAME,Name,BaseMoney,BGM,VictoryME,IntroME,Gender,BattleUse,Skill

Example Entries

0,POKEMONTRAINER_Red,Entrenador,60,,,,Male,,
37,YOUNGSTER,Joven,16,,,,Male,,
59,LEADER_Brock,Líder Gimnasio,100,Battle! (Gym Leader),,,Male,,
71,CHAMPION,Campeón,100,Battle! (Champion),,,Male,,

Field Definitions

ID
Integer
Unique trainer type ID. Sequential numbering.
0,POKEMONTRAINER_Red,...
37,YOUNGSTER,...
59,LEADER_Brock,...
InternalName
String
Internal identifier in UPPERCASE. Used in trainers.txt and events.
YOUNGSTER
LEADER_Brock
CHAMPION
POKEMONTRAINER_Red
Name
String
Display name for this trainer class.
Joven
Líder Gimnasio
Campeón
BaseMoney
Integer
Base prize money multiplier. Final money = BaseMoney × highest level Pokémon.
16   # Youngster (low payout)
60   # Standard trainer
100  # Gym Leader/Champion
BGM
String
Battle music filename (without extension). Leave empty for default.
Battle! (Gym Leader)
Battle! (Champion)
Battle! (Trainer)
VictoryME
String
Victory music effect. Leave empty for default.

Victory - Gym Leader.ogg
IntroME
String
Battle intro music effect. Leave empty for default.
Gender
Gender
Trainer’s gender. Valid: Male, Female, Mixed (for doubles)
Male
Female
Mixed  # For double battle partners
BattleUse
Integer
Items the trainer can use in battle. Leave empty for none.

32  # Can use items
Skill
Integer
AI skill level. Leave empty for default. Higher = smarter AI.

32   # Standard AI
100  # Maximum AI (Champion)

trainers.txt

Defines individual trainer battles with their Pokémon teams.

File Format

Trainers are defined in blocks:
TRAINERTYPE
Name
PartySize,ITEM1,ITEM2,...
POKEMON,Level,Item,Move1,Move2,Move3,Move4,Form,Gender,Ability,Shiny,Shadow,IVs,Happiness,Name,Ball,TeraType
...

Block Structure

Line 1: Trainer Type
String
Internal name of trainer type from trainertypes.txt.
YOUNGSTER
LEADER_Brock
RIVAL1
Line 2: Name
String
Trainer’s personal name (or name variation number).
Ben
Brock
Blue,1  # Version 1 of Blue
Line 3: Items
String
Party size, followed by items the trainer carries.
2                              # 2 Pokémon, no items
2,FULLRESTORE,FULLRESTORE     # 2 Pokémon, 2 Full Restores
1                              # 1 Pokémon
Lines 4+: Pokémon
Pokémon Data
One line per Pokémon. Format:
SPECIES,Level,Item,Move1,Move2,Move3,Move4,Form,Gender,Ability,Shiny,Shadow,IVs,Happiness,Nickname,Ball,TeraType
Minimum format (species and level only):
PIKACHU,25
Full format example:
ONIX,14,SITRUSBERRY,HEADSMASH,ROCKTHROW,TERABLAST,ROCKTOMB,0,M,,shiny,,20,,Rocky,,19,WATER

Pokémon Field Parameters

Species
String
required
Internal name of the Pokémon species.
PIKACHU
CHARIZARD
BULBASAUR
Level
Integer
required
Pokémon’s level (1-100).
25
50
100
Item
String
Held item internal name. Leave empty for none.

SITRUSBERRY
LEFTOVERS
Move1-4
String
Up to 4 moves (internal names). Leave empty to use level-up moves.
THUNDERBOLT,QUICKATTACK,IRONTAIL,
,,,  # Use default moves
Form
Integer
Form number for Pokémon with multiple forms (0 = first form).
0   # Normal form
1   # Alola form
2   # Galar form
Gender
String
M for male, F for female. Leave empty for random/genderless.
M
F

Ability
String
Ability index or internal name. Leave empty for default.

0   # First ability
1   # Second ability
Shiny
String
Write shiny for shiny Pokémon. Leave empty for normal.

shiny
Shadow
String
Write shadow for Shadow Pokémon. Leave empty for normal.

shadow
IVs
Integer
Individual Values (0-31). Leave empty for random.

20  # All IVs set to 20
31  # Perfect IVs
Happiness
Integer
Friendship value (0-255). Leave empty for default.

255  # Maximum happiness
Nickname
String
Custom nickname. Leave empty for species name.

Rocky
Sparky
Ball
Integer
Poké Ball type (item ID). Leave empty for Poké Ball.

19  # Great Ball
20  # Ultra Ball
TeraType
Type
Terastal type for Generation 9 mechanics.

WATER
ELECTRIC

Complete Examples

Simple Trainer

YOUNGSTER
Ben
2
RATTATA,11
EKANS,11
  • Youngster Ben
  • 2 basic Pokémon
  • No items, default moves

Gym Leader

LEADER_Brock
Brock
2,FULLRESTORE,FULLRESTORE
GEODUDE,12,,DEFENSECURL,HEADSMASH,ROCKPOLISH,ROCKTHROW,0,M,,,,20
ONIX,14,SITRUSBERRY,HEADSMASH,ROCKTHROW,TERABLAST,ROCKTOMB,0,M,,shiny,,20,,Rocky,,19,WATER
  • Gym Leader Brock
  • 2 Pokémon with items and custom moves
  • Both male, 20 IVs
  • Onix is shiny, nicknamed “Rocky”, holding Sitrus Berry
  • Onix has Water Tera Type

Rival Battle (Multiple Versions)

RIVAL1
Blue
3
PIDGEOTTO,17
RATTATA,15
BULBASAUR,18
#-------------------
RIVAL1
Blue,1
3
PIDGEOTTO,17
RATTATA,15
CHARMANDER,18
#-------------------
RIVAL1
Blue,2
3
PIDGEOTTO,17
RATTATA,15
SQUIRTLE,18
  • Three versions of Blue (based on player’s starter)
  • Use Blue,1 and Blue,2 for variations
  • Same structure, different starter

Team Rocket Battle

TEAMROCKET_M
Rocket,1
1
WEEPINBELL,21,,,,,,,,,,,,,,true
  • Male Team Rocket grunt
  • Version 1
  • One Pokémon with default moves
  • true flag at end (special property)

Champion Battle

CHAMPION
Blue
3
VENUSAUR,63,SITRUSBERRY
CHARIZARD,63,SITRUSBERRY
BLASTOISE,63,SITRUSBERRY
  • Champion Blue
  • High-level team (63)
  • All holding Sitrus Berries
  • Default moves based on level

Specialized Trainer

YOUNGSTER
Test
1
ARBOLIVA,50,GRASSIUMZ,NATURALGIFT,GRASSKNOT,RAGE,ROCKTOMB,0,M,,shiny,,20,,,,19
  • Test trainer
  • Level 50 shiny Arboliva
  • Holding Grassium Z
  • Custom moveset
  • Male, 20 IVs
  • Ball ID 19

Trainer Variations

Use version numbers for trainers you battle multiple times:
CAMPER
Jeff
2
SPEAROW,16
SENTRET,16
#-------------------
CAMPER
Jeff,1
2
FEAROW,29
FURRET,29
  • First battle: Jeff (no version number)
  • Rematch: Jeff,1
  • Further rematches: Jeff,2, Jeff,3, etc.

AI and Items

Trainer behavior is defined in trainertypes.txt:
  • 0 - No AI (random moves)
  • 16 - Basic AI (type advantages)
  • 32 - Standard AI (most trainers)
  • 48 - Good AI (strategic)
  • 60 - Strong AI (important trainers)
  • 100 - Maximum AI (Champions, Leaders)
Higher values make trainers smarter about move selection, switching, and item use.
Trainers can carry healing items defined on Line 3:
2,FULLRESTORE,FULLRESTORE     # Can use 2 Full Restores
2,POTION,SUPERPOTION,HYPERPOTION  # Multiple item types
2                              # No items
Items are used by AI during battle based on the trainer’s skill level.

Double Battles

For double battles, use trainers with Mixed gender:
COOLCOUPLE
Alice & Bob
2
TURTWIG,19
CHIMCHAR,19
  • Two trainers in one battle
  • Names separated by &
  • Both Pokémon sent out at once
Separators: Use #------------------- to separate trainer definitions for readability. This is optional but recommended.
Empty Fields: When leaving fields empty, still include the commas as placeholders. For example: PIKACHU,25,,,,,0,M leaves item and moves empty but specifies form and gender.
Terastal: The TeraType parameter is only used in Generation 9+ mechanics. It’s the last parameter and defines which type the Pokémon Terastallizes into.

Build docs developers (and LLMs) love