Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2014-09-18 08:13:11

pagara123
Member
Registered: 2013-11-06
Post 63/118
Website

adding new trainer in map

how to do that i want to create lot of trainer in my hack i want your help all.

Offline

#2 2014-09-18 09:29:29

frz hax
Member
Registered: 2014-08-06
Post 26/43

Re: adding new trainer in map

This is one of Miksy91's hacking videos, it explains how to add trainer data.

https://www.youtube.com/watch?v=bqL8HMY … 8u&index=7

Offline

#3 2014-09-18 10:06:13

pagara123
Member
Registered: 2013-11-06
Post 64/118
Website

Re: adding new trainer in map

i know how to do that but i want to add a new trainer that battling you in the way

Offline

#4 2014-09-18 11:32:53

Crystal_
Member
From: Spain
Registered: 2012-09-16
Post 210/432
Website

Re: adding new trainer in map

What are you having trouble with? Adding another person event to the map, or with the trainer script?

Offline

#5 2014-09-18 12:28:51

pagara123
Member
Registered: 2013-11-06
Post 65/118
Website

Re: adding new trainer in map

adding another person then the script of person to battle you like a normal trainer

Offline

#6 2014-09-18 14:17:41

frz hax
Member
Registered: 2014-08-06
Post 28/43

Re: adding new trainer in map

What tools are you using? Because adding a new person event is simple with JohtoMap. Just go to tools-map properties-edit event data- add a person event- apply changes and you're done. It does all the repointing for you.

Offline

#7 2014-09-18 16:42:17

pagara123
Member
Registered: 2013-11-06
Post 66/118
Website

Re: adding new trainer in map

no i know that but in pksv what i writen?

Faceplayer
writetext 0x0 ' 0x0
winlosetext 0x0 0x0 ' 0x0,0x0

Offline

#8 2014-09-18 18:55:56

Miksy91
Member
Registered: 2010-10-16
Post 2,136/2,315

Re: adding new trainer in map

Use Johtomap to change the person type to 2 and then write its script with a hex editor following this format I picked up from Scripting Compendium;

02 = Trainer: scriptpointer points to this structure:

[Bit no. (2byte)][Trainer group][Trainer][2byte pointer to Text when seen]
[2byte pointer to text when trainer beaten][2byte pointer to script when lost (0000=Blackout)][2byte pointer to script if won/talked to again]

As an example;

0A 06 - bit no. 0x60A as pksv shows it
14 03 - Scientist (14) no. #3
?? ??  - text pointer
?? ?? - another text pointer
00 00 - if lost, blackout
?? ?? - pointer to normal script data accessed after the battle

The normal script data can be as simple as "65 52 ?? ??" for making the game not run its script once the battle is over. When the person is talked-to after the battle, it accesses data after byte 65 which is "52 ?? ??" which is used for making the person talk to you. Trainer event people always face you even if you don't include "faceplayer" in their script, so that's why you don't need code 51, 52 is enough.

If this doesn't make enough sense, see how other trainer events are coded in rom.

Last edited by Miksy91 (2014-09-18 19:00:31)

Offline

#9 2014-09-18 19:04:24

pagara123
Member
Registered: 2013-11-06
Post 67/118
Website

Re: adding new trainer in map

thanks miksy91 this is big help to us

Offline

#10 2014-09-18 19:12:00

pagara123
Member
Registered: 2013-11-06
Post 68/118
Website

Re: adding new trainer in map

this my example miksy91 i place my in offset to 0x1223a0 in hex editing like this 65 52 16 0D 56 A0 59 60 00 00 60 50 57 00 00

this is correct ?

Offline

#11 2014-09-18 19:28:29

Miksy91
Member
Registered: 2010-10-16
Post 2,138/2,315

Re: adding new trainer in map

I think I see what you're trying to achieve there but no, that doesn't work at all.
Like I mentioned there, the trainer data starts off with the bit number, followed by specifics of the trainer, text pointers and so on... In the end of the data, you put a 2-byte pointer to the script data that is executed after the battle ends. In that script data, you put "65 52 ?? ??".

As an example, starting off from that offset 0x1223a0 assuming the rest of the rom bank is "empty" (00 00 00...).

0x1223a0
-----------
0x1223a0 - 0A 06
0x1223a2 - 14 03
0x1223a4 - ?? ??
0x1223a6 - ?? ??
0x1223a8 - 00 00
0x1223aa - ?? ??

And the trainer data ends at 0x1223ab. Thus, we can adjust that last script pointer to point to (that address + 1) by setting it to AC 63 --> So "0x1223aa - AC 63".

0x1223ac - 65 52 ?? ??

Now the script data ends at 0x1223ac + 4 - 1 = 0x1223af. Now the rest of the rom bank is empty and you can start writing the text that this person event says starting at 0x1223b0, separate the strings with "57 (and 00)" as usual, and make the text pointers point to those byte 00s in the beginning of each text string.

Last edited by Miksy91 (2014-09-18 19:34:50)

