• 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?".
  • 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.

Quick Research & Development Thread

275
Posts
8
Years
I've been researching Tile Background behavior bytes.

This thread here exists:
http://www.pokecommunity.com/showthread.php?t=144408
But its not complete. Here are a few other helpful ones. I'll update as I find more.


0x9 works like 0x1 (Wild Battle) except for the top layer covers the player.
0x21 works like 0x1 or 0x9 (Wild Battle) except for the player is above both of them.
0x60 works in an odd way. It deletes whatever image you had on there, and replaces it with random ones that you are able to walk over.

If anyone knows which block allows both the up and down layers to cover the player, please let me know!

This 0x60 sounds a lot like the tile behavior you might look for when setting a cut tree or a rock smash rock.
 

Criminon

Forever Spriting
265
Posts
11
Years
This 0x60 sounds a lot like the tile behavior you might look for when setting a cut tree or a rock smash rock.

I tried it but it didn't do anything. I'm using two layers as a building. The player can walk behind it. However when the player walks behind it, he walks in between the layers instead. I'm trying to fix this problem by letting the player walk behind both layers. However I can't find the correct one.
 

BLAx501!

Pokemon Flux
80
Posts
10
Years
Does anyone know which routine is executed to generate a wild Pokemon on the grass. I know JPAN create a special for this on his Hacked Engine, but it's easier with just the callasm
 
275
Posts
8
Years
Does anyone know which routine is executed to generate a wild Pokemon on the grass. I know JPAN create a special for this on his Hacked Engine, but it's easier with just the callasm

What do you need it for?
I ask, 'cause without that knowledge, I made encounters on sand to be possible just editing tiles with the Block Editor in Advance Map.
 
Last edited:
89
Posts
10
Years
[FONT= "Comic Neue"]To those people who want to expand the number of Pokémon on Emerald while retaining the animations:
Step 1:
Spoiler:

Step 2:
Spoiler:

Step 3:
Spoiler:

Step 4:
Spoiler:

Step 5:
Spoiler:

ZxXvwuk.gif

For the front sprite and back sprite animations index, Chaos Rush has an excellent index here on Pokécommunity. Now the only issue will be the creation of 2-frame sprites for Gen IV to Gen VI. Personally, knowing that Flora Sky has sprites for Gen IV to Gen V, I think that if Sky were to let us use and resize his sprites we could come up with a pretty good repository soon. Another method would be to use the Sugimori palettes DS-style sprite repository that MrDollSteak has come up with, which covers Gen I to V.
[/FONT]
 
Last edited:
102
Posts
15
Years
  • Seen Feb 2, 2023
I can't find the Small/stupid Questions Thread in tools and tutorials, so i'm posting here.

I want to know if there is any way to edit the gen 2 bug catching contest pokemon.

Now using a randomizer, i've randomized them successfully, so i know that A. It can be done, and B. Someone has figured it out.

For the record, i want to make it into a ghost-catching contest, with some newer gen ghosts added to the mix.
 

ProClifo

The Village Pirate Cat
86
Posts
15
Years
I found out that inserting a new map in Emerald will screw up the Battle Pyramid. Screen goes black when entering the blue warp thing at the beginning.

Anyone got a solution to this?
 
15
Posts
8
Years
  • Age 32
  • Seen Aug 26, 2019
Excuse me, I have a trouble with checking 1 Pokemon if it has been seen (= check Pokedex) in Emerald, I hasn't found any our topics talk about it... so, anyone know how to write script with XSE? Thanks!
(Such as: if you has seen it --> A/ hasn't --> B)
 
457
Posts
10
Years
  • Age 29
  • Seen Apr 9, 2024
For anyone interested, in FR US 1.0 (aka BPRE 1.0), to change your Pokédex "mode" to the style which DPPt used (That is, to have the seen amount displayed in the continue screen and the save screen instead of the caught numbers), change:

0800CF56: 00 20
0800CF64: 00 20
080F803C: 00 20
080F8044: 00 20

It really is that simple. :)

