• 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 places on the 'net to talk Pokémon and more! Community members will not see the bottom screen advertisements.
  • Want to share your adventures playing Pokémon?
    Check out our new Travel Journals forum for sharing playthroughs of ROM Hacks, Fan Games, and other Pokémon content!
  • IMPORTANT: Following a takedown request, the following hacks have been delisted from PokéCommunity:

    • Pokémon Glazed
    • Pokémon: Giratina Strikes Back
    • Pokémon Flora Sky
    • Pokémon Stranded
    The downloads and discussion threads for these hacks will no longer be accessible, and staff will be unable to return questions regarding accessing this content.

Development: Adding New Moves to Gen 3

16
Posts
11
Years
  • Seen Jun 11, 2021
I'm trying to figure out how to implement Dragon Tail's effect, but I'm not sure if the Whirlwind/Roar effect has anything built into it to handle doing damage.

How would you modify the Whirlwind/Roar effect to have it do damage before it switches the target out?
 

timson733333

Woah.
135
Posts
16
Years
Sorry for sounding like a noob (because I've never hex edited anything before,) but... What's all this repointing about and how do you do it? And how much is 4260 bytes?

Correct me if I'm wrong, but repointing is when you take the reverse offset of the regular table and replace all instances of it in the ROM with the reverse offset of the new table...? That's what I've been doing, so I hope I haven't been screwing it up.

Make sure you leave (13 * number of new attacks) free bytes after the end of the data you just copied before doing this next stage.

Next, navigate to 0x1C68F4, and copy 1420 bytes, and paste them into free space in the ROM, making sure the pointer is THUMB aligned. That is, ends with a 0, 4, 8 or C.

Then, go back to 0x1C68F4 and copy (4 * number of new attacks) bytes of data, and paste it into the area after the already copied data. So for example, if you repointed to 0x9F0000, you would paste this latest data starting at 0x9F058C.

I don't get these steps.

EDIT: Okay, now I get it. I've expanded the move table! But when I view the moves in PGE, they're all glitched and have random powers/effects, and when I boot up my ROM, it crashes after gender selection. Am I doing something wrong? I selected the bytes in hex; should I have selected the bytes in decimal (e.g. converting 4260 to 10A4?) Other than that I think I repointed right (unless my definition of repointing was wrong, then please correct me) and I put everything into free space.

EDIT AGAIN: I selected the bytes in decimal and this time the moves came out clear. I made the move after Psycho Boost have a name, and then I booted up the ROM. Still crashes at gender selection. Is there something else I need to do?

EDIT YET AGAIN: Ok, it looks like whenever there's a name input, the game crashes. But the moves work just fine if I upload another savestate and bypass the name selection.

I'm trying to figure out how to implement Dragon Tail's effect, but I'm not sure if the Whirlwind/Roar effect has anything built into it to handle doing damage.

How would you modify the Whirlwind/Roar effect to have it do damage before it switches the target out?

I've played a hack where the creator has effects play one after another (like Close Combat, the special defense drop is applied separately after the defense drop; or Growth, where the Special Attack rise is applied as a separate effect after the Attack rise.) So you might be able to make it have a damaging effect first, and then the Whirlwind effect afterwards. However, it will break through a Substitute.
 
Last edited:
2
Posts
11
Years
  • Seen Aug 8, 2012
Correct me if I'm wrong, but repointing is when you take the reverse offset of the regular table and replace all instances of it in the ROM with the reverse offset of the new table...? That's what I've been doing, so I hope I haven't been screwing it up.

Uh. Sorry, I still don't get it, Timson. >.< Sorry for being such a noob...

EDIT: Okay, now I get it. I've expanded the move table! But when I view the moves in PGE, they're all glitched and have random powers/effects, and when I boot up my ROM, it crashes after gender selection. Am I doing something wrong? I selected the bytes in hex; should I have selected the bytes in decimal (e.g. converting 4260 to 10A4?) Other than that I think I repointed right (unless my definition of repointing was wrong, then please correct me) and I put everything into free space.

EDIT AGAIN: I selected the bytes in decimal and this time the moves came out clear. I made the move after Psycho Boost have a name, and then I booted up the ROM. Still crashes at gender selection. Is there something else I need to do?

EDIT YET AGAIN: Ok, it looks like whenever there's a name input, the game crashes. But the moves work just fine if I upload another savestate and bypass the name selection.

You're just lucky you got it to work. All I've done is crash my ROMs. I don't know where to paste or what to do or what to "repoint."
 

timson733333

Woah.
135
Posts
16
Years
Uh. Sorry, I still don't get it

Gonna try my best to explain...

Ok, so you know that pointers in the hex are the reverse of the offset that it points to, right? So if we have some stuff at 0xABCDEF, there will be instances of the hex code "EF CD AB" in the ROM. These instances are read to "point" towards 0xABCDEF. If you move some stuff from and after 0xABCDEF to a free space offset, let's say 0x900000, you haven't yet told the ROM to read off of there. So what you do is replace all instances of "EF CD AB" with "00 00 90" (the reverse of 900000.) That way the ROM knows to read from 0x900000, and not 0xABCDEF.
 
16
Posts
11
Years
  • Seen Jun 11, 2021
I've got something that might work for Dragon Tail. I pretty much wrote the code and added the bit between the Whirlwind/Roar pointer and the next pointer. Not sure if this would work or I would need to do something different with it:

Code:
0[COLOR=black]0 01 5E 69 1D 08 00 00 02 03 04 05 06 07 09 0A 0E 5C 00 3A 0B 00 0C 00 0D 12 40 00 0F 12 40 00 00 02 03 1E 00 15 08 94 1D 08 21 00 00 04 00 00 00 27 8F 1D 08 01 F2 7D 1D 08 FF FF 01 60 69 1D 08 00 00 8F F2 7D 1D 08[/COLOR]

Also, I unfortunately don't know where the table with the pointers for individual attack effects is in Fire Red. If this is where I'm supposed to have a pointer to this, or if it's a different table, could you please tell me?

Sorry fo the trouble.
 

timson733333

Woah.
135
Posts
16
Years
EDIT YET AGAIN: Ok, it looks like whenever there's a name input, the game crashes. But the moves work just fine if I upload another savestate and bypass the name selection.

I recently tried doing everything again, only to be met with the same result. Do I need to use JPAN's hacked engine, or am I repointing things wrong?
 

BrandoSheriff

Has a tendency to figure things out
776
Posts
16
Years
Is there a resource that tells where the list of effects and commands are for doing battle script work in Ruby? Everything seems to be only for Fire Red, as far as I can see. xD
 

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
I recently tried doing everything again, only to be met with the same result. Do I need to use JPAN's hacked engine, or am I repointing things wrong?

I just tested with a fresh save (a completely fresh save on the 649 patch, which has had this hack applied) and it got through to Pallet Town with no issues whatsoever.

However, I may have missed out some steps or something somewhere along the line in this thread. I'll see if I can find any such missed steps.

ETA: Did a quick dry run, and it worked absolutely fine, so I genuinely don't know what the problem is.

Is there a resource that tells where the list of effects and commands are for doing battle script work in Ruby? Everything seems to be only for Fire Red, as far as I can see. xD

Answer to this is simple - I'm the only person researching these commands. I researched them for FR because I need them for FR. Simples.

However, the good news is that the BS system was carried over from Ruby to FR in the first place, so if you update your pointers correctly, it should still be compatible.
 
Last edited:

BrandoSheriff

Has a tendency to figure things out
776
Posts
16
Years
I see. I'll just search for the table of battle scripts. I'll amend(sp?) with the offset and similar findings if I happen to find it.

So, once I've created my custom script, how do I go about using it in game? Do I need to repoint the effect table and add a new effect at the end for the new move? Or could I replace what looks like effect 214? Scratch that, I've figured it out.

EDIT: I have located the table of the 214(213?) different effects in Ruby. That offset is 0x1D6BBC.
The basic damage script seems to be located at 0x1D6F3A as well.

I've noticed that the basic damage script is completely identical between Ruby and Fire Red. The only difference is that pointer at the beginning.

Never thought I'd say this, but this is actually quite fun, searching for the bits and pieces that make up a game. But how do I know what I need to copy after the storebyte command? How would I create a 2-turn attack? Does the "first turn fly/bounce/dig/invincible" go before the part that does damage? Same with the high crit rate effect.
 
Last edited:

timson733333

Woah.
135
Posts
16
Years
Now, navigate back to 0x250C04 and copy (12 * number of new attacks) worth of data. This should ensure that the new attacks you add inherit some sensible data which PGE can work with.

I didn't see this step before. o_o

Anyways, where am I supposed to paste this data?

Edit: Ok, I posted it directly after the corresponding pasted data and the moves work like a charm in Emerald. But I don't think I've found the limiter. I did a hex string search for the corresponding limiter in FireRed (B1 20 40 00 81 42), but when I overwrote that with 0s it still didn't work. Help?
 
Last edited:

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
I didn't see this step before. o_o

Anyways, where am I supposed to paste this data?

Edit: Ok, I posted it directly after the corresponding pasted data and the moves work like a charm in Emerald. But I don't think I've found the limiter. I did a hex string search for the corresponding limiter in FireRed (B1 20 40 00 81 42), but when I overwrote that with 0s it still didn't work. Help?

You're not crazy. It wasn't there before. I added it because I noticed that PGE didn't like having a bunch of 0xFFs as the "data".

Same applies to the names.

The limiter is in a different location in Emerald, and may not use that string of hex commands. I believe Gamer2020 posted the location of that limiter a few posts after the first post. Check his post out.

You ARE correcting the offsets for Emerald, right? I just want to make sure you are, because all the pointers in my first post are for FR specifically.
 

timson733333

Woah.
135
Posts
16
Years
You're not crazy. It wasn't there before. I added it because I noticed that PGE didn't like having a bunch of 0xFFs as the "data".

Same applies to the names.

The limiter is in a different location in Emerald, and may not use that string of hex commands. I believe Gamer2020 posted the location of that limiter a few posts after the first post. Check his post out.

You ARE correcting the offsets for Emerald, right? I just want to make sure you are, because all the pointers in my first post are for FR specifically.

Yep, I found the corresponding offsets in roms.ini. I saw Gamer2020's post and replaced the bytes, and it worked. Nothing seems to be wrong now (name input doesn't screw up the game, like my first attempt with FireRed did) but I'll post here if I encounter any further errors.

