• 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?".
  • 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.

[Script] Overwrite existing scripts but keep the same offset?

4
Posts
6
Years
  • Age 31
  • Seen Nov 20, 2021
I am 3 weeks new to pokemon hack rom and decided to make my own romhack so far I have some understanding of scripting.

Is it possible to overwrite existing scripts but keep the the offset (or overwrite the offset) do to a small change ( items wise) without wasting free space (or is it not a waste since I expanded the ROM to 32MB)?... is it impossible?... or possible but isn't worth the time and effort?

What I want to do is just tweak the TM item on every gym leader/npc and item in the overworld that give it to the player (because i have used TM expansion its not giving the right item). I am using a Clean Emerald as a base (I explained the ROM to 32MB) with Dizzy's Battle Engine Upgrade, pokemon Expansion, ItemTmTutor Expansion, and Various feature.

So, what I want to do is just go to the existing scripts and change the TM/HM item index to the correct one so it would give the correct TM item because it is using the old TM/HM item index. However, I was thinking if I am just doing 1 small change to the giveitem 0x[TM Item Index] and replacing the old script would it cause the game to glitch out or something if i just save the old script edit and compile it? Or do I have to re-write all the scripts containing the all the old TM item index and give it some free space?

Note: I am not changing anything related to the storyline in Pokemon Emerald im just adding new pokemons, items, moveset, and others. While keeping the Emerald default storyline and some events the same. ATM...
 
242
Posts
6
Years
  • Age 30
  • Seen Apr 3, 2023
Yeah you can goto the offset for the script in a hex editor and then look for the giveitem part of the script and change the value of the TM, this way you don't have to re-compile the script.

For example I want to change the TM Brock gives in FR I grab his offset in A-map (16A5F3) and then I study the code and I find 47 01 this is 147 reversed which is the number for Rock Tomb so I change that :)

I also do backup before I make change to make sure I don't mess up.
 
4
Posts
6
Years
  • Age 31
  • Seen Nov 20, 2021
Ah... forgot about hex editing method it instead of re-compiling it... >.<

Thanks for the reply I will try it that way then.
 
Back
Top