Create a Basic Trainer Battle

Showing off a trainer battle in Pokémon Umbra

Setting up a trainer in Pokémon Studio

First you will need to open Pokémon Studio, go to the trainers tabs, and click on the "+ New trainer" button in the top left. Now let's begin!

You should now have something similar to this:

Showing off the top half of the "create a trainer" screen

Showing off the bottom half of the "create a trainer" screen

Now hit "Add the trainer" and let's move on to the next step!

NOTE: If you want to change anything about the trainer's info that we just set later on, you can. Once you've added a trainer you'll just click on the top section that has the trainer's class and name in it.

Quickly going over AI levels

Assigning the trainer's data

Shows the trainer tab of a newly created trainer

So now you should be looking at a screen similar to this. If you are wondering how I have both the XY styled and gen-4 styled sprite, select the XY styled sprite for the "Trainer sprite" and have a trainer's a sprite in your "battlers" folder with the same name! Like shown below.

NOTE: It still will only use one of these graphics for the battle transition, based on whatever your variable 31 is set to.

Showing the "XXX_big", "XXX_sma" and "xxx" graphics

Hit the save button in the bottom left corner of Studio, and then let's open our project in RPG Maker XP.

Setting up a trainer in RPG Maker

There's a few ways to set up a trainer, but we are going to go over two. The first method we will go over will be the old-fashioned "push-a-few-buttons-and-I'm-done" method (which just uses RPG Maker's event buttons), the second method will just be setting the trainer up via a script command.

Alternatively you can make a very advanced trainer entirely through a script. I'll try and go over that one day!

NOTE: For all three methods you will need to know the Trainer's ID , this is found in Studio here! This is a value you will need to remember.

Showing where to find the Trainer's ID

Optional: Trainer Spotting (Will always be the first page if using it)

This is ONLY necessary if you want the event to activate from a few feet away. It takes advantage of a function called "trainer_spotted(x)" which makes the event register if the trainer walks past their line of sight by a specifed amount of tiles! It's not a requirement for trainers, but if you do want to use it, you will need to do it on the first page.

Make the first page's trigger a parallel process with just this in the event command (you can change the 7):

Make sure page 2 has "Self Switch A" as active (or whatever one you turned on) and set its trigger to "autorun." If you want the trainer to walk up to the player, open "extendtext.exe" in your project's root folder, and at the start of page 2 put one of these as a script before calling the battle:

#This will make the trainer walk up to you and say hello
trainer_eye_sequence('Hello!')

#This will make the trainer walk up to you, say hello, and change the BGM for as they walk up
trainer_eye_sequence('Hello!', eye_bgm: 'audio/bgm/pkmrs-enc7')

METHOD ONE: RPG Maker's Event Buttons

This is the most bare-bones, fool-proof, way, but also the most limited way. I'd advise this for most trainers.

Showing the third page's of RPGMaker's event command buttons

Showing the Battle Processing screen and its options

Congrats, with all that done you should have something similar to this:

Showing off how to make a trainer with RPG Maker's button commands

METHOD TWO: A script command

This method is essentially the same as method one. It's bare-bones, fool-proof, but also fairly limited. I'd advise this if you prefer using scripts over GUI.

# Change 286 to your trainer ID 
start_trainer_battle(286)

# All the optional things that MUST be done after start_trainer_battle but in the same script command:
$game_temp.battle_can_lose = true

NOTE: You can also change the BGM, or even set up double battles and double battles with an ally this way!

# To set a specific BGM
start_trainer_battle(286, bgm: 'pkmrb-battle3')

# To set up a double battle change 287 and 287 to the two trainers ID's
start_double_trainer_battle(286, 287)

# To set up a double battle w/ ally change 287 and 287 to the enemy trainers ID's and 289 to the ally ID
start_double_trainer_battle_with_friend(286, 287, 289)

Congrats, with that done you should have something like this:

Showing off how to make a trainer with a script command

Final example using Trainer Spotter & Script Commands:

Final example using Trainer Spotter & Button Commands