• 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 fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Adding New Moves and Creating New Move Effects

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
I've got a question here.

I'm trying to create the effect for Hurricane, so I basically copied Thunder and replaced the 05 byte (for paralysis) with a 07 (for confusion). I then paste wrote the code to another offset, pointed one of the effect indices to that offset, and then assigned that effect to the attack slot for Hurricane (which I had already created).

The problem is that although Hurricane successfully confuses, it doesn't always hit in the rain, but I pasted the code for Thunder byte-for-byte. So I don't know what's wrong here.

I then decided to test something else: I assigned Thunder's effect to Hurricane, except this time I changed the 05 byte in Thunder to 07. Now Hurricane confuses and always hits in the rain with the effect at this offset, but not with the effect at the copied offset.

The code for Thunder is:
2E 85 3E 02 02 05 35 D0 3D 02 02 00 00 01 00 28 00 69 1D 08

Can anyone help me out?

Doesn't is correct in saying it's hardcoded. However, all is not lost, as you could also set the script up to branch dependent on the Move's ID. Given that it uses the same effect ID, that could potentially work just as well.

Code:
2A 00 4A 3D 02 02 57 00 [Thunder Offset] 2E 85 3E 02 02 07 28 00 69 1D 08

Obviously, this code assumes that Hurricane doesn't pierce Fly/Bounce, but if it did, you would simply branch to the original Thunder code AFTER the setting of 0x02023E85 to 0x5. In this way, you can have variations on Thunder's effect of 100% accuracy in rain with confusion and such.

Well, crap. I don't know how to do that (quite yet).

Is Solarbeam skipping its charge turn in strong sunlight also hardcoded to the moveslot?

No, IIRC that one is built into the Battle Script. It simply checks the current weather and if it's Sunny, skips the usual waiting turn.
 

Perri Lightfoot

Let's give it a go!
173
Posts
16
Years
  • Age 38
  • Seen Apr 17, 2022
Some supplemental information to this tutorial for Ruby hackers:

Offsets:
0x1FB12C = Attack Data (0x1FB130 for PP pointers)
0x1F8320 = Attack Names
0x1C7168 = Attack Animation Table
0x1D6BBC = Move Effect Table
0x3CF594 = Contest Data. This must be repointed along with the rest of the above data (and the new moves given contest data), or else the game will freeze when attempting to display the Contest Moves tab. To repoint it using the same technique described in the tutorial; go to this offset and Select Block = 2840. Copy, and go from there. :)
0x3C09D8 = Attack Description Table. This must also be repointed, or the game will start to overwrite important data (starting with Natures). To repoint it using the same technique described in the tutorial; go to this offset and Select Block = 1416. Copy, and go from there. :)

How to give a new move Contest Data:
Image136_zps5ff9c738.png

A screenshot from Super Rising Thunder; demonstrating the contest data for new moves. Since my hack doesn't use Contests; I edited the graphics and text to display the move's type instead.

Every move in Pokemon Ruby has Contest Data. This is an eight-byte data structure that contains the information that determines how the move functions when used in a Contest setting, and is set up like this:

00 04 3C 00 00 00 00 00

This is Pound's Contest data. The first byte determines what message is displayed in the summary - for example, "A highly appealing move!" This also determines the move's appeal/jam. The second byte is the Contest Type - in this case, Tough. The next byte is a combo identifier, used to identify the first move used in a Contest Combination. In contests, Pound can be used in combination with DoubleSlap, Faint Attack and Slam to rack up additional points. The next three bytes also relate to combos - if the move can be used second in a Contest Combination, the byte for the move(s) it can be combined with would go here, up to three.
The last two bytes are padding and should always be set to 00. For more information, refer here and here.

Now, go to where you repointed your Contest data table and skip down to the end (where the FF's begin again). If your hack doesn't bother with Contests you can put anything you want here - even 00 00 00 00 00 00 00 00 for each move if you so desired, just to keep the game from freezing. If your hack DOES use contests...I don't see why it wouldn't be possible to be able to use the new moves in combination with an old one in Contests, or to assign it a byte unused by the moves already there to have it lead a new set of Combinations. I don't think this is something anyone has experimented with yet (my hack doesn't use Contests; I use this screen in the summary to display the Physical/Special split instead), so it would require more exploration to see just where the limit is here! :)

Ruby Versions of Moves With New Effects:

