Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2011-01-05 08:14:37

EvilOttoJr
Member
Registered: 2010-12-05
Post 58/86

New Trainers from scratch in Gold

I need to add six to eight trainers, from scratch, into Gold. Here's what I'm not sure on:

1. I need to make them all the same as Red, as in, Class= PKMN Trainer, has two Full Restores, same pic (I don't want to go into the whole spriting from scratch stuff, so Red's sprite will do just fine). What determines this?

2. I need it to be able that the trainers can be battled again and gain without leaving the map so you can get as much experience or money as you want.

3. I need someone to block the entrance to whatever building they are contained in so they are only able to be fought after you have defeated the six Legendary Pokemon in Silver Cave (bitflags 078c, 078d, 078e, 078f, 0790, and 0791).

4. I want to be able to insert the data for these trainers in the same bank as my event data as opposed to with all the other trainers' data. Is this possible? I asked this before but I don't think I got a definite answer.

4. I need help making scripts for all of these, since I know VERY little about scripting, and to be quite honest, these I think will be the last scripts that go into my hack.

Last edited by EvilOttoJr (2011-01-05 08:17:09)

Offline

#2 2011-01-05 08:20:44

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

Re: New Trainers from scratch in Gold

Well to make them all the same as him, you would simply repoint his trainer group to some blank space near the other trainers and add their data there. Then for the trainer information you would put red's trainer group and 1 through however many for their trainer numbers. The scripts would be very similar to a standing pokemon script, except you wouldnt set a flag and a few commands will be different. I'll write up a script tomorrow after classes and post it here for you.

As for making them hidden when all of those flags are set, you won't be able to use the normal method. So I believe that would involve having the init script on the map they are on check for all of those flags, and if all of them are on it hides them, and if any of them are off it just ends the script.

Offline

#3 2011-01-06 07:52:07

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

Re: New Trainers from scratch in Gold

Sorry I haven't posted the script earlier. Between classes, church, and going to watch Tron: Legacy I haven't been on the laptop much today.

6A-Face Player
47-Load Font
4C-Load Text
XXXX-Text Pointer
63-Win/Loss
XXXX-Pointer Win Text
YYYY -Pointer Loss Text
67-Set last Person Talked to
XX-Person Number (Goldmap+1)
5D-Load Trainer Data
XX-Trainer Group
YY-Trainer Number
1E-Set Type Battle
03-Set Type Battle
01-Battle Type
5E-Start battle
5F-Evaluate Battle
90-Return Code 2


I adapted this code from the Practice Battle machines in the old Sterling Silver. This code removes the parts you wouldnt need, leaving you with just a trainer that can be battled again and again. Note with this code, you will still blackout if you lose like a normal trainer.

Offline

#4 2011-01-06 08:35:11

EvilOttoJr
Member
Registered: 2010-12-05
Post 59/86

Re: New Trainers from scratch in Gold

Hey, no problem.

How do I find out where Red's trainer group is? Is it just in his Trainer Data?

Offline

#5 2011-01-06 14:16:08

Miksy91
Member
Registered: 2010-10-16
Post 256/2,305

Re: New Trainers from scratch in Gold

EvilOttoJr wrote:

Hey, no problem.

How do I find out where Red's trainer group is? Is it just in his Trainer Data?

In the script of Red, the game is told to load trainer #1 of trainer group "Pkmn Trainer".

In G/S, 5D [Trainer Group][Trainer No.]
These are for example the trainer groups for Pokemon Silver but they're probably different for Crystal.

01 - Leader (Falkner)
02 - Leader (Whitney)
03 - Leader (Bugsy)
04 - Leader (Morty)
05 - Leader (Pryce)
06 - Leader (Jasmine)
07 - Leader (Chuck)
08 - Leader (Clair)
09 - Rival #1
0A - Prof. (Oak)
0B - Elite Four (Will)
0C - Pkmn Trainer (Cal)
OD - Elite Four (Bruno)
0E - Elite Four (Karen)
0F - Elite Four (Koga)
10 - Champion (Lance)
11 - Leader (Brock)
12 - Leader (Misty)
13 - Leader (Lt. Surge)
14 - Scientist
15 - Leader (Erika)
16 - Youngster
17 - Schoolboy
18 - Bird Keeper
19 - Lass
1A - Leader (Janine)
1B - Cooltrainer (M)
1C - Cooltrainer (F)
1D - Beauty
1E - Pokemaniac
1F - Rocket (M)
20 - Gentleman
21 - Skier
22 - Teacher
23 - Leader (Sabrina)
24 - Bug Catcher
25 - Fisher
26 - Swimmer (M)
27 - Swimmer (F)
28 - Sailor
29 - Super Nerd
2A - Rival #2
2B - Guitarist
2C - Hiker
2D - Biker
2E - Leader (Blaine)
2F - Burglar
30 - Firebreather
31 - Juggler
32 - Blackbelt
33 - Rocket (Exec.) (M)
34 - Psychic
35 - Picnicker
36 - Camper
37 - Rocket (Exec.) (F)
38 - Sage
39 - Medium
3A - Boarder
3B - Pokefan (M)
3C - Kimono Girl
3D - Twins
3E - Pokefan (F)
3F - Pkmn Trainer (Red)
40 - Leader (Blue)
41 - Guard
42 - Rocket (F)


