• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Forum moderator applications are now open! Click here for details.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Hacking Pokemon Diamond and Pearl (Hex)

gamefreakfatty

yuo shuld mak an dp map edtior
92
Posts
16
Years
Well, Martin is VERY strict with his rules about not sharing no$gba debug. Even though he seems to have disappeared, I don't feel comfortable sharing mine.

I sent him and email asking what can be done so that you (and a few other people I know) can get a copy of no$gba debug. If he does not respond after some time, I will consider giving you a copy of mine.

However, if you don't know much about programming, I doubt it will be useful to you.

Thank you! That would be a great help to those of us who are still working at hacking D/P/P. I emailed him almost a year ago about the PayPal situation. I haven't checked for around two months to see if it is back up yet, but the last time I checked it was still not working.
 
153
Posts
18
Years
  • Seen Jan 14, 2016
MINI UPDATE
I DO SOME PROGRESS REGARDING SIMPLE POLYGONS
I CAN MOVE FLOWERS AROUND THE MAPS!
fiorispostatimc3.png
 
Last edited:

SCV

DPP Game Researcher
178
Posts
16
Years
Hi Pichu2000, I was wondering whether you new how to find the script associated to a particular event.


For example, this is the galactic grunt at valley windworks:
06 00 00 00 00 00 7C 00 0F 00 00 00 AC 01 03 00 01 00
03 00 00 00 00 00 00 00 00 00 F3 00 8F 02 00 00 00 00

How would I find the script that corresponds to this event?



Here is some more stuff:
These are the Person events from the Sky Pillar.

The first two bytes of what I bolded seem to be script numbers. However in some places those are completely blank.

Notice that two of the events have the same first two bytes, this is because of the two double battles.
However there man
Code:
00 00 7D 00 0F 00 00 00 [B]E6 01 06 00[/B] 01 00 00 00 
00 00 00 00 00 00 00 00 1E 00 30 00 00 00 00 00 
01 00 78 00 00 00 00 00 [B]E8 01 01 00[/B] 01 00 00 00 
00 00 00 00 00 00 00 00 1F 00 1C 00 00 00 00 00 
02 00 79 00 0F 00 00 00 [B]E7 01 0C 00 [/B]01 00 00 00 
00 00 00 00 00 00 00 00 21 00 20 00 00 00 00 00 
03 00 7C 00 0F 00 00 00 [B]E6 01 06 00[/B] 01 00 00 00 
00 00 00 00 00 00 00 00 20 00 30 00 00 00 00 00 
04 00 7B 00 0F 00 00 00 [B]E7 01 0B 00[/B] 01 00 00 00 
00 00 00 00 00 00 00 00 1D 00 20 00 00 00 00 00 
05 00 66 00 00 00 00 00 [B]E2 01 01 00[/B] 01 00 00 00 
00 00 00 00 00 00 00 00 1F 00 15 00 00 00 00 00 
06 00 94 00 00 00 00 00 [B]E3 01 01 00[/B] 00 00 00 00 
00 00 00 00 00 00 00 00 1E 00 23 00 00 00 00 00 
07 00 65 00 00 00 00 00 [B]E4 01 07 00[/B] 00 00 00 00 
00 00 00 00 00 00 00 00 1D 00 23 00 00 00 00 00 
08 00 63 00 00 00 00 00 [B]E5 01 08 00[/B] 01 00 00 00 
00 00 00 00 00 00 00 00 1D 00 24 00 00 00 00 00 
09 00 97 00 00 00 00 00 [B]EC 01 00 00[/B] 01 00 00 00 
00 00 00 00 00 00 00 00 1F 00 10 00 00 00 00 00 
0A 00 98 00 00 00 00 00 [B]ED 01 00 00[/B] 01 00 00 00 
00 00 00 00 00 00 00 00 19 00 17 00 00 00 00 00 
0B 00 99 00 00 00 00 00 [B]EE 01 00 00 [/B]01 00 00 00 
00 00 00 00 00 00 00 00 25 00 17 00 00 00 00 00 
0C 00 57 00 00 00 00 00 [B]FF 03 55 1C[/B] 00 00 00 00 
00 00 00 00 00 00 00 00 1F 00 0A 00 00 00 00 00 
0D 00 57 00 00 00 00 00 [B]01 04 56 1C[/B] 00 00 00 00 
00 00 00 00 00 00 00 00 1F 00 0A 00 00 00 00 00

