Jump to content

Diamond/Pearl Position LUA script


Recommended Posts

while true do
gui.text(1,184, string.format("Map: %d, X: %d, Y: %d, Z: %d", memory.readword(0x0226E750), memory.readword(0x0226E758,2), memory.readword(0x0226E75C), memory.readword(0x021CEF76)))
emu.frameadvance()
end

Thanks. But for some reason, it still refuses to work. When I stand in front of the Rival's house, it tells me I'm on map 876, X 414 Y 0 Z 1 when it should Map 410, X should be in the 100s, and Y should be in the 800s (knowing this from my scripting work on my hack). Why does Desmume hate me? Oddly, HGSS position LUA scripts work fine. And to boot, those values change randomly. In this example, Map turned into my Y co-ordinate. But I can't get them to work correctly.

incorrectpositioning.png

-Taken using a clean rom

Link to comment
Share on other sites

save game, save state

open pokesav, get coordinates

ram search the hex values of the coordinates (4 hex long)

eliminate by moving and resaving, etc. Change the memory locations to reflect the correct location.

Ok. I'll try that. More than likely fail, but try.

Edit: Thanks for telling me that. I got it to register correctly and now it is far more accurate. Thanks.

Link to comment
Share on other sites

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...