I found out most of those in a Gameshark code site (for G/S) and filled the list afterwards.
I just checked what each groups are by changing the image of Prof. Oak in the start of the game (he also belongs to a trainer group, number 0x0A).

Actually, the trainer data pointers should be in the same order as the trainer groups (first pointer leads to group 01 and second to 02 etc.).
And not only that, the names of the trainer groups are likely written in the same order too :D

Last edited by Miksy91 (2011-01-06 14:18:31)

Offline

#6 2011-01-06 16:10:06

EvilOttoJr
Member
Registered: 2010-12-05
Post 61/86

Re: New Trainers from scratch in Gold

Yeah, good job learning stuff, Miksy. Hopefully I'm right behind you.

I can't find the pointer to Red's Trainer group, though (frustrated scream). Translhaxtion's being a jerk and giving we weird, unrelated search results. Where's the offset to Red's Trainer Group pointer? (repointing it to some very convenient blank space immediately after all the trainer data at 0x3b690, pointer 0e:9076.) And will it be a two-byte or three-byte pointer? (I'm assuming 2-byte since 3-bytes are too convenient.)

EDIT: Also, since I'm moving his data, do I have to redo the script for Red?

EDIT2: Would it also be possible to create new trainer groups without too much difficulty? This is just out of curiosity and not likely something I will do.

EDIT3: Can I also get the pointer to Prof. Oak's trainer group? I think I'll make him a fightable trainer too like he was in Red/Blue version (via Gameshark).

Last edited by EvilOttoJr (2011-01-06 16:16:36)

Offline

#7 2011-01-06 17:14:35

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

Re: New Trainers from scratch in Gold

As long as you keep Red as trainer number 1 in the list and add the new ones afterward you will not have to change his script. Look in the list of useful offsets that are posted, it has the location of the pointer table that points to the start of each trainer group, and you can change it from there.

Offline

#8 2011-01-06 17:40:54

EvilOttoJr
Member
Registered: 2010-12-05
Post 63/86

Re: New Trainers from scratch in Gold

Okay, thanks everyone!

This whole bunch of trainers is going to be pretty cool and a nice way to train. I think I might put up a video of it when I get it done. There's going to be a bunch of all-level-100 trainers (based on my friends and their Pokemon), plus another guy with Pokemon that he got using Monster Brain (put in just for laughs - my friend Jason really did this and had a level 255 Magikarp with Super Fang among other things), and a guy who uses all the strongest Legendary Pokemon at Level 120 (to compensate for the fact that all trainer Pokemon in the GBC games have no stat experience and thus the lowest stats possible). Plus Red again, who'll have dialogue this time (he didn't speak at Mount Silver because, well, he had just climbed a mountain and was tired :) ).

Since I'm going to end up putting a whole lot of trainers in this new place (I'm calling it "The Master's Lounge"), if someone wants a cameo in my hack, let me know what Pokemon, moves, and name you want and I might put it in there (I might have like 20 trainers in there if I can find a map that I can repoint to have enough event Data; there is a HUGE area of blank space after Trainers, enough for a whole bunch of 'em, so if anyone has any ideas or wants a cameo, shout out).

Offline

#9 2011-01-06 22:54:15

Miksy91
Member
Registered: 2010-10-16
Post 257/2,305

Re: New Trainers from scratch in Gold

lol, I actually got interested in writing stuff of me as a trainer :DD
So as I got this much done, might as well post it here.

Type: Boarder / Leader (Falkner or Morty) / Pkmn Trainer / Pokemaniac
Name: Miksy
Pokemon: Donphan, Pidgeot, Starmie, Umbreon, Charizard

Moves:
Donphan - Ancient Power, Body Slam, Earthquake, Strength
Pidgeot - Double Team, Fly, Swagger, Swift
Starmie - Flame Wheel, Hydro Pump, Psychic, Recover
Umbreon - Attract, Faint Attack, Moonlight, Take Down
Charizard - Dragonbreath, Fire Blast, Flamethrower, Slash

I think that's enough of writing...
Anyways, those pokemon have nothing to do with the ones that Boarders use but does it really matter ;) ?
Boarder might be the best choice and type 01 (Falkner), the second best.

