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

Research: Castform Forms

DreadWaffle

LOVE AND PEACE!
165
Posts
14
Years
This is for Fire Red currently
I have been trying to figure this out for a while now of the main way castform changes forms , and if they can be expanded for other things like Day/Night
and sandstorms. Or even for a pokemon to use such an ability
--------------------------------------------------------------------------
here are his stats in Fire red from YAPE
castform_stats.png

and if you notice it has forecast, so i tried it on a mudkip
here he is in battle
picture.php

and i use rain dance
picture.php

nothing happens
picture.php

so obviously just changing an ability does not make the change
and on unLZ i have the form spritesheet
1388
picture.php

1389
picture.php

1390
picture.php

i then decided to change the backsprite and got this
iwentmessingaroundwiththeforms.png

did that to see what would happen
i am hoping anyone who think this is worth some time expands on this a little
 

pokemonforever27

IS RIDING LUGIA...
55
Posts
15
Years
I never thought much about this, but it is interesting.

I did a little looking myself. I find it interesting that both 1389 and 1391 in unLZ even exist at all. If you look at the other POKEMON, none of them have any extra data between front and back sprites, yet CASTFORM does. I wonder if those two extra pieces are somehow telling the ROM which form to put CASTFORM in?

Something else that might help, if we knew where in memory CASTFORM resided during battle, we may be able to play with values and forcefully change him whenever we wanted. Then we may know how the computer does it.
 

Iacobus

sǝɯɐɾ
64
Posts
20
Years
I find it interesting that both 1389 and 1391 in unLZ even exist at all. If you look at the other POKEMON, none of them have any extra data between front and back sprites, yet CASTFORM does. I wonder if those two extra pieces are somehow telling the ROM which form to put CASTFORM in?
Oh please. Every with eyes and a brain knows those two things hold the palettes for the different form (Well, apparently not everyone with eyes and a brain knows that.)
Those files are (once uncompressed) 0x80 bytes each. There are 4 forms. Every form uses a different palette of 16 colours. Every colour uses two bytes. 16 times 0x2 = 0x20 (32). 4 times 0x20 = 0x80. Blah.
 

HackMew

Mewtwo Strikes Back
1,314
Posts
17
Years
  • Seen Oct 26, 2011
You should have done more research, I suppose. Directly taken from Bulbapedia:

Forecast (ability) said:
This ability is made specifically for Castform, and as such, if other Pokémon have this ability (either via Skill Swap or Trace) it will have no effect.

As such, the game must check the Pokémon species to see if it's a Castform, which makes sense as other Pokémon don't have those alternate weather forms.
 

Matteron (96)

Can't Read Lookin Ass
270
Posts
15
Years
  • Age 27
  • Seen Feb 13, 2024
You should have done more research, I suppose. Directly taken from Bulbapedia:



As such, the game must check the Pokémon species to see if it's a Castform, which makes sense as other Pokémon don't have those alternate weather forms.
well in that case can't we asm hack a pokemon to have what the game looks for to see if it is a castform =]
 

Iacobus

sǝɯɐɾ
64
Posts
20
Years
well in that case can't we asm hack a pokemon to have what the game looks for to see if it is a castform =]
Sure we can..
But to do so you'll have to take a look at the attacks which influence the weather; like Sunny Day and Rain Dance. Those attacks probably check for.. something. And if the game finds that something, it triggers the transformation.

Could someone see what happens to Castform when using one of those attacks AFTER you've edit Castform's sprite to be the default size. I have no tools here; I should be studying anyway.
 

interdpth

I've seen things, man.
275
Posts
19
Years
  • Seen Jun 8, 2021
