• 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?".
  • Forum moderator applications are now open! Click here for details.
  • 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.

Development: Weather hacking

275
Posts
8
Years
daniilS, since you're looking into this, do you know how can I change weather effects?
Which types get hurt by a sandstorm, or which attack types get reduced when a certain weather is up (for example, Fire-type moves getting reduced in the rain), adding the damage to rain for ground and rock Pokémon...
Do you know where in the game is listed this kind of stuff?
 
218
Posts
10
Years
  • Seen Nov 12, 2021
daniilS, since you're looking into this, do you know how can I change weather effects?
Which types get hurt by a sandstorm, or which attack types get reduced when a certain weather is up (for example, Fire-type moves getting reduced in the rain), adding the damage to rain for ground and rock Pokémon...
Do you know where in the game is listed this kind of stuff?

If you look at the ability resource thread, I posted a routine for sand force which contain both damamge-boost and prevent-damage from sandstorm regardless of the type.

The area I hooked is where the damage-weather are effective, but it's ASM code so you'll have to learn.

For the damage based on weather, there's MANY places to look into. You can start by some of the places I hooked in Delta stream/desolate/primordial routines, look at the last part, the Air lock/Cloud nine checks are a good start I think
 

C me

Creator of Pokemon League Of Legends
681
Posts
10
Years
  • Age 27
  • Seen Apr 9, 2021
If you look at the ability resource thread, I posted a routine for sand force which contain both damamge-boost and prevent-damage from sandstorm regardless of the type.

The area I hooked is where the damage-weather are effective, but it's ASM code so you'll have to learn.

For the damage based on weather, there's MANY places to look into. You can start by some of the places I hooked in Delta stream/desolate/primordial routines, look at the last part, the Air lock/Cloud nine checks are a good start I think

How about only damaging the opposing team? If it's naturally occuring weather I guess it would have to damage everyone.
 
218
Posts
10
Years
  • Seen Nov 12, 2021
How about only damaging the opposing team? If it's naturally occuring weather I guess it would have to damage everyone.

You'll have to use a free ram location I think. And everytime a damaging weather is set, you'll have to use that free ram to know from what side the weather has been activated.
Then in the damaging weather routine you'll have to use the bank user (or target, depending on how work the routine), to decide wether the poke has to take the damage or not

For the bankuser/target, look at some routine in the ability resource thread
The free ram loc should be a unused ram location of course, again look at the ability resource thread. The delta stream routine, the setword routine etc use freeramloc, there's a ton like that around those location

Not sure if that's the good place to talk about it. Daniils tell us if you want we move around
 

Cruztown

Squirtle Squirt.
45
Posts
11
Years
  • Age 30
  • Seen Feb 1, 2024
I had a semi-relevant question, and didn't come across an adequate answer elsewhere:
What exactly ties the overworld weather to in-battle weather in Ruby, Sapphire, and Emerald?

And as a follow up, how feasible would it be to import that into FireRed?
 

Panda Face

Pokemon Ultra Snowy White
127
Posts
7
Years
  • Age 25
  • Seen Oct 22, 2022
Hello, Daniils, do you know how to add the hail effect in battle when the weather is snow flake on map? If yes, can you teach me how to add this feature by Winhex? I don't know how to use ASM, I know how to use winhex only, thank you very much. In gen 4 and gen 5, when the weather is snow on map, the battle will become hail weather. It is for Emerald.

Hello, every body, who does know how to add the hail effect in battle when the weather is snow flake on map? If someone knows, can someone teach me how to add this feature by Winhex? I don't know how to use ASM, I know how to use winhex only, thanks lot. In gen 4 and gen 5, when the weather is snow on map, the battle will become hail weather. It is for Emerald.

Hello, Artemis 64, do you know how to add the hail effect in battle when the weather is three snow flakes on the Map? In Rainy weather, the battle will happen rainy; in Underground flashes, the battle will happen sunny; In Sandstorm weather, the battle will happen sandstorm. So how to let in Three snow flakes, the battle will happen hail in Emerald? Thank you very much.
 
13
Posts
7
Years
  • Age 27
  • Seen Sep 12, 2019
I got sunny weather working in FR absolutely fine. I was wondering if it is possible to slow down the animation speed of the effect though? I've never really liked how sunny weather looked in gen III - it looks more like the screen is flashing than sunny weather and looks too distracting to use for a large area in a hack IMO.

I think it would look a lot better if the screen would get brighter and darker again more slowly, maybe at half the speed it is now. Is this possible? Could anyone better at ASM than me give me an idea where to look? Lol
 

BluRose

blu rass
811
Posts
9
Years
a lot of people have always seemed to want this smh

bRDAWry.gif

the video of this image took like 5 years to upload ok
i just ripped the tiles from neti's rombase and did the tiles in like 5 minutes because i had to have a pretty gif for this <3


MAKING WEATHERS OUTSIDE CORRESPOND TO THOSE IN-BATTLE
specifically hail

First, insert this routine:
Spoiler:
Now, here is the fun part:

