Jump to content

Moving Stationary Pokemon - B/W


Recommended Posts

I would like to relocate the interactable Pokemon in the game. Particularly the dreamworld Darmanitan in the desert resort. I would like to relocate them throughout Unova, or even just move them around the desert resort. Anyone have any idea where that data would be located? If it's in the mapping section, or if it's involved with the actual Pokemon. I don't think it's the latter, looking at the hex data, there doesn't seem to be any differences that involve coordinates.

Would be great if even the "tag" in the hex structure was known for overworld sprite locations. Like how the actual Pokemon of the interactable Pokemon is 7801XXXXYY where X is the hex value of the pokemon and Y is the level in hex. I can find the 5 Darmintan in that structure (78012B0223), but comparing the data surrounding these bytes isn't helping me out. Here's that data anyway starting at offset 079042D0 of the entire ROM:

2E 00 A6 00 47 05 28 00 21 80 00 00 B8 00 F8 01 01 00 21 80 09 00 21 80 08 00 01 00 11 00 01 00 1F 00 FF 97 00 00 00 34 00 07 00 02 00 47 00 10 80 09 00 10 80 08 00 00 00 11 00 01 00 1F 00 FF 72 00 00 00 28 00 22 80 00 00 B6 00 F8 01 01 00 22 80 09 00 22 80 08 00 01 00 11 00 01 00 1F 00 FF 4B 00 00 00 23 00 97 02 04 00 97 03 00 00 34 00 08 00 02 00 36 00 28 00 23 80 00 00 04 00 DE 03 00 00 78 01 2B 02 23 00 20 80 7B 01 23 80 09 00 23 80 08 00 01 00 11 00 01 00 1F 00 FF 0C 00 00 00 6C 00 11 80 79 01 1E 00 02 00 00 00 7A 01 1E 00 02 00 00 00 36 00 1E 00 0A 00 00 00 34 00 06 00 02 00 32 00 36 00 30 00 2F 00 02 00 2E 00 A6 00 47 05 28 00 24 80 00 00 B8 00 F8 01 01 00 24 80 09 00 24 80 08 00 01 00 11 00 01 00 1F 00 FF 97 00 00 00 34 00 07 00 02 00 47 00 10 80 09 00 10 80 08 00 00 00 11 00 01 00 1F 00 FF 72 00 00 00 28 00 25 80 00 00 B6 00 F8 01 01 00 25 80 09 00 25 80 08 00 01 00 11 00 01 00 1F 00 FF 4B 00 00 00 23 00 98 02 04 00 C9 02 00 00 34 00 08 00 02 00 36 00 28 00 26 80 00 00 04 00 10 03 00 00 78 01 2B 02 23 00 20 80 7B 01 26 80 09 00 26 80 08 00 01 00 11 00 01 00 1F 00 FF 0C 00 00 00 6C 00 11 80 79 01 1E 00 02 00 00 00 7A 01 1E 00 02 00 00 00 36 00 1E 00 0A 00 00 00 34 00 06 00 02 00 32 00 36 00 30 00 2F 00 02 002E 00 A6 00 47 05 28 00 27 80 00 00 B8 00 F8 01 01 00 27 80 09 00 27 80 08 00 01 00 11 00 01 00 1F 00 FF 97 00 00 00 34 00 07 00 02 00 47 00 10 80 09 00 10 80 08 00 00 00 11 00 01 00 1F 00 FF 72 00 00 00 28 00 28 80 00 00 B6 00 F8 01 01 00 28 80 09 00 28 80 08 00 01 00 11 00 01 00 1F 00 FF 4B 00 00 00 23 00 99 02 04 00 FB 01 00 00 34 00 08 00 02 00 36 00 28 00 29 80 00 00 04 00 42 02 00 00 78 01 2B 02 23 00 20 80 7B 01 29 80 09 00 29 80 08 00 01 00 11 00 01 00 1F 00 FF 0C 00 00 00 6C 00 11 80 79 01 1E 00 02 00 00 00 7A 01 1E 00 02 00 00 00 36 00 1E 00 0A 00 00 00 34 00 06 00 02 00 32 00 36 00 30 00 2F 00 02 00

