Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2015-10-25 05:19:35

Fotomac
Member
Registered: 2015-10-25
Post 1/294

Giving trainers names?

If at all possible, how do you give names to trainers such as, for examples, Youngsters and Lasses and Jr. Trainers?

Offline

#2 2015-10-25 07:32:30

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 3,076/3,471

Re: Giving trainers names?

To my knowledge, nobody has actually done this yet. It's on my list of things to add to Red++ at some point, but I haven't gotten around to it (because it will be tedious and it isn't super important), so I can't say for sure what all you would need to do yet. But basically:

- You would need to store the names somewhere. The simplest place is probably adding it to the start of each trainer party entry, the way Gen 2 does it.
- You would need to read this name and store it in RAM to reference later. If you added it to the trainer's data, you would need to add some new code in the .IterateTrainer section of the ReadTrainer routine, so it copies the name to RAM and then continues on to reading the Pokemon the same as it used to.
- You would need to have a place to store the name. Since LASS is stored in RAM, you would also need to be able to store JENNIFER or whatever her name is somewhere as well, so you can reference it. You could define a new space for it in wram.asm or you could probably reuse an existing temp string. Not sure which would be best since I haven't done it yet.
- You would need to edit the text that says "[TRAINER] wants to fight!" so that it would load the Class and the Name instead of just the class (so "LASS JENNIFER wants to fight!" instead of "LASS wants to fight!")
- You would need to edit the text after a battle to also include the name and class
- You would potentially need to edit all text that the trainers display after a battle to make sure it doesn't overflow the textbox since the trainer name will be longer than it was originally.
- You would need to edit the strings used in battle such as "LASS used a SUPER POTION" to include the trainer's name as well.


There might be some more things I haven't thought of yet (or that just slipped my mind when writing it) but it would probably be a long and tedious task. Probably wouldn't be difficult but it would almost certainly be time consuming and would require you to be at least a little familiar with asm since you would need to make up a loop to copy the trainer's name to a RAM address and stuff like that.

Last edited by Mateo (2015-10-25 07:33:04)

Offline

#3 2015-10-25 07:52:47

Fotomac
Member
Registered: 2015-10-25
Post 2/294

Re: Giving trainers names?

Mateo wrote:

To my knowledge, nobody has actually done this yet. It's on my list of things to add to Red++ at some point, but I haven't gotten around to it (because it will be tedious and it isn't super important), so I can't say for sure what all you would need to do yet. But basically:

- You would need to store the names somewhere. The simplest place is probably adding it to the start of each trainer party entry, the way Gen 2 does it.
- You would need to read this name and store it in RAM to reference later. If you added it to the trainer's data, you would need to add some new code in the .IterateTrainer section of the ReadTrainer routine, so it copies the name to RAM and then continues on to reading the Pokemon the same as it used to.
- You would need to have a place to store the name. Since LASS is stored in RAM, you would also need to be able to store JENNIFER or whatever her name is somewhere as well, so you can reference it. You could define a new space for it in wram.asm or you could probably reuse an existing temp string. Not sure which would be best since I haven't done it yet.
- You would need to edit the text that says "[TRAINER] wants to fight!" so that it would load the Class and the Name instead of just the class (so "LASS JENNIFER wants to fight!" instead of "LASS wants to fight!")
- You would need to edit the text after a battle to also include the name and class
- You would potentially need to edit all text that the trainers display after a battle to make sure it doesn't overflow the textbox since the trainer name will be longer than it was originally.
- You would need to edit the strings used in battle such as "LASS used a SUPER POTION" to include the trainer's name as well.


There might be some more things I haven't thought of yet (or that just slipped my mind when writing it) but it would probably be a long and tedious task. Probably wouldn't be difficult but it would almost certainly be time consuming and would require you to be at least a little familiar with asm since you would need to make up a loop to copy the trainer's name to a RAM address and stuff like that.

If and as you get around to it, could you show us the process, step by step? Thanks!

Offline

#4 2015-10-25 14:22:45

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 3,077/3,471

Re: Giving trainers names?

Sure, but that's gonna be a while. That isn't on the list for beta 2. So it's gonna be months before I get around to it. (Since my plan is to finish up Beta 2, then finish up the other half of Pokémon Christmas, then come back to Red++). So yeah, I'd be happy to try and explain it when the time comes, but that isn't going to be soon.

Offline

#5 2015-12-23 13:10:13

Fotomac
Member
Registered: 2015-10-25
Post 117/294

Re: Giving trainers names?

Since the time's drawing nearer, may I suggest storing the names in WRAM as wTrainerID and making separate scripts for generic trainer battles and named trainer battles (including most Rocket trainer battles) when in the process of doing this?

Offline

Board footer

Powered by FluxBB