EDIT: I uploaded the .ips of the FireRed modification I did. The move table is expanded, but it always crashes at name selection. Test it, I really want to know what I'm doing wrong in FireRed because the expanded move table works flawlessly in Emerald.

Offsets I repointed to:

Attack names - 0x8DC410
Attack data - 0x723D80
Attack animations - 0x7F8F60
 
Last edited:

itman

Back to ROM hacking. :D
98
Posts
16
Years
  • Age 30
  • Seen Feb 5, 2014
I made move effects for U-turn/Volt Tackle, Wake-Up Slap, and Hammer Arm.

I tested them and they work.

U-Turn/Volt Tackle
Spoiler:


Wake-Up Slap
Spoiler:


Hammer Arm
Spoiler:
 

itman

Back to ROM hacking. :D
98
Posts
16
Years
  • Age 30
  • Seen Feb 5, 2014
Can anyone please test the patch I made?

I just did everything that JPAN said in his post and it worked without any problems, so to be honest you probably did something wrong. I would just start over and try again. Make sure you correctly repoint ALL the pointers to the new locations of each table, since there are A LOT.
 

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
I just did everything that JPAN said in his post and it worked without any problems, so to be honest you probably did something wrong. I would just start over and try again. Make sure you correctly repoint ALL the pointers to the new locations of each table, since there are A LOT.

