Creating Trainers
Trainers are defined across two PBS files:PBS/trainertypes.txt- Defines trainer classes (their type, battle music, etc.)PBS/trainers.txt- Defines individual trainer battles with their Pokémon teams
Trainer Types
Trainer types are defined inPBS/trainertypes.txt:
Real Examples
Trainer Type Fields
Unique identifier for the trainer type.
Internal code name in uppercase. Used in events and scripts.Example:
LEADER_Brock, BUGCATCHER, RIVAL1Display name shown before battles.Example:
Líder Gimnasio, Cazabichos, RivalBase prize money. Actual payout is calculated as:
BaseMoney × Highest Level Pokémon- Regular trainers: 16-32
- Strong trainers: 48-60
- Gym Leaders: 100
- Elite Four: 100
Battle music file name (without extension) from
Audio/BGM/.Leave empty to use default battle music.Victory music file name. Leave empty for default.
Music effect played when battle starts. Leave empty for default.
Trainer gender:
Male, Female, or Mixed (for duo battles).Overrides default skill level. Higher values make smarter AI. Leave empty for default.
Trainer Type Categories
Basic Trainers
Specialist Trainers
Gym Leaders
Elite Four and Champion
Rival Battles
Team Rocket
Individual Trainers
Individual trainers and their Pokémon are defined inPBS/trainers.txt:
Real Example: Brock
Pokémon Definition Format
Internal name of the Pokémon species.Example:
PIKACHU, CHARIZARD, GARCHOMPThe level of the Pokémon (1-100).
Held item internal name. Leave blank for no item.Example:
SITRUSBERRY, LEFTOVERS, CHOICEBANDUp to 4 move internal names. Separate with commas.Leave blank to use level-up moveset.
Ability index:
0 for first ability, 1 for second, 2 for hidden ability.Leave blank for random.M for male, F for female. Leave blank for species default.Form number for Pokémon with alternate forms. Leave blank for default form.
Write
shiny to make the Pokémon shiny. Leave blank for normal.Shadow Pokémon level (for Shadow Pokémon games). Leave blank normally.
Poké Ball type. Leave blank for default (Poké Ball).
Nickname for the Pokémon. Leave blank for species name.
Friendship value (0-255). Leave blank for species default.
Nature name. Leave blank for random.Examples:
Adamant, Modest, Jolly, TimidIndividual Value for all stats (0-31). Leave blank for default.
Tera Type for Terastallization. Example:
WATER, ELECTRICTrainer Examples
Simple Trainer
Trainer with Items
Advanced Configuration
- Level 36
- Custom moveset
- Male gender
- Tera Type: Electric
Shiny Pokémon
Team Rocket Example
The
,1 after the name indicates this is version 1 of this trainer (for rematches).Multiple Trainers of Same Type
AI and Battle Intelligence
Controls trainer AI intelligence in
trainertypes.txt:0or blank - Basic AI (random moves)8-16- Decent AI (considers type effectiveness)32-48- Smart AI (considers stats, status)60-100- Expert AI (Gym Leaders, Champions)
AI Level Examples
Double Battles
For duo trainers (tag battles):The trainer type must have
Gender=Mixed in trainertypes.txt for duo battles to work properly.Rival Battles
Multiple Versions for Story Progress
Champion Battle
Creating Custom Trainers
CUSTOMTRAINER
Custom Name
3,HYPERPOTION,HYPERPOTION
PIKACHU,25,LIGHTBALL,THUNDERBOLT,QUICKATTACK,IRONTAIL,ELECTROBALL
CHARIZARD,30,CHARCOAL,FLAMETHROWER,DRAGONCLAW,AIRSLASH,ROOST
GENGAR,28,,SHADOWBALL,SLUDGEBOMB,THUNDERBOLT,DESTINYBOND
Rematch System
Use version numbers for rematches:Prize Money Calculation
Prize money is calculated as:- Youngster (16) with level 10 Pokémon = 160 Pokédollars
- Gym Leader (100) with level 50 Pokémon = 5000 Pokédollars
- Champion (100) with level 63 Pokémon = 6300 Pokédollars
Testing Trainers
Common Issues
Trainer won’t appear
- Check trainer type exists in trainertypes.txt
- Verify internal names match exactly (case-sensitive)
- Ensure party count matches number of Pokémon
Pokémon has wrong moves
- Verify move internal names are correct
- Check Pokémon can learn those moves
- Leave move slots blank to use level-up moves
Items don’t work
- Confirm item internal names are correct
- Check item is usable in battle
- Verify item is in items.txt
Next Steps
- Creating Pokémon - Build teams with custom Pokémon
- Creating Moves - Give trainers unique movesets
- Creating Maps - Place trainers in your game world