• 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

Tlachtli

Crit happens.
267
Posts
12
Years
Does this help? My additions are in bold. I haven't tested these myself but I believe they're correct. Thought I'd chime in since you saved me the trouble of tracking down the limiter. ;)

Check my post from earlier if you aren't sure. It has the table locations and lengths for BPEE, and they all work.
 
51
Posts
9
Years
  • Age 38
  • Seen Dec 20, 2022
The second routine is almost the same of the routine of the Jambo 51, ​​so this does not do the calculations, only handle the movements directly in 0x02FF7d24.

Sorry to quote you from so long ago, I am busy porting all this ASM to Emerald and your ASM is the last one I need to do.
May I ask why that offset in particular? Does that just point to unused space in Fire Red?

Well in any case, here are the ASM scripts with the correct Emerald offsets. My hack progress is nowhere near the point I can actually test this but maybe someone can make use of it in the mean time, the offsets are sound.
@Jambo51's first ASM:
Spoiler:

Then, from what I've read, instead of Jambo's second ASM routine we first need this one by @BugMania (there are ram offsets in this script that I assume point to free space in Fire Red, for now I am assuming the same for Emerald):
Spoiler:

Then Jambo's second routine slightly modified by BugMania:
Spoiler:

Then Jambo's final routine:
Spoiler:

Hopefully this can be useful to someone. I will test it myself soon.
 
Last edited:
89
Posts
10
Years
For some reason, my Pokemon don't learn any new moves after inserting Phenom2122's ASM routines. The same thing occurs when I use Jambo51's routine with Emerald's offsets. Exactly what is wrong?
 
1,323
Posts
16
Years
  • Seen Dec 9, 2023
So for those of you having the problem where Pokémon don't learn moves upon level-up if you expanded to more than 512 moves, I think I've found a fix.

(for FireRed)
1. Insert Jambo's routines from the first post, but for the 2nd routine use Doesnt's routine seen here: http://www.pokecommunity.com/showpost.php?p=7982882&postcount=90
2. Put 2E D1 at 0803EAE8

Things I tested:
*givepokemon command
*opponent Trainer's Pokémon with non-custom moveset
*wild Pokémon

Everything seems to be working correctly, Pokémon learn their correct moves even if it's a move past #512 regardless of what level they were generated at.

I'm not fully sure why this works, so use at your own risk. Also make sure that you give PP to your moves past #512 (or even the ones past #355, which is Psycho Boost, the last move of Gen III) because you might mistake the opponent's use of Struggle as a "glitch".
 
89
Posts
10
Years
The corresponding offset seems to be 0x69378 for Emerald

Phenom2122's routines cause my Pokemon not to learn any moves at all. Then, after using Chaos Rush's method and using the offset 69378 for Emerald, my Pokemon learn Growl every time they level up. Chaos Rush, can you please tell me how you found the above bytes so I can apply the same method to Emerald?

Edit: Scratch that, it seems that Pokemon learn their first move in the learnset as per the regular learnset style instead every time they level up. There is something we're missing for Emerald.
 
Last edited by a moderator:
1,323
Posts
16
Years
  • Seen Dec 9, 2023
Phenom2122's routines cause my Pokemon not to learn any moves at all. Then, after using Chaos Rush's method and using the offset 69378 for Emerald, my Pokemon learn Growl every time they level up. Chaos Rush, can you please tell me how you found the above bytes so I can apply the same method to Emerald?

Edit: Scratch that, it seems that Pokemon learn their first move in the learnset as per the regular learnset style instead every time they level up. There is something we're missing for Emerald.
The problem is that Phenom's routines are BugMania's routines. My fix is for DoesntKnowHowToPlay's routine, which is different.
 

DoesntKnowHowToPlay

Tiny Umbrella with Lots and Lots of Good
265
Posts
12
Years
  • Seen Feb 24, 2024
Use Phenom's, my fixes were meant for the 649 match, which has tweaks that Jambo didn't document. I'd repost my stuff but I haven't tested it sufficiently to feel comfortable with it.

edit: give me a sec actually and I'll post what I have since it looks like nothing's working.

Spoiler:
 
Last edited:
89
Posts
10
Years
I know that your fix is for Doesnt's routines, I was saying that when I both attempted Phenom's and your methods on Emerald with byte to byte corresponding offsets, the learnset either entirely failed (Phenom's method) or Pokemon learnt the first move in their learnset according to the old learnset style every time they leveled up (Chaos Rush's method).
Edit: My Emerald ROM is also manually patched for extra Pokemon & Pokedex Entries (i.e. 649 patch)
 
