The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary ROM Hacking (https://www.pokecommunity.com/forumdisplay.php?f=284)
-   -   Script Pewter Guidepost Man Issue (https://www.pokecommunity.com/showthread.php?t=392797)

KrustyKong May 17th, 2017 11:54 PM

Pewter Guidepost Man Issue
 
I'm trying to edit the paths the boy in Pewter that shows you to the Gym walks. I got the first part of the script done fine but this part is giving me some hell #org 0x165F71. When I enter the commands and compile, the commands change. I'm trying to put in these:
#raw 0x10
#raw 0x12
#raw 0x10
#raw 0x30
#raw 0x28

but it ends up as these:
#raw 0x10 'Step Down (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x25 'Step on the Spot Down (Faster)

tkim May 18th, 2017 9:49 AM

Quote:

Originally Posted by KrustyKong (Post 9650462)
I'm trying to edit the paths the boy in Pewter that shows you to the Gym walks. I got the first part of the script done fine but this part is giving me some hell #org 0x165F71. When I enter the commands and compile, the commands change. I'm trying to put in these:
#raw 0x10
#raw 0x12
#raw 0x10
#raw 0x30
#raw 0x28

but it ends up as these:
#raw 0x10 'Step Down (Normal)
#raw 0x12 'Step Left (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x10 'Step Down (Normal)
#raw 0x25 'Step on the Spot Down (Faster)

It's because you're overwriting the bytes and your entry is longer than what that offset holds. raw bytes are actually the bytes shown when you open the ROM with a hex editor and go to the offset. these movement byte entries always end with 0xFE. You'll have to use another offset or do a search in the hex editor, the bytes you want to use and if you can find it, just repoint the offset to the found location.

KrustyKong May 18th, 2017 10:28 AM

Quote:

Originally Posted by tkim (Post 9650740)
It's because you're overwriting the bytes and your entry is longer than what that offset holds. raw bytes are actually the bytes shown when you open the ROM with a hex editor and go to the offset. these movement byte entries always end with 0xFE. You'll have to use another offset or do a search in the hex editor, the bytes you want to use and if you can find it, just repoint the offset to the found location.

I think in this particular case, it would be easier to make the initial script short, then use the Delay command during the next part. How would I go about doing the suggestions you gave in case this comes up again later?
Also I'm not sure how me adding three bytes to an originally 2 command script raises the total from an expected 5 to 6?

tkim May 19th, 2017 8:47 AM

Quote:

Originally Posted by KrustyKong (Post 9650777)
I think in this particular case, it would be easier to make the initial script short, then use the Delay command during the next part. How would I go about doing the suggestions you gave in case this comes up again later?
Also I'm not sure how me adding three bytes to an originally 2 command script raises the total from an expected 5 to 6?

the easiest laziest way to do this would be to search for free space and use that free space's offset. For example, you've found free space at 0x800000, then you would replace the 0x165F71 with 0x800000 within the script itself, while adding in your custom movements to that offset. You must end your movement with 0xFE.

It's actually originally three commands (10, 25, FE). and you were overwriting those three(it doesn't go beyond 0xfe i guess) (in your case, only the first three of your custom movements overwrote those bytes. It became 6 (7 including 0xFE) because you got rid of the 0xFE when you overwrote, so the next set of commands were bridged to yours.

basically: your entry can't be longer than the original, otherwise you need to use a different offset.

KrustyKong May 19th, 2017 6:30 PM

Quote:

Originally Posted by tkim (Post 9651622)
the easiest laziest way to do this would be to search for free space and use that free space's offset. For example, you've found free space at 0x800000, then you would replace the 0x165F71 with 0x800000 within the script itself, while adding in your custom movements to that offset. You must end your movement with 0xFE.

It's actually originally three commands (10, 25, FE). and you were overwriting those three(it doesn't go beyond 0xfe i guess) (in your case, only the first three of your custom movements overwrote those bytes. It became 6 (7 including 0xFE) because you got rid of the 0xFE when you overwrote, so the next set of commands were bridged to yours.

basically: your entry can't be longer than the original, otherwise you need to use a different offset.

Forgot to mention that I never overwrote 0xFE. I'm gonna go ahead and do the free space thing, but I still wanna know where the third 0x10 came from where there's supposed to be 0x30. like, I'd think it'd be
#raw 0x10
#raw 0x12
#raw 0x10
#raw 0x30
#raw 0x10
#raw 0x25


All times are GMT -8. The time now is 9:14 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.