0x01A1B8 has a jumptable with a pointer to it at 0x01A1B4.
Here it is, for all to see:
Code:
Offset    00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
0001A1B0                          E4 A1 01 08 50 A2 01 08 
0001A1C0  E4 A1 01 08 14 BE 76 08 58 5F 76 08 08 A2 01 08 
0001A1D0  50 A2 01 08 50 A2 01 08 50 A2 01 08 2C A2 01 08
0001A1E0  E4 A1 01 08
NOTICE: NONE OF THEM HAVE +1!

This table of pointers' entries each correspond to a weather value from 0x3 to 0xD (Rainy weather to Underground flashes [sic]/Extreme sun).
Weather values (taken from AMap .ini):
Spoiler:
We'll go into adjusting the maximum and minimum values later (if for whatever reason you want to).

So, what do you want to do?
"Steady snowing" is entry 0x7 in the list. Since we start counting at 0x3, it is the 5th entry in the table. "Three snow flakes" is entry 0x4. Since we start counting at 0x3, it is the 2nd entry in the table.
Hopefully, the pattern here is clear.
So "Steady snowing"'s entry is at 0x01A1C8; "Three snow flakes"'s is at 0x01A1BC.
Place a pointer to the routine (NOT +1) at its entry in the table, and voila. Hail happens when snow is present in the overworld.
NOTE: It MAY not be permanent! I have absolutely no idea and didn't test permanence because battles against level 2/3/4 Pokémon with level 2/3/4 Pokémon never last that long.

ONE LAST PART (displaying the correct message):

To make the correct battle message display at the start of battle, put F3 00 at 0x3FE602 (three snow flakes) and 0x3FE608 (steady snowing).
Shoutouts to pokemontutorialTV for informing me that this did not work on clean ROMs and for finding the fix!

If you want it for Emerald (Shoutouts to Panda Face!):
Spoiler:


EXPANDING YOUR TABLE

0x01A1A2 - minimum weather value (currently 0x3)
0x01A1A4 - [maximum weather value - minimum weather value] (currently 0xD - 0x3 = 0xA)
Why is this, one may ask?
Code:
ROM:0801A1A2                 SUBS    R0, #3  @ subtract current weather value by three
ROM:0801A1A4                 CMP     R0, #0xA  @ compare the new weather value to 0xA
ROM:0801A1A6                 BHI     def_801A1B0  @ if the new weather value is higher, go to the default case; no weather in-battle
There is a pointer to the table at 0x01A1B4.
And... that's it (probably)! Just repoint the table and adjust as necessary in order to expand beyond that.

The byte for weather in-battle:
Spoiler:

Have a nice day everyone!
 
Last edited:

Panda Face

Pokemon Ultra Snowy White
127
Posts
7
Years
  • Age 25
  • Seen Oct 22, 2022
a lot of people have always seemed to want this smh

bRDAWry.gif

the video of this image took like 5 years to upload ok
i just ripped the tiles from neti's rombase and did the tiles in like 5 minutes because i had to have a pretty gif for this <3


MAKING WEATHERS OUTSIDE CORRESPOND TO THOSE IN-BATTLE
specifically hail

First, insert this routine:
Spoiler:
Now, here is the fun part:

0x01A1B8 has a jumptable with a pointer to it at 0x01A1B4.
Here it is, for all to see:
Code:
Offset    00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
0001A1B0                          E4 A1 01 08 50 A2 01 08 
0001A1C0  E4 A1 01 08 14 BE 76 08 58 5F 76 08 08 A2 01 08 
0001A1D0  50 A2 01 08 50 A2 01 08 50 A2 01 08 2C A2 01 08
0001A1E0  E4 A1 01 08
NOTICE: NONE OF THEM HAVE +1!

This table of pointers' entries each correspond to a weather value from 0x3 to 0xD (Rainy weather to Underground flashes [sic]/Extreme sun).
Weather values (taken from AMap .ini):
Spoiler:
We'll go into adjusting the maximum and minimum values later (if for whatever reason you want to).

So, what do you want to do?
"Steady snowing" is entry 0x7 in the list. Since we start counting at 0x3, it is the 5th entry in the table. "Three snow flakes" is entry 0x4. Since we start counting at 0x3, it is the 2nd entry in the table.
Hopefully, the pattern here is clear.
So "Steady snowing"'s entry is at 0x01A1C8; "Three snow flakes"'s is at 0x01A1BC.
Place a pointer to the routine (NOT +1) at its entry in the table, and voila. Hail happens when snow is present in the overworld.
NOTE: It MAY not be permanent! I have absolutely no idea and didn't test permanence because battles against level 2/3/4 Pokémon with level 2/3/4 Pokémon never last that long.

EXPANDING YOUR TABLE

0x01A1A2 - minimum weather value (currently 0x3)
0x01A1A4 - [maximum weather value - minimum weather value] (currently 0xD - 0x3 = 0xA)
Why is this, one may ask?
Code:
ROM:0801A1A2                 SUBS    R0, #3  @ subtract current weather value by three
ROM:0801A1A4                 CMP     R0, #0xA  @ compare the new weather value to 0xA
ROM:0801A1A6                 BHI     def_801A1B0  @ if the new weather value is higher, go to the default case; no weather in-battle
There is a pointer to the table at 0x01A1B4.
And... that's it (probably)! Just repoint the table and adjust as necessary in order to expand beyond that.

