You are not logged in.
This is one of Miksy91's hacking videos, it explains how to add trainer data.
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.
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)
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 - 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)
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.
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:
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.
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)
The pointer for 0x1223A0 is 63A0 not 60A0.
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??
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   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.:
  [C7]  
In my case, "14e8c7" is the address where "65" is written. By using the Pointer Calculator, converting "14e8c7", I ended up with [C7] . 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:
  [C7]    [4C] [XX] [XX]
So we have to END the script now. So we write   .
 closes the text box.
 Loads moving sprites for person events into ram.
 Ends the script.
Which gives us the code:
  [C7]    [4C] [XX] [XX]   
It should work.