DPPt Save/Summary Pokedex Seen Count Display into Emerald


For those who want the DPPt Amount Display of Pokedex which displays the seen amount in while saving and in the continue-new game menu into Emerald:

08031F96: 00 20
08031FA4: 00 20
0819A3B0: 00 20
0819A3B8: 00 20

Again, it is really that simple. :)

Credits to Jambo51 for his original routine for FireRed.

Only error though: the Trainer's ID. While these changes, it doesn't show the seen amount. Does it supposedly to happen or not? I'll look into that later.
 
Last edited:

ProClifo

The Village Pirate Cat
86
Posts
15
Years
I've done some research on set wild battles in Emerald, and it turns out to be more complicated than what I anticipated. I can't guarantee that this is the same for Firered or any other ROM.

First of all, the command "setwildbattle PKMN LEVEL ITEM" is the same as doing "setvar 0x8004 PKMN, setvar 0x8005 LEVEL, setvar 0x8006 ITEM". Also, the flag 0x8C1 gets set before every battle and is cleared afterwards. I'm not sure why this happens. I don't see the difference when I don't include this.

A set wild battle is always followed by a special that determines the battle type, which is 0x139, 0x13A, 0x13B or 0x145.

---

SPECIAL 0x139

Special 0x139 doesn't seem to be used anywhere in the game, but it has a wave-like intro with the Kyogre/Groudon/Rayquaza battle music. Let's call it the "Weather Trio Song".

---

SPECIAL 0x13A

The special 0x13A is the strangest one, because it behaves differently depending on which Pokémon you're battling. This special is used on the Groudon, Kyogre, Rayquaza, Deoxys, Mew, Ho-oh and Lugia events.

If this special is used on any other Pokémon than the ones I mentioned, it will have the same intro that Groudon uses. Groudon image, cave background and the weather trio music.

When the special is used on Kyogre, it will have the same music but with a slightly different image and water background in battle.

On Rayquaza, it has the same music, different image and a sky background in battle.

Ho-Oh and Lugia have the same type of intro here. The screen fades black three times, then it pixelates. It uses the Kanto-legendary battle music.

Deoxys has almost the same as Ho-Oh and Lugia, except it uses a battle music that is exclusive to Deoxys.

Mew's intro fades black three times, then has a checkered-type of animation before going into battle. Not sure how to explain it, but it looks to be the same intro in special 0x13B. Mew also has its own exclusive battle music, which is similar to the Kanto-legendary music.

---

SPECIAL 0x13B

This special is only used for the Regis, and the intro depends on which of the three Pokémon is set in the wild battle.

First of all, if you use a Pokémon that isn't a Regi, it will have the Regi battle music but it will have the same type of intro that Mew uses.

In the intros, Regice shows seven yellow circles on the screen, Regirock shows seven orange circles and Registeel shows seven red circles. All in different patterns.

---

SPECIAL 0x145

This special does not behave differently depending on the Pokémon, but on the level. If the Pokémon is the same level or above your first Pokémon in the party, the intro will show white stripes. If it's under your Pokémon's level, it will be a completely normal intro, like a wild encounter in a grass patch. As far as I'm concerned, this special is pretty much the same as using a "wildbattle" command.

In the game, this special is only used on Southern Island for the Latios/Latias that isn't roaming, at level 50.

---

Here are videos with the scripts in the descriptions: https://drive.google.com/folderview?id=0B1n0SW2yBMufV18tNTdITkxhaEk&usp=sharing

I'm not sure how to change these battle types that are set to determined Pokémon. It might be possible with some ASM, but I have zero knowledge about that.

However, it's pretty easy to change the battle music. Just add a "playsong" command and use any song you like.
 

Joexv

ManMadeOfGouda joexv.github.io
1,037
Posts
11
Years
I've done some research on set wild battles in Emerald, and it turns out to be more complicated than what I anticipated. I can't guarantee that this is the same for Firered or any other ROM.

