Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
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.
After doing some research into the Emerald HP boxes, I've found a few useful offsets.
I haven't seen them documented anywhere else on the internet so I thought I'd share them here.
Player HP box - C1F1C8
Enemy HP box - C1F46C
The palette used for these two is located at C11B9C
I've also seen this palette in one of Jaizu's post where I found the other palette, C11BBC
It might be related to the other HP boxes I found below.
These could possibly be related to double battles. I haven't tested them so I'm not too sure.
FireRed:
If you ever opened a script from FireRed in XSE, you will quite often see these lines:
Code:
special 0x187
compare LASTRESULT 0x2
if 0x1 goto 0x81A7AE0
Most people think that that special is there as a safe switch or does nothing, but it's actually used for the flashbacks that occur when the player continues their save file. It's there to make sure the events play out properly in the flashback.
When healing at a Pokemon Center, the healing machine will light up with the number of Pokemon in your party. Starting in DP, eggs don't count - if you have two Pokemon and an egg, in RSEFRLG, you get three lights, in DP, you get two.
To get this behavior in FR, just change:
Code:
0x08083B8E : 0xbd 0xf7 0x55 0xf8
to
Code:
0x08083B8E : 0x08 0xf0 0xd5 0xfa
Spoiler:
0x08083B8C is a function called as part of doanimation 0x19 (the healing machine). At 0x08083B8E, that function branch-links to call another function at 0x08083BD1, which itself counts the number of Pokemon in the party.
0x0808C13C is a built-in function to count Pokemon (and not eggs), so basically I just changed the target of the branch-link to this function.
Environmental Moves In FireRed (with some Emerald Offsets)
Camoflouge
There is a table at 0x250888 (0x31C483 in Emerald). This table is what Camoflouge uses to determine the Type the user turns into. It has ten entries for ten different types of terrain.
This order is important, because all the environmental moves use this same order of terrain. The terrain bytes start at 0 and go through 9.
1. 0C = Grass Type used for short grass
2. 0C = Grass Type used for long grass
3. 04 = Ground Type used for sand
4. 0B = Water type used for Underwater
5. 0B = Water Type used for ponds
6. 0B = Water Type used for the sea
7. 05 = Rock Type used for craggy terrain
8. 05 = Rock Type used for caves
9. 00 = Normal Type used for indoors
10. 00 = Normal Type used for link battles
I tried expanding it but it didn't work. I didn't really focus all that much on expanding it though so it may be possible.
This table is useful for people who are using KarateKid's Battle Background hack to set specific backgrounds, as the terrain byte doesn't change just because the background does.
For people who are using that patch, you can make the terrain change with the background by using/modifying this routine:
Spoiler:
.text
.align 2
.thumb
.thumb_func
Main:
push {r0, r2}
ldr r0, =0x40F7 /*Check BG var*/
bl GetValue
ldrh r0, [r0]
cmp r0, #0x0
beq Normal
cmp r0, #0x1
beq Grass
.......
b Normal
This compares the value of var 0x40F7, which is what determines the battle background.If it's 0, it uses the default background. If anything else it uses that numbered entry in the table at 0xF10000. This is where you branch to the terrain you want. I only included one here as an example.
Grass:
ldr r1, =0x02022B50
mov r2, #0x0
strh r2, [r1]
b Normal
This sets the byte at 0x2022B50, which is the terrain byte, to the terrain desired. The number r2 is set to matches the entry in the Camouflage table. The idea is to set terrains that you won't use to a new type. For example, if you have a volcanic area, setting it to Fire Type.
This just continues the Battle Background routine without setting a specific terrain. This is used for the default terrain when you don't set a specific background. This would really only be useful if you have more than one type of terrain (water and grass on the same map).
You should add a compare/branch if equal for each battle background you have in the table.
You would replace the pointer at 0xf00020 with the pointer to this new routine.
Secret Power
Secret Power is known for having different secondary effects depending on the terrain byte. This leads to the same problem with the Battle Background hack as with camouflage, where you can have Secret Power animations or effects that don't match terrain.
You can use the following Battle Script to edit the effects even if you don't have the Battle Background hack.
Spoiler:
//You may have to go back to the beginning
//And repoint the jumpifhalfwords
//Because for me it just rerouted to Main
For this example, this sets the effect to "burn." If you want Fire Type Pokemon to be immune to burn from Secret Power, then put that "jumpiftype" command to the type you want to have immunity (A = Fire) and make it branch to the regular damaging script.
0x2023E85 is the byte that stores additional effects, like burn, poison, etc.
I'd do a version for Emerald, but I don't know where the RAM for the terrain is in Emerald yet. If you know where it is, tell me! Porting that script to Emerald is as easy as replacing all the offsets with their Emerald equivalents.
Secret Power's animation in FireRed (and also in Emerald) is basically just a compilation of pointers to other move's animations. The animation it uses once again depends on the terrain byte.
It was already posted somewhere here, but I'll just put the offset at the end so all the environmental moves are in the same place.
FireRed: 0x25081C
Emerald: 0x31C414
Editing the table is as easy as putting the index number of the move you want in the correct location in the table depending on the terrain you want it to go with.
How to change the spawn location of the player after beating the Pokemon League in Emerald:
After some research I've found that the spawn location of the player after beating the Pokemon League is tied to the Flying position [04] tile (in map 1.1 or 1.3 in the coordinates 4/2).
It is possible to change the location of that tile (including the map it's in) in HxD, in the offset 59F53C.
Code:
01 01 04 00 02 00
are the bytes that will be there by default.
01 - map bank
01 - map number
04 - X
00 - X
02 - Y
00 - Y
Note that the rom reads the X's and Y's backwards. For example, if for any reason you'd want it to be in the X 125, you'd put in 05 12 in the X's spots.
If you can choose a gender in your game, you must also edit the female's Flying position [04] tile, which is in the offset 59F544.
Code:
01 03 04 00 02 00
these are the bytes there by default, if you see this you're in the right place.
Secret Base Decoration Sprites (Emerald)
The sprites for the Secret Base decorations (The sprites you see when buying them at the Department Store) in Emerald start at 0x5A6C00. It ends at 0x5A6FAF with the Registeel Doll.
It looks like the decorations are in groups (like all the dolls are together) and there are a lot of 00s between them.
The first four bytes are the image pointer, and the next four are the palette. :)
How to change the spawn location of the player after beating the Pokemon League in Emerald:
Spoiler:
After some research I've found that the spawn location of the player after beating the Pokemon League is tied to the Flying position [04] tile (in map 1.1 or 1.3 in the coordinates 4/2).
It is possible to change the location of that tile (including the map it's in) in HxD, in the offset 59F53C.
Code:
01 01 04 00 02 00
are the bytes that will be there by default.
01 - map bank
01 - map number
04 - X
00 - X
02 - Y
00 - Y
Note that the rom reads the X's and Y's backwards. For example, if for any reason you'd want it to be in the X 125, you'd put in 05 12 in the X's spots.
If you can choose a gender in your game, you must also edit the female's Flying position [04] tile, which is in the offset 59F544.
Code:
01 03 04 00 02 00
these are the bytes there by default, if you see this you're in the right place.
The simplest method would be to give Alolan Marowak species ID 0x6A, then change 0x3F02E (0x90BE22 in MrDS's rombase with updated light ball check) from 01 to 02
Otherwise you'll have to hook a routine in this area to compare against another species ID.
from the readme
"If you've added custom Poké Balls, you'll need to add definitions for them in src/balls.h. Note that these are not the same as their item numbers; vanilla Poké Balls have the same item and ball number, but custom Poké Balls won't unless you overwrite the item numbers after the vanilla Poké Balls."
I'm using your routine but when I'm fishing when I catch the Pok?mon my rod disappears, but it only happens at the Safari Zone. Do you know how to fix it?
EDIT: I think it's caused by your "deleteball" routine, because it removes the last item used from the Bag, but the Safari Balls isn't on the Bag and the reusable function isn't working on them.
I made a fix for that routine, and will test it on Monday.
I sent you the solution, if you don't mind testing it too.
I'll post it as soon as I confirm it's fixed.
EDIT:
Link to the post with the routine: https://www.pokecommunity.com/posts/8896448
If anyone could help confirm that Safari won't be screwed with this new hack, it would be highly appreciated. =D
from the readme
"If you've added custom Pok? Balls, you'll need to add definitions for them in src/balls.h. Note that these are not the same as their item numbers; vanilla Pok? Balls have the same item and ball number, but custom Pok? Balls won't unless you overwrite the item numbers after the vanilla Pok? Balls."
I made a fix for that routine, and will test it on Monday.
I sent you the solution, if you don't mind testing it too.
I'll post it as soon as I confirm it's fixed.
EDIT:
Link to the post with the routine: https://www.pokecommunity.com/posts/8896448
If anyone could help confirm that Safari won't be screwed with this new hack, it would be highly appreciated. =D
So you know the animations for end-of-turn events or animations that aren't exactly move animations (e.g. poisoned, sleeping, burn, Leech Seed absorb, Future Sight attack etc)? In Emerald, they're stored in a table at the end of the regular move animations table (so it starts at 2C92F8), which I have gone through and summarised as follows:
Spoiler:
Data below is formatted as (Animation description: Offset)
Tackle? (Tackle hit particle on opponent): 2DEF76
Poisoned (purple, shaking): 2D7D5A
Confusion: 2D7D85
Burn: 2D7D8E
Infatuation: 2D7DBE
Sleeping: 2D7DF3
Paralysis: 2D7E1F
Frozen: 2D7E39
Curse (Ghost type affliction): 2D7E54
Curse but with Lovely Kiss sprite?: 2D7E79
Transform (pixelate then change sprite): 2D7E9E
Regular damage (blink of sprite + regular effective SFX): 2D7ED4
Sky Attack? (user sprite fades to white then disappears, then reappears by sliding in from left): 2D7EDD
Substitute (user sprite disappears similar to Teleport, Substitute sprite drops in): 2D7F1A
Unknown (user sprite is replaced with a red-pink box?): 2D7F22
Knock Off item lost (item bag bounces away from opponent): 2D7F6A
Bind: 2D7F75
Using held item animation (user sprite tilts downwards, sparkles appear then circle expands out): 2D8108
Unknown (clouds appear on user, then user disappears): 2D817C
Focus Band survived with 1 HP animation: 2D8258
Raining animation: 2D82A5
Strong sunlight animation: 2D82EE
Sandstorm animation: 2D82F8
Hail animation: 2D82FD
Pound? (Tackle hit particle on opponent, Pound SFX): 2D830B
Unknown (Item bag bounces up from user sprite then drops down): 2D833C
Volt Tackle movement (user sprite shakes, opponent quickly slides right then reappears on user side of screen, slides left, then reappears in normal position): 2D8361
Future Sight (attack animation, after 2 turns): 2D83BF
Doom Desire attack animation: 2D841E
Bide? Endure? (Focus energy particles + user sprite turns red): 2D84E3
Leech Seed HP absorb animation: 2D8523
Wish healing animation? (screen darkens, sparkles appear around user and health regain animation plays, with Recover SFX): 2D8566
In-battle level up animation (health bar glows blue): 2D85E3
Return to Pokéball animation: 2D8604
Return to Pokéball animation: 2D8615
Throwing Pokéball animation: 2D8626
Unknown (replaces user sprite with Pokéball sprite, freezes game): 2D867A
Unknown (user sprite slides left then slides right back to original position): 2D8693
Substitute? (user sprite slides left and a Substitute sprite slides right into user original position): 2D869D
This could be helpful for anyone who wants to edit the status animations or include some of these animations as part of move animations; they can (mostly) be called with 0E XX XX XX 08.