Jump to content

Recommended Posts

Posted (edited)

EDIT: I added a new script at the bottom of this post.

Hi guys, this is my first tutorial so sorry for mistakes :(

Anyways, like the title says, it's about Pokemon Trainer Battle Scripting. So far I only know it works for HG/SS. If you want to use in Platinum or D/P, feel free to try and please tell me if it works.

On to the tutorial. Here are the tools you need:

  Reveal hidden contents

Once you've downloaded the things needed, put your HG/SS rom into PPRE's folder. Then open up PPRE and click on choose rom. Select your rom and click Set Rom.

1.png

Then command prompt should appear. PPRE is extracting your rom now.

2.png

Once PPRE has finished, click on Trainers.

3.png

Once you opened up Trainers, select a random trainer from the list. Edit the Trainer's information now(Number of Pokemon he/she had and so on). Once you changed the number of Pokemon, click another trainer from the list and go back to the trainer you edited to see that the number of Pokemon had changed. NOTE: I can't seem to edit the Trainer's name, so I used an older version of PPRE, which worked. However, the Pokemon's level is maximum 99 and I cant save my scripts using that.

After you've edited the Trainer, TAKE NOTE OF THE NUMBER BESIDE HIS/HER NAME. IT'S VERY IMPORTANT. For me it's 24.

4.png

Save your changes afterwards.

Next, go to Maps and choose the map you want. For me I'm going to use Cianwood City Gym.

Go to the Events tab and click on Overworlds. See the number at the top right corner? That's the number of overworlds. Click on the up arrow to increase the number of overworlds.

You might see a new tab now. Type in the ID of the overworld, which is this:

5.png

Now type in the sprite. The values for them are here:

  Reveal hidden contents

However, PPRE can read only Dec numbers, but these are Hex numbers. So open up Calculator, and go to the Scientific Mode for XP. I don't know what to press for the other computers so you have to figure out yourself. Go to Hex and type in the number for the sprite. Click on Dec next to get the Dec number. Write this in PPRE.

Next for the movement. I don't really have the list for the movements(I'm too lazy to figure out :'( So if you got the list, please tell me and I will give credit.) However I do know that 15 is facing down and 20 is facing up.) Type it in the box.

Flag... I don't really know what's that but I will figure it out sometime, probably after B/W is released.. I'm just too busy :sleeping:

Script we will come to it later.

Line of Sight, by the name, you probably know what's it. It's use for detection for normal trainers, like when you're walking along Viridan Forest when a trainer spot you.

X-, Y- and Z- coordinate, pretty simple. I don't know bout Z though. Anyway, you might ask, how do we find the X and Y coordinate? Simple! Using the Lua Script, open it in DeSmuME and activate the script! Move to the spot where you want your trainer to be at and he will stand there! However the Lua Script doesn't work on Patched Roms.

6.png

After finding out the X and Y coordinate, type it in the boxes.

Once you've done all these, take note of the ID of your overworld.

Next, go to the Text tab. You will see that there's already a lot of text. Write your trainer's beginning and losing text like this:

text_[continued number]="[text]"

So for example I want to write this:

Yo! This is a guide!

And the text number is 5, I will write in PPRE this:

text_5="Yo! This is a guide!"

Just remember, \n is for line break and \r is for new box.

After writing your text, note down the text numbers - both beginning and lose text. I don't know how to make the winning text activate, sorry :(

7.png

Now go to the Scripts text and go to Scripts. Press add script and go to the new script. Now we can begin writing our script.

Example of Script:

  Reveal hidden contents

Lockall starts your script. Lockall is basically the same as the script starter you use when hacking GBA games.

Faceplayer, too, exists in GBA hacking. Just let the trainer turn to you when you talk to him/her.

Message [number] is the text you wrote just now. [number] is the text number which I told you to note.

WaitButton and CloseMsgOnKeyPress works together. The trainer battle will begin after you pressed A or B(WaitButton). The message will then close(CloseMsgOnKeyPress).

TrainerBattle [number] 0 1 starts your trainer battle. [number] is the trainer number I told you to note just now. You can see why it's important now.

Message [number] is the losing text.

Releaseall MUST be present if you wrote Lockall. It releases the NPCs around.

End is the ending of the script. VERY IMPORTANT.

Now that you finished your script, save your changes.

Go back to PPRE and type in your rom name, also remember to write in the ".nds" without the quotient marks.

8.png

After your rom has finished creating, open your rom and enjoy! Also if you want to edit the sprite of your trainer, I might write a tutorial on it, but it's best if you follow KazoWAR's on Youtube.

Thanks for reading my tutorial! This is my first tutorial so I hope you would rate my skills on writing tutorials.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Here's a completely optional part: Removing people.

Basically, after you've finished your battle, you can make the trainer disappear.

Here's an example of the script:

  Reveal hidden contents

The new part edited, as you can see, is

Applymovement 5 mov_1

Waitmovement

Removepeople 5

Before I go into explaining, go to Maps, choose your map and Scripts, before finally going to Movements.

1-1.png

Choose Add Movement. A new tab should form.

Now, you have to write your movement. The movement format must be like this:

[movement_name] [number_of_times]

Movement_name is the type of movement you want your OW to move, such as the 1 I used, WalkDownNormal.

Here's a list of the movements:

  Reveal hidden contents

Number of times is the number of steps you want your OW to move. Pretty simple, you should understand.

Now to explain the script.

Applymovement [OW ID] [mov_[id]] is put into your script.

Applymovement is to apply a movement on [OW ID] which is your OW's ID, which I explained earlier at the previous post, and [mov_[id]] is the ID of your movement.

2-1.png

For me it's mov_1.

Waitmovement is to wait for the movement to be finished before the OWs can be released.

Removepeople [OW ID] is to remove the OW you assigned to. By now you should know what's [OW ID].

So now that your movement script is finished, save your changes, write your rom and begin playing!

~Hope this helps!~

LUA Script.zip

LUA Script.zipFetching info...

Edited by TheShadowWalke
Posted

Is there any way to have trainer behavior like with the SS Aqua trainers from G/S/C? For example, in those games, even when you defeated all the trainers on the boat, they'd be able to be rebattled the next time you rode on the boat.

Posted
  cos7191 said:
Is there any way to have trainer behavior like with the SS Aqua trainers from G/S/C? For example, in those games, even when you defeated all the trainers on the boat, they'd be able to be rebattled the next time you rode on the boat.

I don't really know, but I think you have to create a flag with that.

  • 1 month later...
Posted

Is there a list of all the trainers and their numbers on a document of something? I have some specific trainers in mind that I want to mod but I'm having trouble finding them b/c I don't know what their trainer number is... thx

Posted

Thanks, this is very interesting. It's a well written tutorial :D.

I was wondering if you could help me. I'm trying to get different music to play during trainer battles. For example, the rival battle theme every normal trainer battle. Do you know what determines what music is played upon battle? Does every trainer have a value which points to a certain music file? Is it dependant on the class?

Thanks in advance.

Posted

Hey guys, my first ever post! But anyway quick question, Im using PPRE 014b and i know how to edit/create scripts but sometimes PPRE refuses to save my changes! (yes i pressed save) anybody know why it keeps happening? thanx in advance

  • 1 month later...
Posted (edited)

Movement 5 goes up to 1 tile to the right/left of the original position.

0 is for Signposts and such

17, I think looks to the right while 16 looks to the left.

I'll keep on editting as I see what I have is wrong/right.

  cos7191 said:
Is there any way to have trainer behavior like with the SS Aqua trainers from G/S/C? For example, in those games, even when you defeated all the trainers on the boat, they'd be able to be rebattled the next time you rode on the boat.

I'm pretty sure this script works like that.

Edited by Roihu
  • 11 months later...
Posted

Hi

fantastic tutorial, i did saw a video of this, but the owner deleted his account.

now i was trying to do this again, but the command prompt the whole time (V.0.12 0.14 1.15 beta)

But i cant find a sulotion to fix the problem, do you know a solution?

regards renekokkie.

p.s im using windows 7

  • 1 month later...
Posted

i really have a problem when i want to edit the trainers pokemons. I want to change all Gym leader pokemons, the rival pokemons, etc, but i can't, when i press "Write rom" it's ok, but when a close the PPRE beta 0.4 appears a message error, that doesn't happen when I change the wild pokemons in any route or something like that, can anyone help me or explain me what's the matter..... P.S I'm speak spanish if there's somebody there who can help me, I really appreciate it....

  • 6 months later...
Posted

Hi guys ,

I have to say that this is a pretty good tutorial . Nevertheless , i am facing some problems when i try to edit a trainer.

I press A button and i can't talk to him !

How can i solve this problem and start my battle ?

PS : i followed all the instructions exept for the text one .

  • 8 months later...
Posted

This may seem like a stupid question, but is there a version of this out yet that works for pokemon black 2? I've tried ppre 2.2.0 but that actually is more limited in what you can do with both newer and the older roms, whereas beta .14 has allowed me to view basically everything in heartgold with ease.

  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...