First of all, the command "setwildbattle PKMN LEVEL ITEM" is the same as doing "setvar 0x8004 PKMN, setvar 0x8005 LEVEL, setvar 0x8006 ITEM". Also, the flag 0x8C1 gets set before every battle and is cleared afterwards. I'm not sure why this happens. I don't see the difference when I don't include this.

A set wild battle is always followed by a special that determines the battle type, which is 0x139, 0x13A, 0x13B or 0x145.

---

SPECIAL 0x139

Special 0x139 doesn't seem to be used anywhere in the game, but it has a wave-like intro with the Kyogre/Groudon/Rayquaza battle music. Let's call it the "Weather Trio Song".

---

SPECIAL 0x13A

The special 0x13A is the strangest one, because it behaves differently depending on which Pokémon you're battling. This special is used on the Groudon, Kyogre, Rayquaza, Deoxys, Mew, Ho-oh and Lugia events.

If this special is used on any other Pokémon than the ones I mentioned, it will have the same intro that Groudon uses. Groudon image, cave background and the weather trio music.

When the special is used on Kyogre, it will have the same music but with a slightly different image and water background in battle.

On Rayquaza, it has the same music, different image and a sky background in battle.

Ho-Oh and Lugia have the same type of intro here. The screen fades black three times, then it pixelates. It uses the Kanto-legendary battle music.

Deoxys has almost the same as Ho-Oh and Lugia, except it uses a battle music that is exclusive to Deoxys.

Mew's intro fades black three times, then has a checkered-type of animation before going into battle. Not sure how to explain it, but it looks to be the same intro in special 0x13B. Mew also has its own exclusive battle music, which is similar to the Kanto-legendary music.

---

SPECIAL 0x13B

This special is only used for the Regis, and the intro depends on which of the three Pokémon is set in the wild battle.

First of all, if you use a Pokémon that isn't a Regi, it will have the Regi battle music but it will have the same type of intro that Mew uses.

In the intros, Regice shows seven yellow circles on the screen, Regirock shows seven orange circles and Registeel shows seven red circles. All in different patterns.

---

SPECIAL 0x145

This special does not behave differently depending on the Pokémon, but on the level. If the Pokémon is the same level or above your first Pokémon in the party, the intro will show white stripes. If it's under your Pokémon's level, it will be a completely normal intro, like a wild encounter in a grass patch. As far as I'm concerned, this special is pretty much the same as using a "wildbattle" command.

In the game, this special is only used on Southern Island for the Latios/Latias that isn't roaming, at level 50.

---

Here are videos with the scripts in the descriptions: https://drive.google.com/folderview?id=0B1n0SW2yBMufV18tNTdITkxhaEk&usp=sharing

I'm not sure how to change these battle types that are set to determined Pokémon. It might be possible with some ASM, but I have zero knowledge about that.

However, it's pretty easy to change the battle music. Just add a "playsong" command and use any song you like.
Just to add to what you've found, the flag 0x8c1 is set that way the overworld sprite that was used in the bttle is hidden via level scripts. (2 to be precise) one to hide it when you enter the map and the other to hide it directly after the battle. Its used this way in Fire Red too.
flag 0x8c1 is a temporary flag btw.

The level scripts structures are as follows:
Code:
Level Script type 5
#org @start
checkflag 0x8C1
if 0x1 call @hide
end

'---------------
#org @hide
special2 0xA 0xB7
compare 0xA 0x7
if 0x5 goto @done
hidesprite //Event number of sprite
return

'---------------
#org @done
return

Code:
'---------------
#org @start
checkflag 0x //Person ID for sprite
if 0x0 call @setflag
end

'---------------
#org @setflag
clearflag 0x //Person ID for sprite
return
 

ProClifo

The Village Pirate Cat
86
Posts
15
Years
Just to add to what you've found, the flag 0x8c1 is set that way the overworld sprite that was used in the bttle is hidden via level scripts. (2 to be precise) one to hide it when you enter the map and the other to hide it directly after the battle. Its used this way in Fire Red too.
flag 0x8c1 is a temporary flag btw.