1,323
Posts
16
Years
  • Seen Dec 9, 2023
I know that your fix is for Doesnt's routines, I was saying that when I both attempted Phenom's and your methods on Emerald with byte to byte corresponding offsets, the learnset either entirely failed (Phenom's method) or Pokemon learnt the first move in their learnset according to the old learnset style every time they leveled up (Chaos Rush's method).
Edit: My Emerald ROM is also manually patched for extra Pokemon & Pokedex Entries (i.e. 649 patch)
Did you make sure you redid the movesets after checking "Use Jambo51 move hack" in PGE or opening up G3HS's ini and setting "Jambo51movehack" (or whatever it says) to "true"? I haven't tested your offset for Emerald but on FireRed they learn all moves just fine, not just the first one.

I came up with the fix by using VBA's disassembler to look at the original code that is modified to branch to the 2nd(Doesnt's) routine and a 'be' (branch if equal) command that somehow wasn't performing right most likely due to the other byte changes required for the 512+ move expansion, my byte fix simply changes it to a 'bne' (branch if not equal) command. I might have gotten those two commands mixed up in my explanation because I honestly don't remember which one was in the original code and which one was the one I changed it to, and I can't check right now because I'm typing this on my phone.

Anyhow I'll look into it soon if it's still not working for Emerald.
 
89
Posts
10
Years
I just wrote a learnset from scratch in the new style then pointed a Pokemon (Swampert) learnset to it.
Here's the learnset:
Spoiler:

The problem is that both G3HS and PGE crash if I enable the new learnset style in the ini file and open an Emerald ROM. I think it's because they aren't adapted to use the Emerald offsets or something?
 

MrDollSteak

Formerly known as 11bayerf1
858
Posts
15
Years
Did you make sure you redid the movesets after checking "Use Jambo51 move hack" in PGE or opening up G3HS's ini and setting "Jambo51movehack" (or whatever it says) to "true"? I haven't tested your offset for Emerald but on FireRed they learn all moves just fine, not just the first one.

I came up with the fix by using VBA's disassembler to look at the original code that is modified to branch to the 2nd(Doesnt's) routine and a 'be' (branch if equal) command that somehow wasn't performing right most likely due to the other byte changes required for the 512+ move expansion, my byte fix simply changes it to a 'bne' (branch if not equal) command. I might have gotten those two commands mixed up in my explanation because I honestly don't remember which one was in the original code and which one was the one I changed it to, and I can't check right now because I'm typing this on my phone.

Anyhow I'll look into it soon if it's still not working for Emerald.

What I've found is that no matter what level the Pokemon appears at, it has the first four moves of its moveset. Which means that Doesn'ts routine doesn't really port to Emerald all that well, even with the byte fix. In fact the byte fix doesn't do anything if its D0 or D1.

The port seems to be correct though as everything else works fine otherwise, including level-up moves.

EDIT: Doesn't has updated his post now, so it works fine.
 
Last edited:
89
Posts
10
Years
Are you sure you used the right offset? And what you say seems to be correct, except that I'm talking about the move(s) that Pokemon learn when they level up. I don't know about wild Pokemon or received Pokemon.
 

Lance32497

LanceKoijer of Pokemon_Addicts
792
Posts
9
Years
Well guys I have made some progress on BSE!

It now compiles! I tested it a little while ago with this very simple script.

Code:
#org 0x800000
capture
end
It's still very basic in nature though and not every command is implemented. It is still a step in helping everyone be able to create their own move effects. These are the commands I have implemented to far. They're kind of blah so please give me some feedback on their names.
(Credit to JPAN and Jambo51 for their research!)