P.S. I decided that I am not going to leak no$gba debug. I don't know what happened to Martin but after taking to a few other people who own it, I decided that it would not be good to share. If you tell me how you intended to use it to make progress, I can try to study that.

I am going to get more active into studying scripting and events, so I will love to help you develop this topic.
 
Last edited:
153
Posts
18
Years
  • Seen Jan 14, 2016
Thanks Scv!

Miniupdate
I found how to edit script's movement
These are showed in this way
NN(Type of movement) 00 XX(movement repetition) 00 ....
For example Twinleaf town rival script(0x1d9fda0)

Code:
47 00 01 00 0D 00 01 00 48 00 01 00 FE 00 00 00
4B 00 ......

47 rapresented hero's movement(When crash with something)
0D rapresented hero's back jump
48 rapresented same hero's movement 47
FE idem
4B rapresented rival esclamation....
 

SCV

DPP Game Researcher
178
Posts
16
Years
I take back what I said above about the first two bytes. They must be related to the script somehow, but I don't know how. The script is actually the last two bytes of what I bolded as stated in the original post.

I have found how trainer battles are scripted. I will update later with some examples. These are done in two different ways. One strictly from the event file and another through the scripts.

Pichu2000, do you know if there is any place that stores which event files and script files are associated for a certain map?
 
153
Posts
18
Years
  • Seen Jan 14, 2016
I take back what I said above about the first two bytes. They must be related to the script somehow, but I don't know how. The script is actually the last two bytes of what I bolded as stated in the original post.

I have found how trainer battles are scripted. I will update later with some examples. These are done in two different ways. One strictly from the event file and another through the scripts.

Pichu2000, do you know if there is any place that stores which event files and script files are associated for a certain map?

No I don't konw yet... I found events and script trying and trying...
 

SCV

DPP Game Researcher
178
Posts
16
Years
OK, here is an example of trainer battle events and of trainer battle scripts.

These are trainers in Route 202.
Code:
00 00 04 00 0F 00 01 00 00 00 [B]B8 0B[/B] 01 00 05 00
00 00 00 00 00 00 00 00 A6 00 2D 03 00 00 01 00 
01 00 06 00 0F 00 01 00 00 00 [B]BA 0B[/B] 01 00 04 00 
00 00 00 00 00 00 00 00 B5 00 32 03 00 00 01 00
02 00 04 00 0F 00 01 00 00 00 [B]B9 0B[/B] 01 00 05 00 
00 00 00 00 00 00 00 00 B9 00 24 03 00 00 01 00
For certain battles, the battle is linked from the event file by using a number between 0xBB8 and 0xF09. These battles are ordered according to trdata.narc and trpoke.narc

This is the second battle with Cyrus:

E5 00 94 01 00 00 EC

If you search the script file for E500 you will get 102 instances. Not all of these are trainer battles. Only the ones that have a number between 0x1 and 0x1 and 0x351.

A warp is showed in this way

74(bOH) 6B 03(Animation) 9C 01(Maps in which you are going to go)

Here's a list of Warp - Maps

This should be

74 00 6B 03 9C 01 00 00
[2 bytes for X coordinate] [2 bytes for Y coordinate] [two bytes for Map Number] [2 bytes for warp number within that map]

Will update later with a bit more about the structure of event files.

EDIT:
As promised, here is some information on the structure of the event files.

The event files have 4 sections.
As of now I don't know what the first and last are for but I will figure it out.