Each color seems to be the data that relates to their respective underlined portion. The underlined portion can be modified to change the Pokemon, and am not sure exactly what the rest of the bytes represent. I looked for very closely related values (because if the coordinates are XY, they'd only be a few values off because all of the Darmanitan are clumped together), but was unsuccessful. There is a recurring pattern of certain values increasing by 3, and I've bolded a couple of those.

So, unless I'm missing something that isn't these "3-point differences" and varies between each set, I don't believe that the coordinates are tucked away here.

Edit: I did find that the F801 is the reverse hex of RageCandyBar, which is the item required to battle Darmanitan. I'd assume the 01 immediately after is how many you need. It's in each set twice because I'd expect there's a textbox that says "Used the RageCandyBar!" or something. I'm not sure what the text hex is, if it's B800 or B600. I still need to check a video to see if this is even said, otherwise I have no clue why it's in there twice.

Edit 2: Looked at a video and it's actually stated twice in the script. So, is this section all just script?

Edited by Exaskryz
Link to comment
Share on other sites

Huzzah! I have the answer! Or something. =p

Okay, I used the LUA scripts here and a bit of hex searching to isolate the overworld co-ordinates in hex. If you use the script (much thanks to Kaphotics for that) to get the X and Y co-ords of an overworld, then search it in hex in reverse (i.e. co-ordinates of X: 40, Y: 30, you would search for 28 00 1E 00) you should be able to find it. The relevant .narc is a/1/2/5, which will make your search a lot easier.

Here's some evidence; I edited which overworld sprites were in the Darmanitan area (BA 00 corresponds to the statue sprite, apparently):

IA2Lv.png

This is something I've been wondering about myself, so hopefully that helps!

For the record, a sprite ID that isn't known will result in a generic boy with blue hair. And from random experimenting (not including the ones in the pic as I just punched in odd numbers so I don't actually know which correlates to which :x) I found Celebi to be ID number 4380 (so 11 1C in the hex) and the other hgss sprites follow before/after like usual.

Never mind that; couple of hex values for sprites

D0 - Gift Box (from when you receive starters at the beginning)

D1 - Cottonee

D2 - Poke Ball again? Closer to the ground, though...

D3 & D4 - Reshiram

D5 & D6 - Zekrom

D7 - Cynthia

D8 - Poke Ball (in the air..?)

D9 - Deerling

1C11 - Celebi

I assume there's an easier way to find this out than trial and error, but some starting values there I suppose. And of course, just change the co-ordinate values if you're looking to do that.

---

And a look at the hex string of any one overworld, using one of the Darmanitan statues as an example...

06 00 BA 00 00 00 00 00 98 02 07 00 01 00 00 00

00 00 00 00 00 00 00 00 00 00 00 00 3B 00 23 00

00 80 01 00

This is presumably the ID of the overworld.

This is the sprite ID.

I believe this corresponds to the movement?

I THINK this is the flag...

This is the script ID, corresponding to that map's scripts.

Direction the overworld faces. 0 = up, 1 = down, 2 = left, 3 = right

I have a hunch these decide how far an NPC goes if their movement byte allows them actual movement

X co-ordinate

Y co-ordinate

Z co-ordinate, I think?

As far as things go, the layout seems identical to all five of the fourth gen games, although given it was based on the same engine it's not that surprising.

I better go back to exam revision...

Oh and one last thing, the LUA script also displays the map number, and the files in a/1/2/5 are divided between each of the maps so you should be able to relocate things pretty easy. The Desert Resort is #158, for example, so all the Darmanitan data (and others) will be in file 158 of a/1/2/5 and so on. I tried a little script copypaste and it totally failed, though, so I guess overworlds is all we can change for now.

Edited by Drayano
Link to comment
Share on other sites

Freaking Brilliant! Much appreciated Drayano! Being unable to emulate at a decent speed myself, I am grateful you were able to do this work. It'll be a while until I can get to a computer that can emulate quickly, so I won't be able to utilize this right away, but it's definitely handy.

I looked into LUA (because that looks very handy for these edits), but I have very little idea of what to do. I'm reading the readme that came with the download of lua 5.2.0 but I'm sort of lost on what to do with the whole making and installing lua. Using windows 7. And I'm sure this needs to be addressed: Where do I end up placing scripts? Do I make a script file, or do I just manually type them up into the terminal window (doubtful)? Ahh, being a novice to this aspect of hacking. The most I've done in regards to scripting has been with Auto Hot Key which was only for really simply tasks, but I'm a quick learner so anything you can provide me will be appreciated!

Link to comment
Share on other sites

I wish I knew how to LUA script myself, tbh, but I'm totally clueless on that front, heh. It doesn't look too complicated but I am totally clueless on how Kaphotics (or anyone else, for that matter) is able to figure out those offsets...

Scripts there's not a lot I can help you with really, they're contained within a/0/5/7 but every attempt I've made at throwing in scripts via hex just plain doesn't work. I believe someone would have to make a compiler/decompiler for it, but nobody's made any such thing at the moment... so yeah, getting the Darmanitan scripts to actually work might not be possible just yet... WRONG SCRIPT

DeSmuME has an option in it that lets you boot up a LUA script, so I think you can just place it anywhere really.

Link to comment
Share on other sites

Oh, interesting. Thanks for that; I probably never would've noticed DeS having the script options and would've started out going in the wrong direction from the get-go.