Offline

#12 2014-09-18 21:41:45

pagara123
Member
Registered: 2013-11-06
Post 69/118
Website

Re: adding new trainer in map

hmm i try it later! And i feedback later! I going to sleep now i am tired

Offline

#13 2014-09-19 00:29:23

pagara123
Member
Registered: 2013-11-06
Post 70/118
Website

Re: adding new trainer in map

FluxBB bbcode test miksy91 what happened now i am in battling and the game freez i want a screenshot tutorial to work it properly

Offline

#14 2014-09-19 06:19:23

Miksy91
Member
Registered: 2010-10-16
Post 2,139/2,315

Re: adding new trainer in map

Like I said there, see how other trainer events work and make your own following that same pattern.
It's not hard but you have to know how to work with pointers first.

Offline

#15 2014-09-19 12:33:35

Skurbert
Member
Registered: 2012-12-16
Post 79/95

Re: adding new trainer in map

Yeah, I suggest watching Miksy91's videos and be PREPARED for massive headaches and confusion when it comes to Rom Hacking. Also, take a look at my thread, where I started from absolutely nothing and slowly started to get hang of it: http://hax.iimarck.us/topic/2901

I suggest downloading these utilites:

Johto Map
Gold Map
Goldfinger
Pointer Calculator
OneGSCTrainer

Offline

#16 2014-09-19 14:00:57

frz hax
Member
Registered: 2014-08-06
Post 29/43

Re: adding new trainer in map

PKSV has a pointer calculator. Took me months to realise this. I used to type in a pointer in JohtoMap and then it would tell me what offset it pointed to. I was so dumb lol.

Offline

#17 2014-09-19 20:39:22

pagara123
Member
Registered: 2013-11-06
Post 71/118
Website

Re: adding new trainer in map

when i try add new trainer this is happen the pallet is change color guys help me we have something miss

may offset is 0x1223a0 point 0x60a0
and i insert this
2D 04 2F 01 F0 60 90 60 00 00 15 60

Last edited by pagara123 (2014-09-19 20:40:26)

Offline

#18 2014-09-20 10:24:09

frz hax
Member
Registered: 2014-08-06
Post 30/43

Re: adding new trainer in map

The pointer for 0x1223A0 is 63A0 not 60A0.

Offline

#19 2014-09-20 13:00:13

pagara123
Member
Registered: 2013-11-06
Post 72/118
Website

Re: adding new trainer in map

sorry for bad english i am a filipino and this is my big big problem the trainer edit is ping and the bit no. Is 11 04 then i change he's trainer name to 16 for and he's no. In group is 0D then the script i point is 0x122490 i repoint it with my mind to 9064 then i reverse it to use 64 90 then another script start at 0x1224F0 i repoint it to 64 F0 script for lose miksy91 said 00 00 for black out then other script repoint to 63 A0 THE NEXT IS??

Offline

#20 2014-09-21 07:26:05

Skurbert
Member
Registered: 2012-12-16
Post 80/95

Re: adding new trainer in map

pagara123 wrote:

then i reverse it to use 64 90 then another script start at 0x1224F0 i repoint it to 64 F0 script for lose miksy91 said 00 00 for black out then other script repoint to 63 A0 THE NEXT IS??

After the [00] [00] Black Out script, there's a new pointer to the script "65". As told in the "Scripting Compendium", "65" tells the game to execute a new text, when talking to the trainer after the battle.

Let's structure it up a little bit.:

[00] [00] [C7] [68] [65]


In my case, "14e8c7" is the address where "65" is written. By using the Pointer Calculator, converting "14e8c7", I ended up with [C7] [68]. You with me? A pointer to "65", to tell the game WHERE "65" is located, and to tell the game to execute that script.

Afterwards, we'll have to tell the game what it's gonna do once the battle is over. We're gonna use the script "47" and "4C". Why? Because we must tell the game to load the right font into ram and open the text box, so the trainer is able to say things afterwards.

4C brings up a text box. But it needs a pointer afterwards to tell the game what the trainer is going to say once the battle is over and you talk to him again. You will need to point directly to an empty space [00 00 00 00.. etc.] and write down a text there. We'll skip that for a moment and just name the pointer [XX] [XX].

That gives us the code:

[00] [00] [C7] [68] [65] [47] [4C] [XX] [XX]

So we have to END the script now. So we write [53] [49] [90].

[53] closes the text box.

[49] Loads moving sprites for person events into ram.

[90] Ends the script.

Which gives us the code:

[00] [00] [C7] [68] [65] [47] [4C] [XX] [XX] [53] [49] [90]

It should work.

Offline

#21 2014-09-25 21:25:35

pagara123
Member
Registered: 2013-11-06
Post 73/118
Website

Re: adding new trainer in map

sad :( i cannot process this completely when the trainer i insert he/she cannot go with me and start battle.when i press to the trainer he/she give me a blank txt and game freez?

Offline

Board footer

Powered by FluxBB