The file starts out with 4 bytes telling you how many of the first type of events there are. Then each entry is 0x14 bytes long.
Then come 4 bytes telling you how many "person" events there are. Each person event is 0x20 bytes long.
Then come 4 bytes telling you how many warps there are. Each warp event is 0xC bytes long.
Then come 4 bytes telling you how many of the fourth type of events there are. Each of these events is 0x10 bytes long.

Not all locations use all of these types of event. When a type is not used the 4 bytes which tell you how many of that type there are will be 00000000, then then next 4 bytes will be how many of the next type of event there are.

There are a few event files which don't have any events at all. The look like:
00000000 0000000 00000000 00000000
 
Last edited:
3
Posts
15
Years
Pichu2000 your tutorial is super, but I don't know how to change the hero's sprite. I would like change the sprite of hero in the sprite of Lucario guy. Can you help me please? What hexa code can change the sprite and the line where the code must to change. (sorry for my english, I learn in school in Switzerland)
 

SCV

DPP Game Researcher
178
Posts
16
Years
Pichu2000 your tutorial is super, but I don't know how to change the hero's sprite. I would like change the sprite of hero in the sprite of Lucario guy. Can you help me please? What hexa code can change the sprite and the line where the code must to change. (sorry for my english, I learn in school in Switzerland)
Are you talking about the trainer battle sprite or the overworld sprite?
 

SCV

DPP Game Researcher
178
Posts
16
Years
I would like the both sprite if it's possible

I posted a list of the pokeball throw sequences here: http://www.pokecommunity.com/showpost.php?p=4238206&postcount=1507

Look in the thread that I link to in my sig and there is a link to a zip file with some tools that will allow you to do this. (Its at the beginning of the basics section).

What you need to do is extract the narc containing the sequence for Riley and the palette for Riley as well as those two files. Do this with tahaxan tihaxa. Then use PPNFR (also included in the zip) to insert the palette and then the sequence for riley into the place where the palette and the sequence for the hero is (respectively).

For the back sprite and the front sprite use loadingNOW's PokeDSPic, get it at http://pokeguide.filb.de/, to find the values for the image in \poketool\trgra\trbgra.narc and \poketool\trgra\trfgra.narc. You can extract the riley ones and insert them into the spot where the hero's are with PokeDSPic or use Tahaxan tihaxa and PPNFR as well.

There is a list of offsets for the overworld sprites for DP here: http://www.pokecommunity.com/showpost.php?p=4236332&postcount=1504

take the ones for DP and make a file named list.txt and put it in a directory with PokeTex. Then open your DP rom in PokeTex and find the overworld sprites for the hero and Riley. Use tahaxan tihaxa, look in \data\mmodel\ and find the files that would inclode those offsets. Extract the one for riley and insert it with PPNFR into the spot for the hero.

This is a really way job if you know what you are doing. Try to do it and if you have questions let me know.

If by any change you don't know what extracting narc files or files inside narc files means, read about it in the thread I link to in my sig.

NOTE: This will not edit the overworld sprites for the hero using surf or fishing, etc. For that you would have to edit that manually using PokeTex. You can find an Poketex that is in english (for the most part IIRC) in the Diamond & Pearl & Platinum Hacking thread. Use the search function to search there.
 
Last edited:
11
Posts
15
Years
  • Seen Oct 25, 2009
Ohh a useful D/P document! i will see if the work but I think they do.
Good job of finding this data, pichu2000!
 
Last edited:
153
Posts
18
Years
  • Seen Jan 14, 2016
Big Update!!!
I have insert all progress abourt scripting that I and Scv had during this month.+
See first post script section
 
Last edited:

codemonkey85

Software Developer
22
Posts
15
Years
RE: Map IDs

Hey pichu2000,

By any chance do you have a list (or partial list) of map "warp" IDs for Pokémon Platinum in addition to the ones you posted? It would be very useful to me, as I am programming a code library for Pokémon DS save file hacking (which incidentally will be open source).

Thanks for reading, and thanks for posting the Diamond / Pearl IDs! I looked all over for those.
 
Back
Top