JPAN?! WHAT?! How very dare you?! Lol.

In actual response, I've tried it several times on both clean and pre-hacked ROMs, and every time it's worked, and I followed my own tutorial to do it, I may add, so it does work.
 

itman

Back to ROM hacking. :D
98
Posts
16
Years
  • Age 30
  • Seen Feb 5, 2014
JPAN?! WHAT?! How very dare you?! Lol.

In actual response, I've tried it several times on both clean and pre-hacked ROMs, and every time it's worked, and I followed my own tutorial to do it, I may add, so it does work.

I am so sorry! I meant Jambo, I get you two confused because I've used both of your resources and such so much. AH. I'm sorry. :'(

But yeah, you're way definitely works. Would you be okay if I made kind of a more tutorial? With pictures and things, since this is huge and I don't want this to not be used, it's just incredible.
 

timson733333

Woah.
135
Posts
16
Years
I'll try it again for FireRed, I'm doing it for Ruby right now to see if it works, but roms.ini doesn't have the attack animations. Can someone tell me where that is?
 
248
Posts
12
Years
  • Age 43
  • Seen Jan 30, 2017
can you do a video explaining everything so it can be less complicated
 

DoesntKnowHowToPlay

Tiny Umbrella with Lots and Lots of Good
265
Posts
12
Years
  • Seen Feb 24, 2024
So I figured out a nifty trick that would have been nice to know earlier:

The command 2A can be used in battle scripts to read arbitrary halfwords and jump depending on their value- by checking x02023D4a, this can be used to detect which attack is calling the script. This is actually done by the game to detect Surf and Whirlpool so it can make them pierce Dive. For example:

2A 00 4A 3D 02 02 5D 01 FB 85 1D 08
This command will cause a jump to x1D85FB if the move being used is x15D- Dragon Dance. If the move is not Dragon Dance, the script simply continues. We can utilize this to map different effects to a single effect byte- this allows us to make our new attacks AI-friendly by mapping them to similar effect bytes. For example, if we put Shift Gear's script after this check, we can give it Dragon Dance's effect byte, and the AI will treat Dragon Dance and Shift Gear the same way. It also allows us to easily take advantage of effects that aren't handled by script- we can make Flare Blitz defrost the user by giving it script x7D (Flame Wheel) without losing the recoil effect, for example. It also means there is no need to repoint the battle script table, as we only need to branch off the existing scripts rather than add new ones to the table.

Speaking of defrosting- if any moves in the expanded move table have effect byte x7D (such as Scald and Flare Blitz), they will produce garbage text when they defrost the user. To fix this, go to 0xD7E96 and place six 00s there.
 
Back
Top