Offline

#10 2011-01-06 23:12:28

EvilOttoJr
Member
Registered: 2010-12-05
Post 64/86

Re: New Trainers from scratch in Gold

Okay, I need help with one last script here. After this I don't think I'll need another one.

Inside the building I'm using (the old fighting dojo in Saffron City), there is a guy blocking access to the rest of the building (I figured that'd be a lot easier than having to repoint Saffron City in its entirety just to put that guy there outside the building). He is supposed to disappear after you fight the six Legendaries in Mt. Silver (bitflags 078c, 078d, 078e, 078f, 0790, and 0791). I need something like this:

If you haven't fought all of them, he needs to stand there and, if you talk to him, say something to the tune of:
"Hey!
You can't come in here, this lounge is for experienced Pokemon trainers only!
Maybe, if you prove yourself, I'll let you in.
I've heard rumors from some of these trainers here that a few powerful Pokemon holed up in a mountain cave somewhere.
Defeat them, and you can go in."

Upon defeating (capturing, running from, whatever) the six Legendaries, he needs to either a. disappear, or b. move one space back to allow entrance into the building. If he's still there, I'll have him say something like:
"Oh, I heard you fought all those Pokemon in Mt. Silver!
Legendary Pokemon, were they?
In such case, I think you'll fit in nicely here.
Welcome!"

Also, I'm adding Nurse Joy in there to heal your Pokemon. I'm going to reuse the script that is in the woman's house on the way to Victory Road. It it simple enough to just copy the script, then redo the text at different offsets?

And the PC isn't working. I'm using Tileset 4. I thought PCs were a separate person, but apparent;y they're not and it's loaded in the tile data, but it's not working now. Arrggghhh...

And is there a cap as to how many sprites can be on screen at one time? I've got 15 people in the same room and sometimes they don't seem to stay there, though I think that could have something to do with sprite movement settings.

Offline

#11 2011-01-06 23:34:38

Tauwasser
Member
Registered: 2010-10-16
Post 68/447

Re: New Trainers from scratch in Gold

There's space for 0x10 - 0x02 people events on any given map. You have to subtract 0x02 because one slot is reserved for hero and another for some people event system, probably similar to Pikachu, that didn't make it. However, there can only be 0x0D people events actively in RAM viewable on the same screen, including hero and any events that will stay in RAM while off-screen (e.g. big pokedolls).

cYa,

Tauwasser

Offline

#12 2011-01-07 21:50:38

EvilOttoJr
Member
Registered: 2010-12-05
Post 65/86

Re: New Trainers from scratch in Gold

Deepest apologies to those who asked about cameos, since I realized that there's not enough space in events to do what I wanted to... I've barely got enough space for the trainers I was originally going to put in...

Offline

#13 2011-01-07 23:17:56

Miksy91
Member
Registered: 2010-10-16
Post 258/2,305

Re: New Trainers from scratch in Gold

Tauwasser wrote:

There's space for 0x10 - 0x02 people events on any given map. You have to subtract 0x02 because one slot is reserved for hero and another for some people event system, probably similar to Pikachu, that didn't make it. However, there can only be 0x0D people events actively in RAM viewable on the same screen, including hero and any events that will stay in RAM while off-screen (e.g. big pokedolls).

I thought of putting a lot of people in "The Capital" in Dark Future and so, I guess it might have the maximum amount of people in there (btw, did you mean to say 0xE in that message instead of 0xD) ?

EvilOttoJr wrote:

Deepest apologies to those who asked about cameos, since I realized that there's not enough space in events to do what I wanted to... I've barely got enough space for the trainers I was originally going to put in...

You can always take some random trainers away or make the added trainers type: 50 00...

Last edited by Miksy91 (2011-01-07 23:19:09)

Offline

#14 2011-01-07 23:41:42

Tauwasser
Member
Registered: 2010-10-16
Post 69/447

Re: New Trainers from scratch in Gold

Miksy91 wrote:

did you mean to say 0xE in that message instead of 0xD?

No.

There are 0x10 slots for people event data to be loaded to vram, two of which are reserved. However, on-screen only 0x0D slots for people data (including Hero) exist. So whatever happens, you cannot have all of these in one screen at the same time. Also, you will find that other restrictions apply, because only 0x40 oam tiles can be used, thus limiting what's on screen even further. That's why the data is written to OAM with different priorities. Even if there are only 0x0D people active on the screen, there is no guarantee all of them show up.
Think big PokéDolls for instance. They take up 0x10 tiles by themselves, so you cannot have more than 3 of them and hero on the same screen all at once. Also, since their data will stay in RAM once seen, they even further impede your ability to have many people in RAM at a given time.

