The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary Hack Research & Development (https://www.pokecommunity.com/forumdisplay.php?f=195)
-   -   Research Castform Forms (https://www.pokecommunity.com/showthread.php?t=205458)

DreadWaffle January 12th, 2010 3:20 PM

Castform Forms
 
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
http://i.imagehost.org/0683/castform_stats.png
and if you notice it has forecast, so i tried it on a mudkip
here he is in battle
http://www.pokecommunity.com/picture.php?albumid=5052&pictureid=37844
and i use rain dance
http://www.pokecommunity.com/picture.php?albumid=5052&pictureid=37845
nothing happens
http://www.pokecommunity.com/picture.php?albumid=5052&pictureid=37846
so obviously just changing an ability does not make the change
and on unLZ i have the form spritesheet
1388
http://www.pokecommunity.com/picture.php?albumid=5052&pictureid=37841
1389
http://www.pokecommunity.com/picture.php?albumid=5052&pictureid=37843
1390
http://www.pokecommunity.com/picture.php?albumid=5052&pictureid=37842
i then decided to change the backsprite and got this
http://i.imagehost.org/0187/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 January 13th, 2010 9:15 AM

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 January 13th, 2010 9:35 AM

Quote:

Originally Posted by pokemonforever27 (Post 5471351)
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 January 14th, 2010 6:55 AM

You should have done more research, I suppose. Directly taken from Bulbapedia:

Quote:

Originally Posted by Forecast (ability)
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) January 14th, 2010 1:42 PM

Quote:

Originally Posted by HackMew (Post 5473156)
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 January 14th, 2010 2:19 PM

Quote:

Originally Posted by Matteron (96) (Post 5473722)
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 January 14th, 2010 2:33 PM

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.

Totodile7 January 26th, 2010 12:49 AM

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 February 23rd, 2010 7:03 AM

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.

Okami Chi February 23rd, 2010 7:09 AM

Quote:

Originally Posted by DreadWaffle (Post 5469883)
Night

Give me Night Castform! I think doing what they did with Arceus, and then doing it with Castform would be great. Give Castform some kind of hold item to make him produce certain weather would be cool. :D

JPAN April 14th, 2010 4:41 PM

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]
ROM:08019DC0                LDR    R0, =0x181
ROM:08019DC2                CMP    R1, R0
ROM:08019DC4                BNE    loc_8019E50 ;if not castform, quit
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 April 15th, 2010 2:04 AM

Quote:

Originally Posted by JPAN (Post 5716298)
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.

altariaking April 25th, 2010 3:50 AM

i tried this, and it worked...except the pokemon turned into just a silhouete of it's rain form

Wiimeiser May 3rd, 2010 5:15 PM

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.

Gamer2020 May 3rd, 2010 6:30 PM

Quote:

Originally Posted by Wiimeiser (Post 5772016)
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.

No...
The extra forms don't take up any slots.

TheChroniclesofLance May 17th, 2010 8:54 PM

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. June 21st, 2010 6:12 PM

i set ability to FORECAST on my pokemon(its 252 but called Test1) with YAPE
When i battled Something like this hapened
________________________________
Quote:

______________ __________________
| 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 June 22nd, 2010 4:23 AM

Quote:

Originally Posted by Funfat. (Post 5900798)
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 July 25th, 2010 9:37 PM

Quote:

Originally Posted by Luster (Post 5574781)
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 August 3rd, 2010 2:29 AM

How does the game know to change the type if the extra forms dont take up a slot?

TokioHumaNeko August 3rd, 2010 10:12 AM

Special Hex-code that the Programmers have figured out. I don't understand it,but they must have used a special script for it to transform.

Quote:

Originally Posted by Wiimeiser (Post 5772016)
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.

Deca-whats?!?!?! What in the name of Arceus are those?

jemon August 4th, 2010 5:13 AM

so, it IS possible to add new forms?

TokioHumaNeko August 4th, 2010 8:40 AM

Maybe,Maybe not. I am unsure about the whole thing,and i don't know how to do it. But it would be possible to hack the Castform Code if someone could figure it out someday.

jemon August 4th, 2010 10:33 PM

it looks like we were getting somewhere though :)

iTeruri August 5th, 2010 12:48 AM

Quote:

Originally Posted by TokioHumaNeko (Post 6031913)
Deca-whats?!?!?! What in the name of Arceus are those?

Apparently this is DecaMarks. It's the first Pokémon, before Bulbasaur. Some call it MissingNo., but it's no glitch, it's there to prevent glitches.

TokioHumaNeko August 10th, 2010 10:14 PM

Quote:

Originally Posted by jemon (Post 6037593)
it looks like we were getting somewhere though :)

Yeah. All we need to do is somehow unlock the Hex-code for the Castform Conundrum!


All times are GMT -8. The time now is 8:48 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.