The byte for weather in-battle:
Spoiler:

Have a nice day everyone!

It is for Fire Red, how to add it in Emerald?
 

Panda Face

Pokemon Ultra Snowy White
127
Posts
7
Years
  • Age 25
  • Seen Oct 22, 2022
In Emerald:
42AB8: 00 00 A2 08
42AC4: 00 00 A2 08
A20000: 08 4B 19 88 80 22 10 1C 08 40 00 28 07 D1 1A 80 05 49 0D 20 08 74 53 46 CB 75 05 48 00 47 03 48 00 47 00 00 CC 43 02 02 74 44 02 02 4D 2B 04 08 43 2B 04 08
 

Panda Face

Pokemon Ultra Snowy White
127
Posts
7
Years
  • Age 25
  • Seen Oct 22, 2022
How to add tornado and typhoon weather in emerald?
 

AtecainCorp.

Rejishan awake...
1,377
Posts
15
Years
a lot of people have always seemed to want this smh

bRDAWry.gif

the video of this image took like 5 years to upload ok
i just ripped the tiles from neti's rombase and did the tiles in like 5 minutes because i had to have a pretty gif for this <3


MAKING WEATHERS OUTSIDE CORRESPOND TO THOSE IN-BATTLE
specifically hail

First, insert this routine:
Spoiler:
Now, here is the fun part:

0x01A1B8 has a jumptable with a pointer to it at 0x01A1B4.
Here it is, for all to see:
Code:
Offset    00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
0001A1B0                          E4 A1 01 08 50 A2 01 08 
0001A1C0  E4 A1 01 08 14 BE 76 08 58 5F 76 08 08 A2 01 08 
0001A1D0  50 A2 01 08 50 A2 01 08 50 A2 01 08 2C A2 01 08
0001A1E0  E4 A1 01 08
NOTICE: NONE OF THEM HAVE +1!

This table of pointers' entries each correspond to a weather value from 0x3 to 0xD (Rainy weather to Underground flashes [sic]/Extreme sun).
Weather values (taken from AMap .ini):
Spoiler:
We'll go into adjusting the maximum and minimum values later (if for whatever reason you want to).

So, what do you want to do?
"Steady snowing" is entry 0x7 in the list. Since we start counting at 0x3, it is the 5th entry in the table. "Three snow flakes" is entry 0x4. Since we start counting at 0x3, it is the 2nd entry in the table.
Hopefully, the pattern here is clear.
So "Steady snowing"'s entry is at 0x01A1C8; "Three snow flakes"'s is at 0x01A1BC.
Place a pointer to the routine (NOT +1) at its entry in the table, and voila. Hail happens when snow is present in the overworld.
NOTE: It MAY not be permanent! I have absolutely no idea and didn't test permanence because battles against level 2/3/4 Pok?mon with level 2/3/4 Pok?mon never last that long.

ONE LAST PART (displaying the correct message):

To make the correct battle message display at the start of battle, put F3 00 at 0x3FE602 (three snow flakes) and 0x3FE608 (steady snowing).
Shoutouts to pokemontutorialTV for informing me that this did not work on clean ROMs and for finding the fix!

If you want it for Emerald (Shoutouts to Panda Face!):
Spoiler:


EXPANDING YOUR TABLE

0x01A1A2 - minimum weather value (currently 0x3)
0x01A1A4 - [maximum weather value - minimum weather value] (currently 0xD - 0x3 = 0xA)
Why is this, one may ask?
Code:
ROM:0801A1A2                 SUBS    R0, #3  @ subtract current weather value by three
ROM:0801A1A4                 CMP     R0, #0xA  @ compare the new weather value to 0xA
ROM:0801A1A6                 BHI     def_801A1B0  @ if the new weather value is higher, go to the default case; no weather in-battle
There is a pointer to the table at 0x01A1B4.
And... that's it (probably)! Just repoint the table and adjust as necessary in order to expand beyond that.

The byte for weather in-battle:
Spoiler:

Have a nice day everyone!

Is any way to use it on Pokemon Ruby?
 

BluRose

blu rass
811
Posts
9
Years
Is any way to use it on Pokemon Ruby?
dw i'm not ignoring you
will get back to you on that though when i have my laptop to look through roms with <3

EDIT:
routine (try it, may not work; had to adjust it, ruby does it weird):
Spoiler:
185A0 - jumptable pointer
185A4 - jumptable
4015F6 - F3 00
4015FC - F3 00

that should be enough info? not tested, please test and report back <3
 
Last edited:

AtecainCorp.

Rejishan awake...
1,377
Posts
15
Years
dw i'm not ignoring you
will get back to you on that though when i have my laptop to look through roms with <3

EDIT:
routine (try it, may not work; had to adjust it, ruby does it weird):
Spoiler:
185A0 - jumptable pointer
185A4 - jumptable
4015F6 - F3 00
4015FC - F3 00

that should be enough info? not tested, please test and report back <3

It helps a lot. But i have just one question. Which Pointer and what i should repleace with that routine.
 
Back
Top