cYa,

Tauwasser

Offline

#15 2011-01-08 06:36:02

EvilOttoJr
Member
Registered: 2010-12-05
Post 66/86

Re: New Trainers from scratch in Gold

Hey Mateo, I'm running into a small issue with your script. While not fatal (the trainer works fine, I've got Prof. Oak with his Gameshark party from RBY + Mew), I noticed something odd. After the battle is over, all my Pokemon are back to full health. Is this due to there being no bitflag set?

Offline

#16 2011-01-08 23:09:14

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

Re: New Trainers from scratch in Gold

I don't know why that would be happening. the 5F is supposed to evaluate the battle and send you to a pokemon center if you faint and go back to the map and continue normally if you win. The original code I copied it from was from the practice battle machines in the old Sterling Silver, which instead of the 5F byte had a separate routine that would heal your pokemon and return to the map instead. I don't know why your Pokemon are suddenly healing themselves. Perhaps Tauwasser knows.

Offline

#17 2011-01-09 06:54:19

sky_queen3
Member
From: Australia
Registered: 2010-10-16
Post 57/135

Re: New Trainers from scratch in Gold

Hmm, maybe it's something to do with Oak himself? (It's twigged you're using his sprite for the trainer so it causes an effect?)


Redux is 'on hold'. I have however found the files, but it's still (pretty much) dead at the moment.
I wonder if that's actually a good thing...

Offline

#18 2011-01-09 08:52:43

Miksy91
Member
Registered: 2010-10-16
Post 261/2,305

Re: New Trainers from scratch in Gold

sky_queen3 wrote:

Hmm, maybe it's something to do with Oak himself? (It's twigged you're using his sprite for the trainer so it causes an effect?)

Actually, Oak is a normal trainer in the game.
All the battle sprites in the game are either:

1) Pokemon front sprites
2) Pokemon back sprites
3) Trainers

But yeah, I've no idea why that's happening either...

Offline

#19 2011-01-09 10:21:43

Tauwasser
Member
Registered: 2010-10-16
Post 70/447

Re: New Trainers from scratch in Gold

You should show us the complete script you used for the battle. Maybe you inadvertently already copied the healing script?

cYa,

Tauwasser

Offline

#20 2011-01-09 13:04:14

sky_queen3
Member
From: Australia
Registered: 2010-10-16
Post 58/135

Re: New Trainers from scratch in Gold

Hmm, no idea then. sad.gif


Redux is 'on hold'. I have however found the files, but it's still (pretty much) dead at the moment.
I wonder if that's actually a good thing...

Offline

#21 2011-01-09 15:49:14

EvilOttoJr
Member
Registered: 2010-12-05
Post 67/86

Re: New Trainers from scratch in Gold

Here is the script:
6A 47 4C C0 5E 63 FF 5F 50 60 67 05 5D 0A 01 1E 03 01 5E 5F 90

Offline

#22 2011-01-09 18:25:38

Tauwasser
Member
Registered: 2010-10-16
Post 72/447

Re: New Trainers from scratch in Gold

Umm, actually, it's the fight type you changed to.

Fight type 0x01 (set via 1E 03 01) will heal you after your fight. It's one of the many things I did not yet cover in my doc, mainly because the fighting engine is massive and very complex.

Other valid trainer fight types that are accessed at runtime are:

  • 00 - regular fight

  • 01 - heal after fight

  • 02 - ???

  • 03 - ???

  • 05 - ???

  • 06 - ???

So just delete that part and your fight will work as expected.

cYa,

Tauwasser

Last edited by Tauwasser (2011-01-09 18:26:25)

Offline

#23 2011-01-09 20:07:40

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

Re: New Trainers from scratch in Gold

Glad you figured this out, Tauwasser! I guess that also means that if I re-do practice battle machines, my separate healing routine is unnecessary after all haha.

Offline

#24 2011-01-09 21:53:40

EvilOttoJr
Member
Registered: 2010-12-05
Post 68/86

Re: New Trainers from scratch in Gold

Wow, thanks Tauwasser!

...How do you know all this stuff?

Offline

#25 2011-01-09 23:19:33

124/700

Re: New Trainers from scratch in Gold

I can think of one battle where you are healed immediately after: the rival in Cherrygrove. So you can see these scripts in action in the original game.

Board footer

Powered by FluxBB