Code:
"&H0" = "unknownCommand0x00NoArgs"
"&H1" = "SomeCompare"
"&H2" = "usedattackmsg"
"&H3" = "hitmisscalc"
"&H4" = "critcalc" 
"&H5" = "basedmgcalc"
"&H6" = "typedmgcalc"
"&H7" = "effectcheck1"
"&H8" = "effectcheck2"
"&H9" = "baexe"
"&HA" = "turncheck" 
"&HB" = "healthbardec"
"&HC" = "healthvaldec"
"&HD" = "critcheck"
"&HE" = "unkloopcheck"
"&H10" = "msgdisplay" 
"&H12" = "seffectmsgdisplay" 
"&H1A" = "faintdisplay" 
"&H23" = "battleendfunc" 
"&H24" = "ifwildend" 
"&H26" = "storebyteforjump"
"&H27" = "jumpifbyte"
"&H28" = "goto" 
"&H2E" = "storebyte" 
"&H2F" = "addbyte"
"&H30" = "subtractbyte"
"&H31" = "copyarray"
"&H32" = "addarray" 
"&H39" = "pause" 
"&H3A" = "wait" 
"&H3C" = "return1" 
"&H3D" = "return2" 
"H3F" = "end"
"&H41" = "call" 
"&H45" = "animationprint"
"&H4C" = "pokemondataswitch"
"&H4D" = "pokemonbattledataswitch"
"&H4E" = "pokemonandhealthbardisplay"
"&H53" = "trainerdisplay"
"&H55" = "lvlupsnd"
"&H56" = "pkmfntsnd"
"&H57" = "flee"
"&H5C" = "hitflash"
"&H61" = "pkmswianimation"
"&H91" = "givemoney"
"&HEF" = "capture"

WOW! Looks amazing.... but......
Sorry for being noobish in my question, the codes are for reqular scripts?can i use XSE with these? if it is, what would be the meaning of the codes you listed above like "baexe" what is that? and if I use these code, what would be the entire script? Can you give a script of existing move in FR so that I can compare and create my own move effects
 
457
Posts
10
Years
  • Age 28
  • Seen yesterday
What I've found is that no matter what level the Pokemon appears at, it has the first four moves of its moveset. Which means that Doesn'ts routine doesn't really port to Emerald all that well, even with the byte fix. In fact the byte fix doesn't do anything if its D0 or D1.

The port seems to be correct though as everything else works fine otherwise, including level-up moves.

Little help... I have inserted this to Emerald and really works (I swear)... I have tried what Chaos did... but then when I level up any Pokemon, it learns the level 1 move even if the pokemon levels up (level 3 or up). Noted that I have ported Jambo's 1st and 3rd routine, Doesnt's modified 2nd routine, and Chaos' byte change (and I personally found the correct offsets for Emerald). I reverted the byte back to D0 and still having Doesnt's routine... the Pokemon don't learn anything only while leveling up. And I haven't tried the original second routine to see if it works. What went wrong anyway? :/

Here's my personal offsets:
Code:
return:  .word 0x0803EB65	693F5
return2: .word 0x0803EB73	69403
table:  .word 0x08FFFFFF	1808600
there:  .word 0x02024022	244E2

0x3EB20				693B0
0x3EB84				69414

gothere: .word 0x0803E8B5	69145
gothere2: .word 0x0803EC43	69427
movesettable: .word 0x0825D7B4	1808600

0x3EA10				692A0
0x3EAE8				69378

table: .word 0x08FFFFFF		1808600

0x43CE8				6E118
 

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)
2,475
Posts
11
Years
WOW! Looks amazing.... but......
Sorry for being noobish in my question, the codes are for reqular scripts?can i use XSE with these? if it is, what would be the meaning of the codes you listed above like "baexe" what is that? and if I use these code, what would be the entire script? Can you give a script of existing move in FR so that I can compare and create my own move effects

This is for creating moves. You use Battle Script Pro by Jambo51. Not XSE.

Do not ask Jambo for anything; he's quit hacking and he'll only get aggravated with you. Go to his thread instead if you really want to learn about making battle scripts.
 
32
Posts
9
Years
  • Age 33
  • Seen Sep 7, 2015
This looks a bit daunting but i think i can pull it off since my hack is planned to have a few new attacks, is there any way to implement more move graphics into free space somehow?
 

GoGoJJTech

(☞゚ヮ゚)☞ http://GoGoJJTech.com ☜(゚ヮ゚☜)
2,475
Posts
11
Years
This looks a bit daunting but i think i can pull it off since my hack is planned to have a few new attacks, is there any way to implement more move graphics into free space somehow?

If you're referring to attack sprites and graphics like the shadow ball spike thingydoodler etc, MrDollSteak has a tutorial on adding new ones.
 
13
Posts
10
Years
  • Age 37
  • Seen Oct 5, 2019
