- 6
- Posts
- 2
- Years
- Seen Jan 26, 2024
(SOLVED, SOLUTION POSTED AT END)
Hey guys, so for some background, I have ASM knowledge and have been writing small routines for a romhack of Emerald I am making. I have added in a gen 6+ EXP Share ASM routine that gives all pokemon exp(i didnt create it, it was found online). I wrote and added in my own custom section that cuts the EXP down to w.e percent you want. I can share that small bit of code for those interested. But heres what Im having problems trying to do now...
So i wanted to scale the exp based on lv. So if the wild pokemon is say lv 8, and my pokemon is lv 10, i get LESS exp. It scales based on the difference in level. I can write the asm to do the math, and i know where to find opposing pokemon party in ram. The problem is, i cant find where the current opposing party slot is stored. Ill try to explain best i can.
So at WRAM adderss 0x02024744, the opposing party pokemon data is stored. 600 bytes total, 100 bytes for each pokemon in that party. I know where to find the levels already for my comparision, but i cant figure out where the game stores which 100 bytes to reference. So if a trainer has 6 pokemon, and i defeat the first, say he sends out his LAST pokemon. Where in the memory is it stored that slot 6 is sent out? That way I can calculate the byte offset at 0x02024744 to grab the 6th 100byte pokemon data. So far ive only been able to find the total number of pokemon i have defeated. But that number doesnt represent the current slot pokemon. If i am horrible at explaining and need more info let me know lol THANKS!
SOLUTION: I just found the byte that shows current enemy slot. It is at address 0x02024070. That byte minus 1 equals current slot. 00=1st , 01=2nd, 02=3rd, etc. Changing this byte live while going into party menu and back changes current opponent so pretty sure this is it! Hope this helps somebody out there
Hey guys, so for some background, I have ASM knowledge and have been writing small routines for a romhack of Emerald I am making. I have added in a gen 6+ EXP Share ASM routine that gives all pokemon exp(i didnt create it, it was found online). I wrote and added in my own custom section that cuts the EXP down to w.e percent you want. I can share that small bit of code for those interested. But heres what Im having problems trying to do now...
So i wanted to scale the exp based on lv. So if the wild pokemon is say lv 8, and my pokemon is lv 10, i get LESS exp. It scales based on the difference in level. I can write the asm to do the math, and i know where to find opposing pokemon party in ram. The problem is, i cant find where the current opposing party slot is stored. Ill try to explain best i can.
So at WRAM adderss 0x02024744, the opposing party pokemon data is stored. 600 bytes total, 100 bytes for each pokemon in that party. I know where to find the levels already for my comparision, but i cant figure out where the game stores which 100 bytes to reference. So if a trainer has 6 pokemon, and i defeat the first, say he sends out his LAST pokemon. Where in the memory is it stored that slot 6 is sent out? That way I can calculate the byte offset at 0x02024744 to grab the 6th 100byte pokemon data. So far ive only been able to find the total number of pokemon i have defeated. But that number doesnt represent the current slot pokemon. If i am horrible at explaining and need more info let me know lol THANKS!
SOLUTION: I just found the byte that shows current enemy slot. It is at address 0x02024070. That byte minus 1 equals current slot. 00=1st , 01=2nd, 02=3rd, etc. Changing this byte live while going into party menu and back changes current opponent so pretty sure this is it! Hope this helps somebody out there
Last edited: