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

Development: Adding New Moves to Gen 3

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
Hello, Jambo51 here again, and I'm here today to ask and hopefully answer the following statement:

How do we add the new moves to our beloved Generation 3 ROMs?

The answers I will provide will be for BPRE 1.0 (aka FR US 1.0), but they will also be applicable to Ruby and Emerald with a bit of thinking and some reading of ini files.

PLEASE NOTE: You can only successfully add attacks which actually do damage at this time. Status inflicting moves (whether purely status or damage and status inflicting) are a no go for now.

What's needed:
A Hex Editor
Pokémon Game Editor by Gamer2020, it perfectly supports the extended data!
Some knowledge of how the INI for PGE works
A Brain
Some PATIENCE

So, there are 2 different ways to add the new moves. The first, in the spoiler below, only supports up to 511 moves (there are a total of 559 in generation 5), but keeps support for the standard style of moveset used in generation 3.

Spoiler:


And this is how to add more than 511 moves. Please note, this is substantially more difficult and awkward than the above method, and requires you to redo every single moveset in the game.

Spoiler:


So far, I'm betting you're wondering why I decided to post this in R&D when it's clearly a tutorial, right?

Wrong! It's just a necessary evil before we can discuss the REAL thing I want to research!

What I want us to research is the ANIMATIONS and BATTLE SCRIPTS associated with the moves and how we can extend both of the above so that we can create new moves which truly imitate their "real" counterparts.

So, does anyone have any pertinent information (above and beyond what we already know) about either subject mentioned above?

FWIW, this is (AFAIK) our best understanding of Battle Scripts.

EDIT: Since I posted this, I found the table which controls animations and was able to make a new move use an existing animation. Based on what I saw, I suspect that the game uses an "Animation Script" in the same vein as the "Battle Scripts". A specially set aside set of commands specifically used for creating move animations.
 
Last edited:

Gamer2020

Accept no Imitations!
1,062
Posts
15
Years
What I want us to research is the ANIMATIONS and BATTLE SCRIPTS associated with the moves and how we can extend both of the above so that we can create new moves which truly imitate their "real" counterparts.

So, does anyone have any pertinent information about either of the above(above and beyond what we already know) about either subject mentioned above?