I cannot for the life of me understand any of the hex manipulation involved in this. Is there really no tool out there that can do this? I have a .DS_Store file and a bunch of .BS files for Gen IV moves and I want to use those to add said moves to Emerald, but this is just too confusing for me. Could anybody with expertise about this perhaps make a tool, or at the very least, a video guide for the layman?
 
89
Posts
10
Years
You can't simply import the moves from Gen IV games using their files because all the move data is stored in certain tables which are limited in size. In order to add more moves we have to change the locations of aforementioned tables into areas in the ROMs where there is more space so we can add more data. After which, we need to change the pointers in the ROM to where the new expanded table is (think of moving your browser, then changing the shortcut on the Desktop, assuming you use Windows, to where the browser's program files now are) in a process called repointing. Then, we have to change the number of moves the programs in the ROM can read from the tables by removing the limiters- think of having a 600 GB hard disk, but your programs can only read from the first 200 GB. We have to alter the routines so they read the rest of the tables. This can be quite a lengthy and complicated process, and thus is not for people who want to simply add the Gen IV moves in so they can use their Dark Pulse in the Gen III games. Not to mention the differences in the four move tables (move names, move data, move animations, move descriptions).
 
27
Posts
8
Years
  • Age 26
  • Seen Mar 5, 2022
[Emerald] Extended Moves

Hello everyone, I am a Chinese, not how to speak English, this is my first time here posting, so I hope you can take care of!


Code:
.align 2
.thumb

@ 0x0806935A--Code insertion
@ 0x08069350: 1F D0 29 4C
@ 0x0869400-0x0869423 zero clear

