pokemonforever27
IS RIDING LUGIA...
- 55
- Posts
- 16
- Years
- At the computer...
- Seen Feb 3, 2019
Something that is becoming more popular to do in a hack is TRAINER BATTLEs whose POKEMON are at the same level of the players highest. JPAN, Hackmew, and myself have done some extensive research into the ASM aspect, but I only recently figured out that it was in fact possible without ASM. This tutorial will show you how to check which POKEMON is at the highest level without having to insert or deal with ASM. It stores the level of the highest POKEMON in LASTRESULT.
First, the code:
Second, the walk through:
"copybyte 0x20370D0 0x20242D8" this line copies the byte at the memory address of the level of the first POKEMON into the memory address of LASTRESULT. For this routine to work, we'll assume that the first POKEMON is highest, and we'll always copy the highest level POKEMON into LASTRESULT.
"comparefarbytes 0x20370D0 0x202433C
if 0x0 goto 0xpointer2
comparefarbytes 0x20370D0 0x20243A0
if 0x0 goto 0xpointer3
comparefarbytes 0x20370D0 0x2024404
if 0x0 goto 0xpointer4
comparefarbytes 0x20370D0 0x2024468
if 0x0 goto 0xpointer5
comparefarbytes 0x20370D0 0x20244CC
if 0x0 goto 0xpointer6"
These commands compare the bytes at the memory locations of the other POKEMON to LASTRESULT. If any of them are higher, we skip to an offset (0xpointer1, 0xpointer2, etc)
The copybyte command at the beginning of each offset copies the new highest level into LASTRESULT. The rest of their code then checks the remaining levels.
This routine checks all possible combinations. It doesn't matter what order the POKEMON are in.
Before you use the code, you'll need to put offsets in where I've written pointer1, pointer2, etc. I removed the pointers since it will be different for each hack.
This is a FIRERED VERSION. To use it in EMERALD, RUBY, SAPPHIRE, or LEAFGREEN, change the memory address values (the values after comparefarbytes and copybyte) to the memory addresses for your game.
Special Thanks:
JPAN for helping me on the ASM side
Hackmew for helping me on the ASM side
First, the code:
Code:
'---------------
#org 0xpointer1
lockall
copybyte 0x20370D0 0x20242D8
comparefarbytes 0x20370D0 0x202433C
if 0x0 goto 0xpointer2
comparefarbytes 0x20370D0 0x20243A0
if 0x0 goto 0xpointer3
comparefarbytes 0x20370D0 0x2024404
if 0x0 goto 0xpointer4
comparefarbytes 0x20370D0 0x2024468
if 0x0 goto 0xpointer5
comparefarbytes 0x20370D0 0x20244CC
if 0x0 goto 0xpointer6
releaseall
end
'---------------
#org 0xpointer2
copybyte 0x20370D0 0x202433C
comparefarbytes 0x20370D0 0x20243A0
if 0x0 goto 0xpointer3
comparefarbytes 0x20370D0 0x2024404
if 0x0 goto 0xpointer4
comparefarbytes 0x20370D0 0x2024468
if 0x0 goto 0xpointer5
comparefarbytes 0x20370D0 0x20244CC
if 0x0 goto 0xpointer6
releaseall
end
'---------------
#org 0xpointer3
copybyte 0x20370D0 0x20243A0
comparefarbytes 0x20370D0 0x2024404
if 0x0 goto 0xpointer4
comparefarbytes 0x20370D0 0x2024468
if 0x0 goto 0xpointer5
comparefarbytes 0x20370D0 0x20244CC
if 0x0 goto 0xpointer6
releaseall
end
'---------------
#org 0xpointer4
copybyte 0x20370D0 0x2024404
comparefarbytes 0x20370D0 0x2024468
if 0x0 goto 0xpointer5
comparefarbytes 0x20370D0 0x20244CC
if 0x0 goto 0xpointer6
releaseall
end
'---------------
#org 0xpointer5
copybyte 0x20370D0 0x2024468
comparefarbytes 0x20370D0 0x20244CC
if 0x0 goto 0xpointer6
releaseall
end
'---------------
#org 0xpointer6
copybyte 0x20370D0 0x20244CC
releaseall
end
Second, the walk through:
"copybyte 0x20370D0 0x20242D8" this line copies the byte at the memory address of the level of the first POKEMON into the memory address of LASTRESULT. For this routine to work, we'll assume that the first POKEMON is highest, and we'll always copy the highest level POKEMON into LASTRESULT.
"comparefarbytes 0x20370D0 0x202433C
if 0x0 goto 0xpointer2
comparefarbytes 0x20370D0 0x20243A0
if 0x0 goto 0xpointer3
comparefarbytes 0x20370D0 0x2024404
if 0x0 goto 0xpointer4
comparefarbytes 0x20370D0 0x2024468
if 0x0 goto 0xpointer5
comparefarbytes 0x20370D0 0x20244CC
if 0x0 goto 0xpointer6"
These commands compare the bytes at the memory locations of the other POKEMON to LASTRESULT. If any of them are higher, we skip to an offset (0xpointer1, 0xpointer2, etc)
The copybyte command at the beginning of each offset copies the new highest level into LASTRESULT. The rest of their code then checks the remaining levels.
This routine checks all possible combinations. It doesn't matter what order the POKEMON are in.
Before you use the code, you'll need to put offsets in where I've written pointer1, pointer2, etc. I removed the pointers since it will be different for each hack.
This is a FIRERED VERSION. To use it in EMERALD, RUBY, SAPPHIRE, or LEAFGREEN, change the memory address values (the values after comparefarbytes and copybyte) to the memory addresses for your game.
Special Thanks:
JPAN for helping me on the ASM side
Hackmew for helping me on the ASM side