And to confirm, you're Z coordinate is correct. As appears to be the rest of what you've described (haven't tested that player movement limit thing though).

Edited by Exaskryz
Link to comment
Share on other sites

  • 2 weeks later...

I've got some more detailed information on overworld data.

As you will know by now, the corresponding narc file is a/1/2/5.

Say, this is a certain overworld's hex data:

03 00 0B 00 0F 00 00 00 00 00 B9 0B 02 00 04 00 00 00 00 00 02 00 03 00 00 00 00 00 FA 02 78 02 00 00 00 00

Description

  • 03 00 It's the overworld's ID data. You should never try to edit this. All overworlds on a certain map have IDs from 00 00 to ... (depending on the amount of overworlds on the map). So the above data corresponds with the 4th Trainer on the map.
  • 0B 00 This hex data contains the overworld sprite. If you open KazoWAR's BWOE, you can easily check the overworlds. 0B 00 for example is the Youngster. By using BWOE, you'll find out that 0C 00 corresponds with the School Kid (Male), 0D with Professor Juniper and 0F with the Lass.
  • 0F 00 This data corresponds with the movement of the overworld. Here are several movements I found out:
    MOVEMENT DATA
    02 00 Looking AROUND (randomly)
    03 00 Walking AROUND randomly till max
    04 00 Looking UP and DOWN
    05 00 Looking LEFT and RIGHT
    06 00 Looking UP and LEFT
    07 00 Looking UP and RIGHT
    08 00 Looking LEFT and DOWN
    09 00 Looking RIGHT and DOWN
    0A 00 Looking UP, DOWN and LEFT (randomly)
    0B 00 Looking UP, DOWN and RIGHT (randomly)
    0C 00 Looking UP, LEFT and RIGHT (randomly)
    0D 00 Looking DOWN, LEFT and RIGHT (randomly)
    0E 00 Looking UP
    0F 00 Looking DOWN
    10 00 Looking LEFT
    11 00 Looking RIGHT
    12 00 Looking UP, LEFT, DOWN, RIGHT (counter-clockwise)
    13 00 Looking UP, RIGHT, DOWN, LEFT (clockwise)
    20 00 Running DOWN till max, RIGHT till max; then returns + repeats
    21 00 Running RIGHT till max, UP till max; then returns + repeats
    In other words, the Youngster in above's hex data is ''Looking DOWN''. 03 00, 20 00 and 21 00 have ''till max'' in their movement description. That's something important I found out that will be explained later.
  • 00 00 It's the overworld's flag. If it's just a random Trainer or NPC, you shouldn't be bothered editing this.
  • B9 0B This is the data that corresponds with the map's script (like Drayano said).
  • 02 00 I haven't tested this one myself yet, but here's Drayano's information on this: ''Direction the overworld faces. 0 = up, 1 = down, 2 = left, 3 = right''
  • 04 00 This is a Trainer's Line of Sight. It is the Trainer's ''eyesight length'', literally. For overworlds that aren't Trainers, this is always 00 00. If you set it to 00 00 while it's a Trainer, the Player can still battle the overworld by talking to the overworld. This is the case with several Fishermen, for example.
  • 02 00 This is some new data. I found out that it's the ''horizontal movement area'' of the overworld. If you set it to 02 00, the overworld CAN move two tiles to the left and two tiles to the right of it's original set position. Now, if you set the movement to ''02 00'', it means that the overworld will randomly walk around, but limited to horizontally random walking. It means that the overworld walks around randomly in a limited space of 5 horizontal tiles. If you set it to 08 00, for example, you could say that the overworld can walk 8 tiles to the left and 8 tiles to the right.
  • 03 00 This is new data, too, but instead of a horizontal movement area, this of course, is the ''vertical movement area''. If you set it to 03 00 and the movement is set to ''02 00'', the overworld can walk three tiles down and three tiles up (maximally). Now, say you set the movement to 20 00 - Running DOWN till max, RIGHT till max; then returns + repeats. Horizontal movement area is 02 00 and vertical movement area is 03 00. It means that the overworld will run DOWN three tiles (''till max''), then run RIGHT two tiles (''till max''). Then it returns to its original spot and repeats the movement. It's as simple as that.
  • FA 02 This is the X coordinate of the overworld. The hex data is flipped, so FA 02 = 02 FA = 2FA (Hex). Put it in a calculator and it will give you 762 (Dec).
  • 78 02 This is the Y coordinate of the overworld. The hex data is flipped, so 78 02 = 02 78 = 278 (Hex). Put it in a calculator and it will give you 632 (Dec). So the overworld's coordinates are (762, 632) in dec. If you want to check this, you should use the LUA script to check your Player's coordinates in-game by using DeSmuME (a DS Emulator).
  • 00 00 This is the overworld's Z coordinate. It should be set to a certain number when the overworld is located on a higher leveled ground, for example on a hill in the Desert Resort, etc. Most of the times though, it will be 00 00, which means that it's right on the ground.
    three_dimensional_coordinate_example.gif

Link to comment
Share on other sites

  • 1 month later...
It doesn't look too complicated but I am totally clueless on how Kaphotics (or anyone else, for that matter) is able to figure out those offsets...

better late than never on a response :P

I used Pokesav which gave me the MXYZ coords of the save file, then searched for them in the memory when I entered the game. Moved around -> save -> get MXYZ -> search again. Ended up with the offsets I needed.

Usually you can do "different by 1" for each step and you'll eventually get a list of locations to narrow down by hand. Finding other offsets is just a memory search on certain values you expect to be related to what you want... then you corrupt them and see what they do!

Link to comment
Share on other sites

  • 5 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...