The level scripts structures are as follows:
Code:
Level Script type 5
#org @start
checkflag 0x8C1
if 0x1 call @hide
end

'---------------
#org @hide
special2 0xA 0xB7
compare 0xA 0x7
if 0x5 goto @done
hidesprite //Event number of sprite
return

'---------------
#org @done
return

Code:
'---------------
#org @start
checkflag 0x //Person ID for sprite
if 0x0 call @setflag
end

'---------------
#org @setflag
clearflag 0x //Person ID for sprite
return
Not sure why this is included in both the level script and the battle script... take Rayquaza for example:

Spoiler:

And the level script at Sky Pillar:

Spoiler:
 

Joexv

ManMadeOfGouda joexv.github.io
1,037
Posts
11
Years
Not sure why this is included in both the level script and the battle script... take Rayquaza for example:

Spoiler:

And the level script at Sky Pillar:

Spoiler:
The hidesprites and such in the battlescript are for capturing, fleeing etc. But I guess the 2nd script I posted isn't necessary on every pokemon.
 
15
Posts
8
Years
  • Age 32
  • Seen Aug 26, 2019
In Emerald, anyone knows the script that check a certain PKMN in party? Tks!
 

Trainer 781

Guest
0
Posts
Battle Script Command cmd49 (Fire Red):
This is a very important command. It appears in 99% of the Move Effect Battle Scripts.
It is usually called at the end of battle Script (at 0x081d694E) which is used to terminates various Move Battle Scripts.
Code:
#org 0x081D694E
setbyte 0x2023FD8 0x0
cmd49 0x0 0x0
end

It is responsible for executing things like Contact Abilities, Shell Bell etc. that happen at the end of a Battle Script.
The command routine is located at 0x0823210.

At 0x2337c, there is a master table that controls the order of things that happen the end of a move.
Each entry in the table, consists of offset to the ASM code for a particular end move event.
There are 0x12 (18) entries in the table. I will explain the entries that I could understand

Table Entries:
Spoiler:


Table Execution Controllers:
Spoiler:


Usage and Table Expansion
Spoiler:


Important Locations, Registers and Shortcuts
Spoiler:
 
218
Posts
10
Years
  • Seen Nov 12, 2021
Spoiler:

That's great KDS, thanks for sharing this !
 
457
Posts
10
Years
  • Age 29
  • Seen Apr 9, 2024
Alright, it's done!

Code:
Type 01 at 080A0524, 080A064E and 080A0656 for the new HP check.
Type 02 E0 at 080A04CE to prevent friendship reducing.
Type 6B 02 at 081A8E04 to terminate the whiteout script.
Finally, insert FD0200E7E9E6EADDEAD9D800E8DCD900E4E3DDE7E3E2DDE2DBADFECEDCD900E4E3DDE7E3E200DAD5D8D9D800D5EBD5EDABFB somewhere in your ROM (or any other custom message using [buffer1]) and place a pointer to where you inserted it at 080A05E4.

That's it!

DPPt/HGSS Poison Survival Style into Emerald


For those who want the Generation IV's Poison Survival Style which leaves 1HP and the Poison status disappears in overworld into Emerald, here you go:

Code:
Type 01 at 080F962C, 080F977A and 080F9782 for the new HP check.
Type 02 E0 at 080F95D6 to prevent friendship reducing.
Type 6B 02 at 082736C1 to terminate the whiteout script.
Finally, insert FD0200E7E9E6EADDEAD9D800E8DCD900E4E3DDE7E3E2DDE2DBADFECEDCD900E4E3DDE7E3E200DAD5D8D9D800D5EBD5EDABFBFF somewhere in your ROM (or any other custom message using [buffer1]) and place a pointer to where you inserted it at 080F9710.

Credits to daniilS for his original routine for FireRed.
 
Last edited:
Back
Top