If you use these in your own hack, please credit the original creators first and myself second. They are the ones who truly did the hard work; all I did was rewrite them to work on Ruby rather than Fire Red. The main differences between the codes for the two versions has to do with the pointers; and in some cases these are all you would need to change in order to port a move from one version to another. As a word of warning though, the move effect data itself between Ruby and Fire Red, while very similar, is often not exactly identical. Compare the codes for the unmodified Hammer Arm in Fire Red from the first post and the unmodified Hammer Arm for Ruby below, for example.

U-TURN/VOLT SWITCH by Itman:
Spoiler:


HAMMER ARM (no Clear Body fix) by Itman:
Spoiler:


*new* HAMMER ARM (Clear Body fix) by DoesntKnowHowToPlay:
Spoiler:


I will edit this post with more moves as I continue to work on this. I hope this helps all the other Ruby hackers out there! :)
 
Last edited:

DoesntKnowHowToPlay

Tiny Umbrella with Lots and Lots of Good
265
Posts
12
Years
  • Seen Feb 24, 2024
A while back I posted a "polished" Hammer Arm that still lowered Speed when it failed to do damage. This version fixes that issue:

Spoiler:


Or, if you prefer using BSP:
Spoiler:


For FireRed, as usual, although if you know what you're doing you can probably port it.
 
69
Posts
11
Years
  • Seen Jul 22, 2019
I made these really quick, but yeah I'm pretty sure it works fine.

Flare Blitz(Ruby)
Spoiler:


Close Combat(Ruby)
Spoiler:
 
Last edited:
534
Posts
11
Years
  • Age 26
  • Seen Jul 24, 2023
Some supplemental information to this tutorial for Ruby hackers:

Offsets:
0x1FB12C = Attack Data (0x1FB130 for PP pointers)
0x1F8320 = Attack Names
0x1C7168 = Attack Animation Table
0x1D6BBC = Move Effect Table
0x3CF594 = Contest Data. This must be repointed along with the rest of the above data (and the new moves given contest data), or else the game will freeze when attempting to display the Contest Moves tab. To repoint it using the same technique described in the tutorial; go to this offset and Select Block = 2840. Copy, and go from there. :)
0x3C09D8 = Attack Description Table. This must also be repointed, or the game will start to overwrite important data (starting with Natures). To repoint it using the same technique described in the tutorial; go to this offset and Select Block = 1416. Copy, and go from there. :)

How to give a new move Contest Data:
Image136_zps5ff9c738.png


Every move in Pokemon Ruby has Contest Data. This is an eight-byte data structure that contains the information that determines how the move functions when used in a Contest setting, and is set up like this:

00 04 3C 00 00 00 00 00

This is Pound's Contest data. The first byte determines what message is displayed in the summary - for example, "A highly appealing move!" This also determines the move's appeal/jam. The second byte is the Contest Type - in this case, Tough. The next byte is a combo identifier, used to identify the first move used in a Contest Combination. In contests, Pound can be used in combination with DoubleSlap, Faint Attack and Slam to rack up additional points. The next three bytes also relate to combos - if the move can be used second in a Contest Combination, the byte for the move(s) it can be combined with would go here, up to three.
The last two bytes are padding and should always be set to 00. For more information, refer here and here.

Now, go to where you repointed your Contest data table and skip down to the end (where the FF's begin again). If your hack doesn't bother with Contests you can put anything you want here - even 00 00 00 00 00 00 00 00 for each move if you so desired, just to keep the game from freezing. If your hack DOES use contests...I don't see why it wouldn't be possible to be able to use the new moves in combination with an old one in Contests, or to assign it a byte unused by the moves already there to have it lead a new set of Combinations. I don't think this is something anyone has experimented with yet (my hack doesn't use Contests; I use this screen in the summary to display the Physical/Special split instead), so it would require more exploration to see just where the limit is here! :)

Ruby Versions of Moves With New Effects:

If you use these in your own hack, please credit the original creators first and myself second. They are the ones who truly did the hard work; all I did was rewrite them to work on Ruby rather than Fire Red.

U-TURN/VOLT SWITCH by Itman:
Spoiler:


HAMMER ARM by Itman:
Spoiler:


I will edit this post with more moves as I continue to work on this. I hope this helps all the other Ruby hackers out there! :)
What Animation was used in U-Turn?
 

Perri Lightfoot

Let's give it a go!
173
Posts
16
Years
  • Age 38
  • Seen Apr 17, 2022
What Animation was used in U-Turn?

I used Body Slam for now so there would be SOMETHING going on when I went to take screenshots, but I'll probably experiment and see if I can find something that looks better go to with it later. :)
 
534
Posts
11
Years
  • Age 26
  • Seen Jul 24, 2023
I used Body Slam for now so there would be SOMETHING going on when I went to take screenshots, but I'll probably experiment and see if I can find something that looks better go to with it later. :)

Okay I was just wondering because I thaught I saw stars

BTW guys!!!!

Can I overwrite the original move data, name data, etc. with FFs once I repointed those?
 
Last edited:
33
Posts
12
Years
  • Seen Dec 17, 2016
Alright, another question:

I was trying to change Surf's double battle effect from its gen 3 range (both opponents) to its gen 4 range (all Pokemon on field). If I just change the relevant field in most generic attack editors, such as MoveEditor or GBAPGE's Attack Editor, what ends up happening is that Surf only ends up hitting one of the opponents.

So I took a look at the effect codes for the other moves that hit all Pokemon on the field in gen 3 and tried to figure out what allowed them to hit all Pokemon.

Earthquake/Magnitude:
Spoiler:


Selfdestruct/Explosion:
Spoiler:


Teeter Dance:
Spoiler:


I observed some similarities between the scripts (especially between Earthquake and Selfdestruct), but I don't know what they correspond to. Can anyone help me out here? I suspect that making the desired effect for Surf just involves copying the Earthquake script and removing the 35 D0 3D 02 02 00 00 02 00 part that corresponds to double damage against opponents underground. Am I correct, or is there something more to that?

On another note, I tried making Poison Gas target all Pokemon on the field by just copying Teeter Dance's effect and changing one of the 07's to an 02, and that worked perfectly.

Thanks for the response on my Thunder/Hurricane question, Jambo, I'll try that out.
 
33
Posts
12
Years
  • Seen Dec 17, 2016
So I figured out Surf and Poison Gas (targeting all Pokemon on field).

Surf:
Spoiler:


Poison Gas (note that the actual gen 5 range of Poison Gas is both opponents only, not all Pokemon on field; this is for a WIP of mine):
Spoiler:

EDIT: dammit, this is still causing confusion. I definitely got this to cause burn, freeze, and poison to all other units on the field before. I'm not sure why this isn't working.

Now, I tried making Discharge by adding something to the beginning of Surf, but the game would freeze when I tried to use a move with the effect. What would I have to do to add a chance of paralysis (or any status effect)?
 
Last edited:

MrDollSteak

Formerly known as 11bayerf1
858
Posts
15
Years
So I figured out Surf and Poison Gas (targeting all Pokemon on field).

Surf:
Spoiler:


Poison Gas (note that the actual gen 5 range of Poison Gas is both opponents only, not all Pokemon on field; this is for a WIP of mine):
Spoiler:

EDIT: dammit, this is still causing confusion. I definitely got this to cause burn, freeze, and poison to all other units on the field before. I'm not sure why this isn't working.

Now, I tried making Discharge by adding something to the beginning of Surf, but the game would freeze when I tried to use a move with the effect. What would I have to do to add a chance of paralysis (or any status effect)?

So Pokemon Game Editor's move editor isn't working for you? I just set target to all pokemon and it works perfectly.
 
33
Posts
12
Years
  • Seen Dec 17, 2016
So Pokemon Game Editor's move editor isn't working for you? I just set target to all pokemon and it works perfectly.

For which move? I just tried doing this on a clean ROM with Poison Gas and it didn't work. See the video below, where the move highlights all Pokemon on the field but only affects one opponent Pokemon. I also tried Poison Fang and the outcome ends up being the same.



If it's not working, try youtu.be/bt3boebV2SU

EDIT: Okay, I think I fixed Poison Gas. I took a closer look at Teeter Dance's script and then looked at the pointers in the script. Turns out that those pointers point back to Teeter Dance.

Well, I really don't know what any of it means, but I copied over everything involved, repointed all of the pointers, and I guess it seems to work now?
 
Last edited:

MrDollSteak

Formerly known as 11bayerf1
858
Posts
15
Years
For which move? I just tried doing this on a clean ROM with Poison Gas and it didn't work. See the video below, where the move highlights all Pokemon on the field but only affects one opponent Pokemon. I also tried Poison Fang and the outcome ends up being the same.



If it's not working, try youtu.be/bt3boebV2SU