It'd reference non-existant data and you'd get a screwed up sprite(man it's hard to not curse ={)

I don't have the tools, nor do I want to check. XD But doesn't each pokemon have their own ID?


So the you'd set a break point for in battle and you'd check for a register equaling to the id.

Then you can make every pokemon have the id and good stuff like that., etc.
 
7
Posts
14
Years
  • Seen Apr 5, 2010
I went and changed me and my rival's starters to Castform in a FireRed rom after changing Castform's sprite to just normal form, and used rain dance. Then the Castforms did the transformation, but instead of going into rain form, they just disapeared! And when I tried changing Mudkip's sprite to one with 4 recolored Mudkips, changed ability to Forecast, and changed moves to Rain Dance, Hail, Sunny Day and Tackle. I made him my starter, and everything was going fine 'till when I tried to send out Mr. Edited Mudkip into battle, the game froze! I can't post pics 'cos I haven't made enough posts yet. :(
 

Luster

Form changing script (HINT)
29
Posts
14
Years
I've been thinking the same. a ground type for sandstorm, a flying type for cloudy, an electric type for thunderstorm... if anything comes up, let me know. i'm sorry i can't help, i'm a pathetic asm hacker. as in, i cant do it.
 

JPAN

pokemon rom researcher
104
Posts
15
Years
  • Seen Jul 2, 2016
I've recently been working on how abilities work, and I came across the reason why that ability only works on Castform.

Abilities are checked a bit on a "as need goes" format, meaning there is no single "ability routine". They are spread out across the code, sometime grouping together (like volt absorb and water absorb), other times being repeated in several locations (hustle is present on the "attack up" routine and in the "accuracy down" routine). Forecast, however, works like this:

The chekc for the forecast byte is done at 0x0801A182, then proceeding to call a specific function to check which form will be used. They are numbered 0-4. I'm still looking how to expand that number, but for now, this is all we got. This piece of code is located at 0x08019DAC, and is a long and boring checklist for possible outcomes. the first being "pokemon not a castform", at bold:

Code:
ROM:08019DAC Form_switch                             ; CODE XREF: ROM:0801A342p
ROM:08019DAC                                         ; ROM:0801A3B6p ...
ROM:08019DAC
ROM:08019DAC var_14          = -0x14
ROM:08019DAC
ROM:08019DAC                 PUSH    {R4-R6,LR}
ROM:08019DAE                 SUB     SP, SP, #4
ROM:08019DB0                 LSL     R0, R0, #0x18
ROM:08019DB2                 LSR     R6, R0, #0x18
ROM:08019DB4                 MOV     R5, #0
ROM:08019DB6                 LDR     R1, =0x2023BE4
ROM:08019DB8                 MOV     R0, #0x58
ROM:08019DBA                 MUL     R0, R6
ROM:08019DBC                 ADD     R4, R0, R1
ROM:08019DBE                 LDRH    R1, [R4]
[B]ROM:08019DC0                 LDR     R0, =0x181[/B]
[B]ROM:08019DC2                 CMP     R1, R0[/B]
[B]ROM:08019DC4                 BNE     loc_8019E50 ;if not castform, quit[/B]
ROM:08019DC6                 ADD     R0, R4, #0
ROM:08019DC8                 ADD     R0, #0x20
ROM:08019DCA                 LDRB    R0, [R0]
ROM:08019DCC                 CMP     R0, #0x3B
ROM:08019DCE                 BNE     loc_8019E50
ROM:08019DD0                 LDRH    R0, [R4,#0x28]
ROM:08019DD2                 CMP     R0, #0
ROM:08019DD4                 BEQ     loc_8019E50
ROM:08019DD6                 STR     R5, [SP,#0x14+var_14]
ROM:08019DD8                 MOV     R0, #0x13
ROM:08019DDA                 MOV     R1, #0
ROM:08019DDC                 MOV     R2, #0xD
ROM:08019DDE                 MOV     R3, #0
ROM:08019DE0                 BL      test_abilities
ROM:08019DE4                 LSL     R0, R0, #0x18
ROM:08019DE6                 CMP     R0, #0
ROM:08019DE8                 BNE     loc_8019DFE
ROM:08019DEA                 STR     R5, [SP,#0x14+var_14]
ROM:08019DEC                 MOV     R0, #0x13
ROM:08019DEE                 MOV     R1, #0
ROM:08019DF0                 MOV     R2, #0x4D
ROM:08019DF2                 MOV     R3, #0
ROM:08019DF4                 BL      test_abilities
ROM:08019DF8                 LSL     R0, R0, #0x18
ROM:08019DFA                 CMP     R0, #0
ROM:08019DFC                 BEQ     loc_8019E24
ROM:08019DFE
ROM:08019DFE loc_8019DFE                             ; CODE XREF: Form_switch+3Cj
ROM:08019DFE                 ADD     R2, R4, #0
ROM:08019E00                 ADD     R2, #0x21
ROM:08019E02                 LDRB    R0, [R2]
ROM:08019E04                 CMP     R0, #0
ROM:08019E06                 BEQ     loc_8019E24
ROM:08019E08                 ADD     R1, R4, #0
ROM:08019E0A                 ADD     R1, #0x22
ROM:08019E0C                 LDRB    R0, [R1]
ROM:08019E0E                 CMP     R0, #0
ROM:08019E10                 BEQ     loc_8019E24
ROM:08019E12                 STRB    R5, [R2]
ROM:08019E14                 STRB    R5, [R1]
ROM:08019E16                 MOV     R0, #1
ROM:08019E18                 B       loc_8019F08
ROM:08019E18 ; ---------------------------------------------------------------------------
ROM:08019E1A                 DCB    0
ROM:08019E1B                 DCB    0
ROM:08019E1C dword_8019E1C   DCD 0x2023BE4           ; DATA XREF: Form_switch+Ar
ROM:08019E20 dword_8019E20   DCD 0x181               ; DATA XREF: Form_switch+14r
ROM:08019E24 ; ---------------------------------------------------------------------------
ROM:08019E24
ROM:08019E24 loc_8019E24                             ; CODE XREF: Form_switch+50j
ROM:08019E24                                         ; Form_switch+5Aj ...
ROM:08019E24                 MOV     R0, #0
ROM:08019E26                 STR     R0, [SP,#0x14+var_14]
ROM:08019E28                 MOV     R0, #0x13
ROM:08019E2A                 MOV     R1, #0
ROM:08019E2C                 MOV     R2, #0xD
ROM:08019E2E                 MOV     R3, #0
ROM:08019E30                 BL      test_abilities
ROM:08019E34                 LSL     R0, R0, #0x18
ROM:08019E36                 LSR     R0, R0, #0x18
ROM:08019E38                 CMP     R0, #0
ROM:08019E3A                 BNE     loc_8019E50
ROM:08019E3C                 STR     R0, [SP,#0x14+var_14]
ROM:08019E3E                 MOV     R0, #0x13
ROM:08019E40                 MOV     R1, #0
ROM:08019E42                 MOV     R2, #0x4D
ROM:08019E44                 MOV     R3, #0
ROM:08019E46                 BL      test_abilities
ROM:08019E4A                 LSL     R0, R0, #0x18
ROM:08019E4C                 CMP     R0, #0
ROM:08019E4E                 BEQ     loc_8019E54
ROM:08019E50
ROM:08019E50 loc_8019E50                             ; CODE XREF: Form_switch+18j
ROM:08019E50                                         ; Form_switch+22j ...
ROM:08019E50                 MOV     R0, #0
ROM:08019E52                 B       loc_8019F08
ROM:08019E54 ; ---------------------------------------------------------------------------
ROM:08019E54
ROM:08019E54 loc_8019E54                             ; CODE XREF: Form_switch+A2j
ROM:08019E54                 LDR     R1, =0x2023F1C
ROM:08019E56                 LDRH    R0, [R1]
ROM:08019E58                 MOV     R2, #0xE7
ROM:08019E5A                 AND     R2, R0
ROM:08019E5C                 ADD     R4, R1, #0
ROM:08019E5E                 CMP     R2, #0
ROM:08019E60                 BNE     loc_8019E82
ROM:08019E62                 LDR     R1, =0x2023BE4
ROM:08019E64                 MOV     R0, #0x58
ROM:08019E66                 MUL     R0, R6
ROM:08019E68                 ADD     R1, R0, R1
ROM:08019E6A                 ADD     R3, R1, #0
ROM:08019E6C                 ADD     R3, #0x21
ROM:08019E6E                 LDRB    R0, [R3]
ROM:08019E70                 CMP     R0, #0
ROM:08019E72                 BEQ     loc_8019E82
ROM:08019E74                 ADD     R1, #0x22
ROM:08019E76                 LDRB    R0, [R1]
ROM:08019E78                 CMP     R0, #0
ROM:08019E7A                 BEQ     loc_8019E82
ROM:08019E7C                 STRB    R2, [R3]
ROM:08019E7E                 STRB    R2, [R1]
ROM:08019E80                 MOV     R5, #1
ROM:08019E82
ROM:08019E82 loc_8019E82                             ; CODE XREF: Form_switch+B4j
ROM:08019E82                                         ; Form_switch+C6j ...
ROM:08019E82                 LDRH    R1, [R4]
ROM:08019E84                 MOV     R0, #0x60
ROM:08019E86                 AND     R0, R1
ROM:08019E88                 CMP     R0, #0
ROM:08019E8A                 BEQ     loc_8019EAE
ROM:08019E8C                 LDR     R1, =0x2023BE4
ROM:08019E8E                 MOV     R0, #0x58
ROM:08019E90                 MUL     R0, R6
ROM:08019E92                 ADD     R1, R0, R1
ROM:08019E94                 ADD     R2, R1, #0
ROM:08019E96                 ADD     R2, #0x21
ROM:08019E98                 LDRB    R0, [R2]
ROM:08019E9A                 CMP     R0, #0xA
ROM:08019E9C                 BEQ     loc_8019EAE
ROM:08019E9E                 ADD     R1, #0x22
ROM:08019EA0                 LDRB    R0, [R1]
ROM:08019EA2                 CMP     R0, #0xA
ROM:08019EA4                 BEQ     loc_8019EAE
ROM:08019EA6                 MOV     R0, #0xA
ROM:08019EA8                 STRB    R0, [R2]
ROM:08019EAA                 STRB    R0, [R1]
ROM:08019EAC                 MOV     R5, #2
ROM:08019EAE
ROM:08019EAE loc_8019EAE                             ; CODE XREF: Form_switch+DEj
ROM:08019EAE                                         ; Form_switch+F0j ...
ROM:08019EAE                 LDRH    R1, [R4]
ROM:08019EB0                 MOV     R0, #7
ROM:08019EB2                 AND     R0, R1
ROM:08019EB4                 CMP     R0, #0
ROM:08019EB6                 BEQ     loc_8019EDA
ROM:08019EB8                 LDR     R1, =0x2023BE4
ROM:08019EBA                 MOV     R0, #0x58
ROM:08019EBC                 MUL     R0, R6
ROM:08019EBE                 ADD     R1, R0, R1
ROM:08019EC0                 ADD     R2, R1, #0
ROM:08019EC2                 ADD     R2, #0x21
ROM:08019EC4                 LDRB    R0, [R2]
ROM:08019EC6                 CMP     R0, #0xB
ROM:08019EC8                 BEQ     loc_8019EDA
ROM:08019ECA                 ADD     R1, #0x22
ROM:08019ECC                 LDRB    R0, [R1]
ROM:08019ECE                 CMP     R0, #0xB
ROM:08019ED0                 BEQ     loc_8019EDA
ROM:08019ED2                 MOV     R0, #0xB
ROM:08019ED4                 STRB    R0, [R2]
ROM:08019ED6                 STRB    R0, [R1]
ROM:08019ED8                 MOV     R5, #3
ROM:08019EDA
ROM:08019EDA loc_8019EDA                             ; CODE XREF: Form_switch+10Aj
ROM:08019EDA                                         ; Form_switch+11Cj ...
ROM:08019EDA                 LDRH    R1, [R4]
ROM:08019EDC                 MOV     R0, #0x80
ROM:08019EDE                 AND     R0, R1
ROM:08019EE0                 CMP     R0, #0
ROM:08019EE2                 BEQ     loc_8019F06
ROM:08019EE4                 LDR     R1, =0x2023BE4
ROM:08019EE6                 MOV     R0, #0x58
ROM:08019EE8                 MUL     R0, R6
ROM:08019EEA                 ADD     R1, R0, R1
ROM:08019EEC                 ADD     R2, R1, #0
ROM:08019EEE                 ADD     R2, #0x21
ROM:08019EF0                 LDRB    R0, [R2]
ROM:08019EF2                 CMP     R0, #0xF
ROM:08019EF4                 BEQ     loc_8019F06
ROM:08019EF6                 ADD     R1, #0x22
ROM:08019EF8                 LDRB    R0, [R1]
ROM:08019EFA                 CMP     R0, #0xF
ROM:08019EFC                 BEQ     loc_8019F06
ROM:08019EFE                 MOV     R0, #0xF
ROM:08019F00                 STRB    R0, [R2]
ROM:08019F02                 STRB    R0, [R1]
ROM:08019F04                 MOV     R5, #4
ROM:08019F06
ROM:08019F06 loc_8019F06                             ; CODE XREF: Form_switch+136j
ROM:08019F06                                         ; Form_switch+148j ...
ROM:08019F06                 ADD     R0, R5, #0
ROM:08019F08
ROM:08019F08 loc_8019F08                             ; CODE XREF: Form_switch+6Cj
ROM:08019F08                                         ; Form_switch+A6j
ROM:08019F08                 ADD     SP, SP, #4
ROM:08019F0A                 POP     {R4-R6}
ROM:08019F0C                 POP     {R1}
ROM:08019F0E                 BX      R1
ROM:08019F0E ; End of function Form_switch
The other code checks for weather conditions, rechecks the ability and the current form. the "test_abilities" function (located right below at 0x08019F18) is a very large function that acts as a switch for all ability testing, including contact-based effects and a selection of sound moves.

To make this work with any pokemon, simply fill with zeros the area from 08019DC0 to 08019DC5. In this way, any pokemon with the forecast ability can turn into a new form. I have tested this with a bulbasaur that had the deoxys forms, and it works as long as the palette has an entry for each picture, in the same format as Castform's.
 

HackMew

Mewtwo Strikes Back
1,314
Posts
17
Years
  • Seen Oct 26, 2011
To make this work with any pokemon, simply fill with zeros the area from 08019DC0 to 08019DC5.

Well, instead of filling that area with 00s, I think it's better to just replace 81 with 89 at offset 0x19DC2; the end result would be the same.
 
27
Posts
14
Years
  • Seen May 3, 2010
That's because Castform's and Deoxys' alternate forms use slots below Chimeco's, along with the EGG, bad EGG, and Decamarks. Like the 25 old Unown.
 
114
Posts
13
Years
  • Seen May 7, 2012
what would be interesting is if you could make Eevee do something similar.
Water terrain (while surfing or something)--->Vaporeon
Hail---->Glaceon
Sunny->Flareon
Forests-> Leafeon
Thunderstorm->Jolteon
Cave or Night->Umbreon
 

Funfat.

Working on scripts that fail
17
Posts
15
Years
i set ability to FORECAST on my pokemon(its 252 but called Test1) with YAPE
When i battled Something like this hapened
________________________________
______________ __________________
| MAGIKARP LV 5| MAGIKARP PICTURE
_
|Health bar |- _________________
__________________________________
__________________________________
_______________
| Test1 LV100|
| Health bar |- "??"
| 315/315 | PICTURE
________________________________
|It is raining! |
*****************************
The ability forecast might do nothing.
It's probadly the data structure of CASTFORM.
 

altariaking

Needs NO VMs...
1,087
Posts
14
Years
i set ability to FORECAST on my pokemon(its 252 but called Test1) with YAPE
When i battled Something like this hapened
________________________________

*****************************
The ability forecast might do nothing.
It's probadly the data structure of CASTFORM.
First, change the specified pointer. Second, insert another sprite on top of the pokemon in unlz-gba.
Third, does anyone know why when I changed pikachu to crab pikachu in the rain it was just a silhoutte?
 

TokioHumaNeko

Pokemon Zodiac Wishes
165
Posts
13
Years
I've been thinking the same. a ground type for sandstorm, a flying type for cloudy, an electric type for thunderstorm... if anything comes up, let me know. i'm sorry i can't help, i'm a pathetic asm hacker. as in, i cant do it.

It would rock if they made that...Gives the player more options,ya know? Like,if you play with a Castform at night,it could turn into a Shadow version of itself. Or,if you're in a sandstorm,Castform could turn into a Rock-headed creature with a mini sandstorm under it!

My idea: Give Castform an Updated Weather Ball,New forms,and at least an evolution. That would be awesome.
 

jemon

Eevee's Plaything
6
Posts
14
Years
How does the game know to change the type if the extra forms dont take up a slot?
 
Back
Top