So it's quite likely that maybe you want a Pokemon to be uncapturable, and at the same time you don't want to diminish it's catch rate to 0 in your Pokemon editor. Or perhaps you used the "capture trainer Pokemon" hack and you don't want it to work for all trainers. No problem, this is the hack for you :P
Basically it checks if variable 0x8000 is 0x1 or not. If it's 0x1, then any Pokemon you encounter (trainer or wild, via script or natural encounter) will become uncapturable even with the master ball. Simply set 0x8000 back to normal for the original game mechanics.
Note: If you use this hack, to say make it so the player can only capture a certain trainer's Pokemon, you will need to set 0x8000 right before the encounter, and unset it after (which is quite simple)
Note2: This hack won't let you capture trainer Pokemon, you need to have the capture trainer Pokemon hack from last time to create that effect.
How to insert:
First compile the following ASM code and insert into free space:
Spoiler:
Code:
.text
.align 2
.thumb
.thumb_func
main:
ldr r0, =(0x2022B4C)
ldr r1, [r0]
ldr r2, .VAR
ldrb r2, [r2]
cmp r2, #0x1
beq uncatchable
ldr r0, = (0x802D490 +1)
bx r0
uncatchable:
ldr r0, = (0x802D460 +1)
bx r0
.align 2
.VAR:
.word 0x020270B8 + (0x8000 * 2) @change to var of your choice if you want
Where XX XX XX is the reverse hex pointer to where you inserted the above routine. That's it :)
EDIT: Add one to the pointer.
Here's a pesky Rattata:
(Yes, the Pokeball animation is still there, this was taken after it.)
I tried this in Emerald and it didn't work, I added in the pointer as +1 of the offset of the compiled code and tried setting the variable in a static encounter script and by walking through a script event and neither worked, does this just not work in Emerald? If so, is there another way of doing this that I can try?
I tried this in Emerald and it didn't work, I added in the pointer as +1 of the offset of the compiled code and tried setting the variable in a static encounter script and by walking through a script event and neither worked, does this just not work in Emerald? If so, is there another way of doing this that I can try?
The code will not work in Emerald because it is an ASM for FireRed only, as far as I know.
Do you know of anything comparable to this that works for emerald?
TOGGLING CAPTURABILITY OF POKEMON: EM
Basically, it is a port of FBI's Toggling Capturability Routine available only on Fire Red to Emerald. This port makes a certain Pokemon uncapturable by just setting var 8000 to 0x1. This only works on Emerald .
How to insert:
First compile the following ASM code and insert into free space:
Where XX+1 XX XX is the reverse hex pointer to where you inserted the above routine. That's it :)
NOTE: This only prints the text "The TRAINER blocked the ball! Don't be a Thief!". I suggest changing this to "The ball is Blocked! This Pokemon cannot be caught!"
Optional:
Insert the following in free-space location in your ROM:
AAAAAA:
Code:
CE DC D9 00 BC BB C6 C6 00 DD E7 00 D6 E0 E3 D7 DF D9 D8 AB FF
BBBBBB:
Code:
CE DC DD E7 00 CA E3 DF D9 E1 E3 E2 00 D7 D5 E2 E2 E3 E8 00 D6 D9 00 D7 D5 E9 DB DC E8 AB FF
In 0x5CC64C, insert the reverse pointer of AAAAAA (do not add 1)
In 0x5CC650, insert the reverse pointer of BBBBBB (do not add 1)
NOTE: This will replace the "The TRAINER blocked the BALL" and "Don't be a thief!" strings.
Basically, it is a port of FBI's Toggling Capturability Routine available only on Fire Red to Emerald. This port makes a certain Pokemon uncapturable by just setting var 8000 to 0x1. This only works on Emerald .
How to insert:
First compile the following ASM code and insert into free space:
Where XX+1 XX XX is the reverse hex pointer to where you inserted the above routine. That's it :)
NOTE: This only prints the text "The TRAINER blocked the ball! Don't be a Thief!". I suggest changing this to "The ball is Blocked! This Pokemon cannot be caught!"
All credits goes to FBI.
Thanks a million! Will try it out when I get home :)
And sorry if this is a dumb question, but how do I change the message when the pokeball is blocked?
Thanks a million! Will try it out when I get home :)
And sorry if this is a dumb question, but how do I change the message when the pokeball is blocked?
Insert the following in free-space location in your ROM:
AAAAAA:
Code:
CE DC D9 00 BC BB C6 C6 00 DD E7 00 D6 E0 E3 D7 DF D9 D8 AB FF
BBBBBB:
Code:
CE DC DD E7 00 CA E3 DF D9 E1 E3 E2 00 D7 D5 E2 E2 E3 E8 00 D6 D9 00 D7 D5 E9 DB DC E8 AB FF
In 0x5CC64C, insert the reverse pointer of AAAAAA (do not add 1)
In 0x5CC650, insert the reverse pointer of BBBBBB (do not add 1)
NOTE: This will replace the "The TRAINER blocked the BALL" and "Don't be a thief!" strings.
Welp, that's fine for me. The previous strings are kind of not friendly lol
If you have free space from 0x270670-0x270741 (0xD2 bytes), use the IPS patch I provide here. ...It's a long story, so I will expand on this when I get the time. Fully working, I promise. You're gonna love it.
edit: A bit of explanation now: I took a look at an Emerald disassembly and found the routine that calls to check if the egg at the Day-Care is a pichu and if either of the parents are holding a Light Ball. I ported that exact routine into FR, but I had to make a copy of the routine at sub_80460D4 as to include the pichu check. Then I had to make special 0xB8 call the new routine instead of sub_80460D4. Since I had made a copy of the routine I also had to make sure the new routine used all the same offsets as before, and therefore I placed the routine at 0x270670, which I happened to have free space. I wanted to place the routine at something like 0x760000 or higher, but the old offsets wouldn't work any more. Down below are the uncompiled stuff:
This routine (located at 0x270670 in my patch) is a copy of the routine at 0x0460D4 but now includes the pichu egg check (in orange):
Quick Preview:
Download: https://github.com/jiangzhengwenjz/EV-IV-Screen/tree/c1b303e17788f21e1a663204f9db59ffdcfc2a2d
Usage:
1. Make sure that you have Devkitarm and GNU make/cygwin installed.
2. Download this repo and create a new folder called "build".
3. Assign the free space you want to use in linker.lsc.
4. Open your cmd prompt and type in make. Then press enter.
5. Now main.bin should be generated. Paste it to the offset specified in step3.
6. Write a script to test (You should callasm to the offset of insertion + 0x79).
Code:
Example:
lock
faceplayer
callasm 0x8800079 //I inserted the code at 0x8800000
msgbox 0x8FD0013 0x2 //"It's nice, huh?"
releaseall
end
SO I have tried to install Devkit and any time I try the make command, I get errors and the program crashes, I would love to use this but without the ability to get the code for it inserted into the ROM I can't use it, does anyone have the compiled hex code for this?
Forgive me for not contributing, but I had to ask.
At the risk of being totally unhelpful to the thread: does anyone know of working routines for attack boosting Gems (Normal Gem, Flying Gem, etc., etc.) for either FireRed or Emerald? I've seen a certain Japanese hack of FireRed has gotten them to work and it looks like Pokemon Clover either has implemented them already or is planning to offer them eventually.
__________________
I'm learning how to sprite and hack from the ground up.
Preview: (Click to see the GIF animation) Attachment 77173
The routines are only for FR. I haven't found any bugs in it. However, the CPU will run much more instructions so that it will be a bit (really?) slower when you open the 'pokemon', 'bag'..... menus.
1) Insert the RTC routine via the tool 'DNS'.
2) Insert these routines and do the byte changes:
Routine I:
Spoiler:
byte changes:
Code:
0x6F09C - 00 48 00 47 XX+1 XX XX 08
change all the 0x8750000 in the routine to the insert offset of the routine.
change all the 0x8750001 in the routine to the insert offset + 1 of the routine.
I've modified 'Routine I' of Pokemon_XY's Time Box to exclude displaying seconds, which in turn decreases the lag when viewing the Start Menu. I've also fixed a bug in his routine where the Time Box would display when the step-counter is displayed while in the Safari Zone. Provided down below is a 24-hour format and a 12-hour format. Choose one of them instead of Pokemon_XY's 'Routine I' if you wish.
24-hour format (use instead of 'Routine I'):
Spoiler:
Code:
@ 0x6F09C - 00 48 00 47 XX+1 XX XX 08
@ change all the 0x8950000 in the routine to the insert offset of the routine.
@ change all the 0x8950001 in the routine to the insert offset + 1 of the routine.
@ 0x6F09C - 00 48 00 47 XX+1 XX XX 08
@ change all the 0x8950000 in the routine to the insert offset of the routine.
@ change all the 0x8950001 in the routine to the insert offset + 1 of the routine.
This involves four routines and a bunch of scripting.
Notes Before We Begin
• You will need 25 vars that you will not use for anything else. I used vars 0x408F through 0x40A8, and the routines posted below reflect that. If you wish to change them, you'll need to figure out the RAM addresses for those vars on your own.
• 24 of those vars are for the moves of your party. 1 is set when the Metronome Battle starts for reasons I will get into later.
• These vars need to be permanent vars (so not 0x8000 whatever) because they need to be accessed even if the game is turned off and on.
Routine 1: Clear RAM
What this does is clear out (sets to zero) all the vars which will contain the moves. This just make sure that you have a blank slate for the next routine.
This routine takes all the moves of your Party Pokemon and stores them one at a time in the vars I mentioned before. If the Pokemon doesn't have a move in that slot, it will just set the var to zero by default.
This routine is fairly self-explanatory. It replaces all of your Pokemon's move with four of Metronome. Note that this does not change the PP, so the PP of Metronome will still be the same as whatever move it replaced. This is easily fixed during the scripting (which will come soon).
I will assume that the initiator of the Metronome battle will be a person event or something like that.
In your script, you will want to call the first three routines in order. Then script the battle, and then afterwards call the fourth routine and then the first again.
Syntax: callasm OFFSET OF R1
callasm OFFSET OF R2
callasm OFFSET OF R3
special HEAL_POKEMON 'This fixes the PP issue from before
setvar SOME VAR 0xFF'
trainerbattle 0x3 0xNUM 0x0 @DefeatMsg
callasm OFFSET OF R4
callasm OFFSET OF R1
special HEAL_POKEMON
setvar SOME VAR 0x0
Let's explain a few things. You'll want to use specifically "trainerbattle" type 3. This makes the script continue after you defeat the trainer, which we want so that you can get your original moves back after you win.
But what about if you lose? This is what the SOME VAR is about. Before you start the battle, you'll want to set whichever var you chose to something not zero. I picked 0xFF just because.
If you win, this var gets set back to zero. But if you lose then the var is still the non-zero value.
So you will need to include this map script at every possible healing location the player could get sent back to.
Spoiler:
#dyn 0x740000
#org @Start
compare SOME VAR 0xFF
if true jump @RestoreMoves
release
end
#org @RestoreMoves
callasm OFFSET OF R4
callasm OFFSET OF R1
release
end
This checks if you initiated but did not complete the Metronome Battle (via the var) and if you that is true then it replaces your moves. If you lost the battle then it will do this during the normal White Out script.
What I recommend is using JPAN's SetHealingPlace hack to set the healing place to be the map where you find the NPC who starts the battle. That way you only need to have this map script on that specific map instead of having to put it everywhere.
#org @PutMovesBack
callasm 0x8DB629D
callasm 0x8DB1E3D
special HEAL_POKEMON
setvar 0x40A8 0x0
release
end
#org @Hello
= Anna Marukawa: Wanna see a trick?\pI can temporarily change any\nPokemon's attacks to be anything\lat all!\pWell, not exactly. I can only\nchange them to Metronome.\pBut Metronome can be any attack,\nso there!\pAnyway, my idea is we can have a\nbattle where the only move either\lof us can use is Metronome!\pWouldn't that be fun? Want to try\nit out?
#org @Bye
= Oh, okay.\nMaybe another time then!
#org @Defeat
= Wow! That was great!
#org @LetsGo
= Okay!\pI changed all the moves and healed\nyour team.\pTo the Battle Dimension we go!
#org @Fun
= Wow! Wow!\pThat was so much fun!\pHere, let's give your Pokemon\ntheir real moves back.\pCome over soon so we can do that\nagain!
__________________
"The human sacrificed himself, to save the Pokemon. I pitted them against each other, but not until they set aside their differences did I see the true power they all share deep inside. I see now that the circumstances of one's birth are irrelevant; it is what you do with the gift of life that determines who you are." -Mewtwo
This hack converts the PC item storage menu into a side quest menu, or task list, etc.
Here is the repository, the compilation instructions are included in the readme. You will need to define your own parameters/ram in src/headers/defs.asm and create your own tables of string pointers for all of the quest names, descriptions, item images, and quest details. I kept the item image part to allow hackers to include items that might be symbolic of their quest, eg. a scroll or key or pokeball.
This hack converts the PC item storage menu into a side quest menu, or task list, etc.
Here is the repository, the compilation instructions are included in the readme. You will need to define your own parameters/ram in src/headers/defs.asm and create your own tables of string pointers for all of the quest names, descriptions, item images, and quest details. I kept the item image part to allow hackers to include items that might be symbolic of their quest, eg. a scroll or key or pokeball.
[FR] Multi-directional jump tiles
This is an expanded-upon version of Invert's routine on the Wahack forums (https://wahackforo.com/t-40642/fr-asm-salto-en-cualquier-direccion) So credit goes to them for the original.
Made this for the purpose of creating a multiple-height jumping puzzle which was something Invert's routine was lacking, so thought I might as well share it.
Code:
.thumb
.global AnyDirectionJumptile
.equ rom, 0x08000001
.equ offset, 0xXXXXXX
/*
Behavior bytes:
0x7F = able to jump in any direction over tile (only on height 0x0 & 0x10)
0x7E = able to jump up and down over tile
0x7D = able to jump left and right over tile
*/
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
hooks:
.org 0x59AF6
cmp r0, #0x7D
beq 0x59B02
.org 0x59B0A
cmp r0, #0x7D
beq 0x59B16
.org 0x59B1E
cmp r0, #0x7E
beq 0x59B2A
.org 0x59B32
cmp r0, #0x7E
beq 0x59B3E
.org 0x6812C
bx r2
.org 0x68144
.word main + rom
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
.org offset
main:
cmp r0, #0x7F @behavior byte
beq CheckJump
ldr r2, =(0x083A705C)
lsl r1, r4, #0x2
ldr r3, =(0x0806812E|1)
bx r3
CheckJump:
bl CanPlayerJump
cmp r0, #0x0
beq CantJump
CanJump:
ldr r0, =(0x08068148|1)
bx r0
CantJump:
ldr r0, =(0x0806813E|1)
bx r0
CanPlayerJump:
ldr r1, npc_states
ldrb r0, [r1, #0xB] @player height
mov r1, #0xF
and r0, r1 @lower 4 bits are height
cmp r0, #0x4 @movement permission 0x10
beq TheyCan
cmp r0, #0x0 @movement permission 0x0
beq TheyCan
TheyCant:
mov r0, #0x0
bx lr
TheyCan:
mov r0, #0x1
bx lr
.align 2
npc_states: .word 0x02036E38
Adds the feature of learning moves when you evolve, regardless of the level. Currently, only compatable if you have expanded your moves above 511 (jambo learnsets). May make it compatable with old learnsets if there is a desire.
Here is the repository. Update config.ini with your learnset table location and a free ram address byte (does not need to be in the save block hack. Example free space starts at 0203e000 if you've removed the help system, I believe)
I've only done prelimenary testing, so there may be bugs.
This hack converts the PC item storage menu into a side quest menu, or task list, etc.
Here is the repository, the compilation instructions are included in the readme. You will need to define your own parameters/ram in src/headers/defs.asm and create your own tables of string pointers for all of the quest names, descriptions, item images, and quest details. I kept the item image part to allow hackers to include items that might be symbolic of their quest, eg. a scroll or key or pokeball.
Here is a slightly outdated example GIF (it is just missing the item images in the box), but it gets the point across.
Enjoy! And please let me know of any bugs.
Hello,
I'm having a hard time understanding an aspect of your system, mainly the flags. So if you have 256 quests (the max, still kinda a small number), does that mean you need 512 flags? Consecutive flags, at that? So quest #1 would be flag 0x200, and that would go all the 0x2FF, leaving me with literally no other safe flags for the entire game, or to complete the other 256 flags eaten by the routine? Looks like I might have to dabble in expanding safe flags, unless I'm missing something obvious here.
Edit: Couldn't I just set the "flag" offsets to some unused RAM? Probably not, since it wouldn't be covered by the save block. And how do I convert the flag number to a RAM location?
I'm having a hard time understanding an aspect of your system, mainly the flags. So if you have 256 quests (the max, still kinda a small number), does that mean you need 512 flags? Consecutive flags, at that? So quest #1 would be flag 0x200, and that would go all the 0x2FF, leaving me with literally no other safe flags for the entire game, or to complete the other 256 flags eaten by the routine? Looks like I might have to dabble in expanding safe flags, unless I'm missing something obvious here.
Edit: Couldn't I just set the "flag" offsets to some unused RAM? Probably not, since it wouldn't be covered by the save block. And how do I convert the flag number to a RAM location?
Thanks, hjk321
Nice routine though!
I kept the instructions somewhat vague to allow different users to utilize the system the way they like, though you're right that I could have been a bit more verbose.
The system is set up so that you will need two flags for each quest: one to 'activate' the quest, which just means you have unlocked it and the quest name will show up in the menu and you can activate it and whatnot. The second will indicate that the quest is completed, in which case the 'Done' text will appear next to the quest name.
It is currently written so that the activation flags (to show the quest names) are in order, and the completion flags are also in order, but can start from a different initial flag. This was done to prevent the use of two separate tables, but can easily be changed.
256 quests seems like a pretty high number of quests for a rom hack though. And that is not necessarily the limit, the active quest ram can easily be expanded to a halfword value.
I would recommend expanding the safe number of flags with JPANs save block hack; this way you can unlock thousands more safe flags and this system won't be as limiting.
I'm not entirely sure why you would want to use RAM instead of flags; that would end up just taking up much more space unless you edit the routine to check for specific bits in the ram, which is then the same functionality as a flag.
It is currently written so that the activation flags (to show the quest names) are in order, and the completion flags are also in order, but can start from a different initial flag. This was done to prevent the use of two separate tables, but can easily be changed.
I hope this helps.
Literally everything about your routine is great... except every quest is ???????? whether the flags are set or not! in the defs file I've tried RAM pointers (0x0203C001) I've tried repointed flag numbers (0x909) and I've tried raw flag numbers (0x2109) and no matter what the quests do not show up!
As an experiment I have 15 quests and I set some flags At the index. Index starts at 0203C001, have also tried 0x909 and 0x2109 in defs.asm. Here is proof I have flags set in that area...
and yet all 15 quests are unshowable. What am I doing wrong?
I only made minor edits to some text variables, as well as linking to external tables rather than making a table in the actual asm. I didn't edit anything significant.
Literally everything about your routine is great... except every quest is ???????? whether the flags are set or not! in the defs file I've tried RAM pointers (0x0203C001) I've tried repointed flag numbers (0x909) and I've tried raw flag numbers (0x2109) and no matter what the quests do not show up!
As an experiment I have 15 quests and I set some flags At the index. Index starts at 0203C001, have also tried 0x909 and 0x2109 in defs.asm. Here is proof I have flags set in that area...
and yet all 15 quests are unshowable. What am I doing wrong?
I only made minor edits to some text variables, as well as linking to external tables rather than making a table in the actual asm. I didn't edit anything significant.
Can you share your code so I can better understand what you are trying to do? Let's do this via discord or personal message to keep this thread clean. :)
Hi ASMaties! I'm new to hacking and I'm not sure how to go about this… would it be okay if I requested some help modifying the way EV-increasing items (HP Up, Protein, Iron, etc.) work in Emerald?
The default behaviour adds +10 EVs, but it has no effect when the EV is >=100. I want to remove that restriction so you can keep using EV items and max out an EV at 252, allowing players to EV train quickly and painlessly.
I found a bug in this code where a pokemon learning a move from any other way would be asked to learn moves it already knows and will be asked to learn a move even when their movesets are not full.
I rewrote the moveset loop by just calling a custom function rather than editing the main learn_move function at 0803ea88, and it appears to work fine.
If you've decided to make your TMs reusable in Fire Red, this routine will remove the option to buy more than one of each from shops. Credits to azurile13 for the first part (Main) of the code.The only thing that needs changing is the line ".equ offset".