EDIT: Okay, I think I fixed Poison Gas. I took a closer look at Teeter Dance's script and then looked at the pointers in the script. Turns out that those pointers point back to Teeter Dance.

Well, I really don't know what any of it means, but I copied over everything involved, repointed all of the pointers, and I guess it seems to work now?

If it works then that's fine. My question is why didn't the animation play or any of the text assosciated with it come on? Because chances are the move is hitting everyone it just has a 55% accuracy and is missing the majority of the pokemon. I've set hydro pump as double target and it has successfully done damage to both targets. I put it back, but it has worked for me.
 
33
Posts
12
Years
  • Seen Dec 17, 2016
If it works then that's fine. My question is why didn't the animation play or any of the text assosciated with it come on?

Animations were off. The text doesn't come up for the other Pokemon because Poison Gas is not doing anything to the other Pokemon. It's ignoring them entirely.

Because chances are the move is hitting everyone it just has a 55% accuracy and is missing the majority of the pokemon. I've set hydro pump as double target and it has successfully done damage to both targets. I put it back, but it has worked for me.

I changed Poison Gas to 100% accuracy for the test.

I don't think I was being entirely clear here, as it seems that you've misunderstood. There are no problems with moves set to target only both opponent Pokemon. As you've said already, you can set Hydro Pump to target both opponents and it'll work just fine. The problem here is when a move is set to target both opponent Pokemon and your partner. In this case, the move will only hit one opponent Pokemon (and I think that it will always hit the same Pokemon).

I can guarantee that if you set Hydro Pump to target both opponent Pokemon and your partner, it will hit only one opponent Pokemon. Try it!
 

MrDollSteak

Formerly known as 11bayerf1
858
Posts
15
Years
Animations were off. The text doesn't come up for the other Pokemon because Poison Gas is not doing anything to the other Pokemon. It's ignoring them entirely.



I changed Poison Gas to 100% accuracy for the test.

I don't think I was being entirely clear here, as it seems that you've misunderstood. There are no problems with moves set to target only both opponent Pokemon. As you've said already, you can set Hydro Pump to target both opponents and it'll work just fine. The problem here is when a move is set to target both opponent Pokemon and your partner. In this case, the move will only hit one opponent Pokemon (and I think that it will always hit the same Pokemon).

I can guarantee that if you set Hydro Pump to target both opponent Pokemon and your partner, it will hit only one opponent Pokemon. Try it!

Ahhh I see. I misunderstood, I thought you meant double targetting. In that case, it's very useful that you've found that out.
 

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
I can guarantee you that damaging moves do work as intended with the hit all behaviour. I changed Surf to have that hit behaviour and it works like intended. It's because the behaviour is built into the script used for moves. However, since most status moves (like poison gas) do not use the main script, you will find that the behaviour fails to work correctly.

You can implement it manually using a relatively simple loop for which I don't currently have the code, but believe me, it's simple.

You need to take things like that into account when messing around with moves and their scripts.
 
33
Posts
12
Years
  • Seen Dec 17, 2016
In response to the above:


h**p://youtu.be/FJOJxvK8xJU if it's not working

Either my eyes are deceiving me, or I'm doing something wrong. Any thoughts on the matter?

In the first clip, I set Horn Attack to target both foes and partner in GBAPGE. The game highlights the appropriate targets, but the outcome is not as intended. In the second clip, I set Horn Attack to target both foes only, and the outcome is as intended.

I've made some innocuous edits to the game using AdvanceMap and A-Trainer, and I repointed the move tables as instructed to by this guide. However, the same thing happens when I thest this on a clean ROM.
 
Last edited:

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
Perhaps it also has to do with whether or not the original move was defined around hitting more than 1 target. I can assure you that Surf does work with this behaviour.

I couldn't pinpoint why it does so, if it isn't to do with the script, but it does work.

From what I can tell, the game does a controlled mini-loop executed by ASM over part of the main script. So it definitely has something to do with that script, but until we know how that loop is executed, your guess is as good as mine.
 
Last edited:
33
Posts
12
Years
  • Seen Dec 17, 2016
Well, finally got around to this:

h**p://youtu.be/unL-smOqkRs

Setting Surf to target both foes and partner doesn't work. Are you sure that it works properly on your ROM?

I observed that Surf crashed the game if its first target caused it to miss (e.g. Dig), so I reworked it, but this time it stops hitting subsequent targets if it hits a target with Water Absorb.

Wow, this is super annoying. It would probably not be as bad if I knew what I was doing...
 
Back
Top