FWIW, [a href="http://www.pokecommunity.com/showpost.php?p=5731099&postcount=1]this is (AFAIK) our best understanding of Battle Scripts.[/a]

I would just like to add that I do have a very basic working Battle Script decompiler. I will be adding a battle script editor to PGE when I have documentation on all the commands so any help on this subject will actually help everyone.
 
94
Posts
13
Years
  • Seen Nov 2, 2016
Search up Pokemon Vega as a Japanese hacker has already done this for Japanese firered. I'm currently researching it but my computer is havin problems atm.
 
20
Posts
14
Years
  • Seen Jul 2, 2013
Are we sure battle scripts are programmed for each attack? Wouldn't it just be for each move effect?
 

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
The battle script commands aren't specifically designed only to work with a certain attack. They are (generally) a bunch of commands, which, when put together, produce the effect of the attack in question.
 
42
Posts
13
Years
  • Seen Aug 13, 2021
Based on your edit, does that mean that you could edit the data for Howl to, say, X-Scissor and then make it use the animation for Cross Chop? Because that would be useful as well.
 

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
Yes. You can edit existing data, although there's little point. If you read the main post, you'll see that you can just add 1 extra attack onto the end of the table, instead of overwriting.

What we CAN'T do at this stage is change the EFFECTS of the attack. That is, we can't make it lower/raise stats, cause status ailments etc. This is because we don't understand the battle scripts well enough to use them to create new effects yet.

Yes, you can indeed use existing animations, and with great ease. I found the animation table in the ROM and it was linked to what I believe are Animation Scripts. All you would need to do would be point your new attack to that animation, and it would use it. I actually copied the existing table into the new slots for the expansion I've done thus far.
 
42
Posts
13
Years
  • Seen Aug 13, 2021
Well, there are many attacks that are exact duplicates of each other in terms of effect, such as Withdraw/Defense Curl/Harden (aside from the added effect of Rollout). I was looking to take these duplicates and replace them with attacks from later Generations. Obviously, being able to add them without replacing is the goal, but I'd rather have a few fully functional new attacks now than sacrifice animations for attacks that just do damage.
 

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
Well, there are many attacks that are exact duplicates of each other in terms of effect, such as Withdraw/Defense Curl/Harden (aside from the added effect of Rollout). I was looking to take these duplicates and replace them with attacks from later Generations. Obviously, being able to add them without replacing is the goal, but I'd rather have a few fully functional new attacks now than sacrifice animations for attacks that just do damage.

I've worked out how to use existing animations for now actually. I don't have anything noted down though, so I'll need to look it up again.
 
1,323
Posts
16
Years
  • Seen Dec 9, 2023
This might help with adding new moves, but here's a list of all effect numbers:
Spoiler:

Note that there are some (well hardly any) numbers that are missing, and that's only because no attack uses the effect number.
 

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
This could (in fact) be very helpful, as I can use it to track down what battle script command does what. The only difference now is that I won't be doing it blindly. So thank you. You may possibly have saved me a huge amount of time.
 
1,323
Posts
16
Years
  • Seen Dec 9, 2023
This could (in fact) be very helpful, as I can use it to track down what battle script command does what. The only difference now is that I won't be doing it blindly. So thank you. You may possibly have saved me a huge amount of time.
You're welcome lol, I guess it also helps that some moves have exclusive effects, such as Thunder. I would imagine that if you were to do Fusion Bolt on a Gen III game, it would look like Fly + Thunder.

Also here's a Japanese rom hack that has plenty of Gen IV moves incorporated, perhaps it could help give you ideas for animations:
http://www.youtube.com/watch?v=XGpqbjA-aow&feature=related

(I can read Japanese, so here's where you can see the new moves)
0:33 - Focus Blast
1:07 - Gunk Shot
1:58 - Energy Ball
2:15 - Aqua Jet
3:39 - a custom attack using katakana to spell out, "Hurricane", which is kinda odd because Hurricane's japanese name is Boufou, not Harikeen
4:54 - Hammer Arm


EDIT: Since I posted this, I found the table which controls animations and was able to make a new move use an existing animation. Based on what I saw, I suspect that the game uses an "Animation Script" in the same vein as the "Battle Scripts". A specially set aside set of commands specifically used for creating move animations.
EDIT: Um... is there any reason why you didn't tell us the offset of the animation table? If you force everyone to find it themselves, it's gonna be a lot harder for people to help with the research.
 
Last edited:

Gamer2020

Accept no Imitations!
1,062
Posts
15
Years
Finally, overwrite the bytes at 0xD75FC with 00 00 00 00 00 00 to disable the only limiter in the ROM. If you do not edit this, rather than saying "Bulbasaur used VenoShock!", it will say "Bulbasaur used a POISON move!"

I had a couple of free minutes so I did a little tinkering. I think that the location for this in Emerald should be 0x14E504. I will find the locations of other stuff when I get a chance.
 

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
EDIT: Um... is there any reason why you didn't tell us the offset of the animation table? If you force everyone to find it themselves, it's gonna be a lot harder for people to help with the research.

There's no reason per sé, I just forgot to post it what with my exams and everything.
The table (in FR) is at 0x1C68F4. It starts with move 0x0 (an invalid move - left in as an error handler) and carries on in order of the moves in the game.

This is a table of pointers to animation scripts. Somehow they link together from the script to animation on screen, though i've not worked it out yet.
 

colcolstyles

Yours truly
1,588
Posts
15
Years
EDIT: Since I posted this, I found the table which controls animations and was able to make a new move use an existing animation. Based on what I saw, I suspect that the game uses an "Animation Script" in the same vein as the "Battle Scripts". A specially set aside set of commands specifically used for creating move animations.

Yeah, I've been doing some research and that seems to be the case. In Emerald, the table of animation scripts is at 0x2c8d6c and the table of animation commands is at 0x525e98. I only just started so I don't know what the majority of the commands do but (and these are just educated guesses) 0x00 loads graphics, 0x02 starts an animation, and 0x05 waits for all current 0x02 animations to finish before continuing the script execution. It seems like all the interesting stuff will be located inside 0x02. I'll take a look at it when I get the chance.

I had a couple of free minutes so I did a little tinkering. I think that the location for this in Emerald should be 0x14E504. I will find the locations of other stuff when I get a chance.

Yeah, that's where the limiter is. I changed the byte at 0x14e50b to 0xe0 which changes the 'bls' instruction to a 'b' instruction.
 

DoesntKnowHowToPlay

Tiny Umbrella with Lots and Lots of Good
265
Posts
12
Years
  • Seen Feb 24, 2024
I've been messing around with these a bit, and thought I'd post some of the stuff I found. All of this is for FR, although I assume it'll be similar for other versions. It's also a bit rambly and unprofessional, as I haven't spent too much time investigating these, for which I apologize.

0x00 loads image data, and seems to always take 2 bytes as an argument.

As colcolstyles said, 0x2 seems to execute animations while 0x5 waits for them to finish before continuing.

0x08 terminates execution.
Jump functions seem to exist, but since they go to other places in the ROM this means scripts always seem to end in 08 (although an 08 is not always a terminator).

0x19 does something with sounds.

14 17 16 03 2D B8 0B 08 05 04 00 XX 00 YY 00 00 FF FF starts the Silver Wind background. XX determines how fast the background scrolls horizontally, while YY determines how fast it scrolls vertically. These default to FA and 00, and should probably be left as such. The FFs at the end, if changed, cause the background to continue scrolling after execution.

This script:
Spoiler:

Starts the silver wind animation, executes whatever is in Stuff, and then stops the Silver Wind animation. There may be a few commands that aren't needed in there, but I was able to create animations for Quiver Dance and X-Scissor.
 

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
Ok - This is what I have managed to come up with over the last few weeks/months.

Once I stopped getting caught up in understanding what each and every command actually does, and started looking at the bigger picture, I realised that there are groups of commands which, when executed together, produce the effect we are looking for. If we were ever to create a compiler for battle scripts - I would term these as "super commands".

So, without further ado - the combination of commands which activates the stat changing effects:

Spoiler:


Obviously, these differing bytes will all need quantified. I'll start at the top:

Command 48:
Spoiler:


Command 2E (storebyte):
Spoiler:


Command 89 (executestatchange):
Spoiler:


Command 12 (showstatus):
Spoiler:


Fantastic - So far I've only talked about changing stats. What about burning, poisoning or damaging the foe? Well, these require yet more different commands!

Spoiler:


Feel free to test out and use this battle script! Using this methodology, it is possible to combine any existing effects in the BPRE 1.0 ROM, which makes the vast majority of Gen 4's (and a fair number of Gen 5's) moves possible on Gen 3 ROMs, animations notwithstanding. A short health warning, all the pointers I include in this post apply specifically to BPRE. However, this string of commands:
Spoiler:


should appear in all of the Gen 3 ROMs.
 
Last edited:

redriders180

Mastermind of Pokemon Glazed
314
Posts
13
Years

This is really neat...now I can put new moves in my game? I just have one question...making this script makes plenty of sense, but what exactly do I do with it? Forgive me for sounding noobish, but I can't find an offset, or a way to find an offset, anywhere :(. I just did the tutorial you posted in the OP, so I really hope this new revelation is supported by that...

Speaking of which, is said tutorial updated? I'm confused, since before, it was "make sure effect byte is set to zero". Is this still true? Basically, I don't understand what we can and can't do.
 
Last edited:
Back
Top