main:
ldr r2, aaa
mov r5, r9
lsl r3, r5, #0x2
add r5, r3, r2
ldr r0, [r5, #0x0]
ldrb r0, [r0, #0x2]
mov r6, r4
mov r12, r2
mov r4, r10
cmp r0, r4
beq c
mov r2, r6
mov r3, r5
b:
ldrb r0, [r2, #0x0]
add r0, #0x1
strb r0, [r2, #0x0]
ldrb r0, [r2, #0x0]
lsl r1, r0, #0x1
add r0, r1
ldr r1, [r3, #0x0]
add r0, r1
ldrb r1, [r0, #0x2]
cmp r1, #0xff
bne a
mov r0, #0x0
b d
a:
cmp r1, r4
bne b
ldr r3, aaa
mov r1, r9
lsl r4, r1, #0x2
add r1, r4, r3
ldr r2, bbb
ldrb r0, [r2, #0x0]
ldr r1, [r1, #0x0]
lsl r6, r0, #0x1
add r0, r6
add r0, r1
ldrb r0, [r0, #0x2]
mov r1, r10
mov r6, r2
mov r12, r3
mov r3, r4
cmp r0, r1
bne end
c:
ldr r2, ddd
mov r0, r12
add r1, r3, r0
ldrb r0, [r6, #0x0]
ldr r1, [r1, #0x0]
lsl r7, r0, #0x1
add r0, r7
add r0, r1
ldrb r1, [r0, #0x1]
lsl r1, r1, #0x8
ldrb r0, [r0, #0x0]
orr r0, r1
strh r0, [r2, #0x0]
ldrb r0, [r6, #0x0]
add r0, #0x1
strb r0, [r6, #0x0]
ldrh r1, [r2, #0x0]
mov r0, r8
bl                        @ 0x0806912C
lsl r0, r0, #0x10
lsr r0, r0, #0x10
str r0, [sp, #0x0]
end:
ldr r0, [sp, #0x0]
d:
add sp, #0x4
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r1}
bx r1



.align 2
aaa: .word 0xFFFFFFFF     @moveset table Offset
bbb: .word 0x020244E8
ddd: .word 0x020244E2


Code:
.align 2
.thumb

@ 0x08069298--Code insertion
@ 0x08069300-0x08069317 zero clear

main:
ldr r0, aaa
lsl r6, r4, #0x2
add r0, r6
ldr r0, [r0, #0x0]
ldrb r1, [r0, #0x2]
cmp r1, #0xFF
beq end
mov r3, #0x0
a:
ldr r0, aaa
add r7, r6, r0
ldr r0, [r7, #0x0]
add r0, r3
ldrb r2, [r0, #0x2]
mov r1, r10
cmp r2, r1
bgt end
ldrb r1, [r0, #0x1]
lsl r1, r1, #0x8
ldrb r0, [r0, #0x0]
orr r1, r0
mov r4, r1
mov r0, r8
str r3, [sp, #0x0]
bl                             @ 0x08069140
ldr r1, bbb
ldr r3, [sp, #0x0]
cmp r0, r1
bne b
mov r0, r8
mov r1, r4
bl                             @ 0x080694D0
ldr r3, [sp, #0x0]
b:
add r3, #0x3
ldr r0, [r7, #0x0]
add r0, r3
ldrb r0, [r0, #0x2]
cmp r0, #0xFF
bne a
end:
add sp, #0x4
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r1}
bx r1



.align 2
aaa: .word 0xFFFFFFFF   @moveset table Offset
bbb: .hword 0xFFFF


Code:
.align 2
.thumb

@ 0x0806E100--Code insertion
@ 0x0806E1F8-0x0806E203 zero clear

main:
mov r5, #0x0
ldr r6, aaa
lsl r1, r7, #0x2
add r2, r1, r6
ldr r3, [r2, #0x0]
ldrb r0, [r3, #0x2]
str r1, [sp, #0x14]
cmp r0, #0xFF
beq end
mov r9, r2
str r3, [sp, #0x10]
f:
lsl r2, r5, #0x1
add r2, r5
ldr r1, [sp, #0x10]
add r0, r2, r1
ldrb r3, [r0, #0x2]
ldr r1, [sp, #0xC]
mov r7, r2
add r5, #0x1
mov r12, r5 
cmp r3, r1
bgt d
mov r4, #0x0
mov r1, sp
ldrh r1, [r1, #0x0]
ldrb r3, [r0, #0x1]
lsl r3, r3, #0x8
ldrb r0, [r0, #0x0]
orr r0, r3
cmp r1, r0
beq b
ldr r0, [sp, #0x14]
ldr r1, aaa
add r6, r0, r1
mov r3, sp
mov r5, r7
a:
add r3, #0x2
add r4, #0x1
cmp r4, #0x3
bgt b
ldr r0, [r6, #0x0]
add r0, r5
ldrb r1, [r0, #0x1]
lsl r1, r1, #0x8
ldrb r0, [r0, #0x0]
orr r0, r1
ldrh r2, [r3, #0x0]
cmp r2, r0
bne a
b:
cmp r4, #0x4
bne d
mov r4, #0x0
cmp r4, r10
bge e
mov r1, r9
ldr r0, [r1, #0x0]
add r0, r7
ldrb r1, [r0, #0x1]
lsl r1, r1, #0x8
ldrb r0, [r0, #0x0]
orr r0, r1
ldr r1, [sp, #0x8]
ldrh r2, [r1, #0x0]
cmp r2, r0
beq e
ldr r1, [sp, #0x14]
ldr r2, aaa
add r6, r1, r2
ldr r3, [sp, #0x8]
mov r5, r7
c:
add r3, #0x2
add r4, #0x1
cmp r4, r10
bge e
ldr r0, [r6, #0x0]
add r0, r5
ldrb r1, [r0, #0x1]
lsl r1, r1, #0x8
ldrb r0, [r0, #0x0]
orr r0, r1
ldrh r2, [r3, #0x0]
cmp r2, r0
bne c
e:
cmp r4, r10
bne d
mov r0, r10
add r0, #0x1
lsl r0, r0, #0x18
lsr r0, r0, #0x18
mov r10, r0
lsl r2, r4, #0x1
ldr r1, [sp, #0x8]
add r2, r1
mov r4, r9
ldr r0, [r4, #0x0]
add r0, r7
ldrb r1, [r0, #0x1]
lsl r1, r1, #0x8
ldrb r0, [r0, #0x0]
orr r0, r1
strh r0, [r2, #0x0]
d:
mov r5, r12
cmp r5, #0x13
bgt end
mov r1, r9
ldr r0, [r1, #0x0]
lsl r1, r5, #0x1
add r1, r5
add r1, r0
ldrb r0, [r1, #0x2]
cmp r0, #0xFF
bne f
end:
mov r0, r10
add sp, #0x18
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r1}
bx r1


.align 2
aaa: .word 0xFFFFFFFF   @moveset table Offset

Jambo51 original words:
The new movesets are collections of 3 bytes each which are set up thus:
[MOVE - Half-Word - Reverse Hex] [Level - Byte]
So if I wanted my Pokémon's moveset to contain Pound at level 52, it would be:
01 00 34
To end the moveset, you put:
00 00 FF
 
Back
Top