Thread: Development: In-Battle Evolutions
View Single Post
Old August 8th, 2012 (2:50 PM). Edited August 9th, 2012 by NintendoBoyDX.
NintendoBoyDX NintendoBoyDX is offline
Join Date: Jul 2010
Gender: Male
Posts: 94
So I've been working on in battle evolution lately. In the end I want to have it set up so that items like stones can be used to get the pokemon to evolve in battle, and also for them to evolve through level up, and any other means.

So one suggestion was to use castforms script, which is at:
But the problem with castform is that it, and all its forms, are all 1 single image. So there is no opportunity to change the pointer later on.

So I have what I believe is a better idea. Using the ghost "transformation" sequence when the ghost sprite switches to marowak. Because here, one sprite switches completely to another sprite (so it's better than castform) and its not limited to one single move (like the transform attack).

The load of the pointer of marowak's frontsprite is here:
I'm currently looking into how its calculated, and all that. Stat calculations and all that is the easy part. But getting the sprite to switch and a viable animation/sound to play is the hard part. Perhaps by looking at this code, a script can be made and hooked into the castform script, which runs at very good intervals.

Well I believe I've figured out a way. Took a few hours, and also thanks to jambo for a lot of info which was helpful in finding the code!

081D91A1 unk_081D91A1:   .byte 0x39 @ 9          @ DATA XREF: sub_08013514+30o
081D91A1                                         @ ROM:off_08013564o
081D91A2                 .byte 0x20
081D91A3                 .byte    0
081D91A4                 .byte 0x10
081D91A5                 .byte 0x7C @ |
081D91A6                 .byte    1
081D91A7                 .byte 0x3A @ :
081D91A8                 .byte 0x45 @ E
081D91A9                 .byte  0xC
081D91AA                 .byte 0x19
081D91AB                 .byte    0
081D91AC                 .byte    0
081D91AD                 .byte    0
081D91AE                 .byte    0
081D91AF                 .byte 0x39 @ 9
081D91B0                 .byte 0x20
081D91B1                 .byte    0
081D91B2                 .byte 0x10
081D91B3                 .byte 0x7D @ }
081D91B4                 .byte    1
081D91B5                 .byte 0x12
081D91B6                 .byte 0x40 @ @
081D91B7                 .byte    0
081D91B8                 .byte 0x3E @ >
This is the ghost-marowak battle script.

In this script it calls the transformation battle animation in the following way:
0x19(transformation animation)
0x00000000(a word that can be used for other stuff, but is unused in this case)
There are 0xC banks to choose from for this command. The bank you choose reflects which side receives the animation. So if we just leave the bank as 0xC, I've found the spot that a routine can be hooked in. 0x1 = opponent, 0x0 = player.

08016EB8 MOVS R0, #1
This spot needs to be changed so that the script can use either 0x1 or 0x0 depending on whether its the player or the opponents move.

08034C62 BL get_pokemon_data
This spot is where it pulls marowak's ID number out of pokemon main (not battle) ram. This is where we can hook in routines to read and change the ID # of the pokemon, recalculate stats, and all that good stuff.

I'll probably work it out myself soon, or another person can. I also think there must be a better way of doing things, so I'll keep looking into it for sure.

My plan is to:
1. Change the code in those two routines ^ so that the side who receives the animation can be specified, and the pokemon it changes to can be specified.

2. Hook a script next to the castform script, or perhaps in the level-up routine, to check if a pokemon has the requirements necessary to evolve, and if so play the transform animation and switch the sprite, play some sort of sound, then have the pokemon evolve with full stat recalculations and such.

3. Maintain functionality for the ghost battle... possibly. Personally I don't need it, but a few others may like to have that functionality. There are a lot of checks for the silph scope and ghost battle flags and such that I may have to change, so some testing is in order.

4. Get in battle evolution to work with the items (stones), while maintaining functionality in the overworld.

Later on I might try to find some combination of animations that looks a little better, but for now, the idea is to stick with that transform animation.
Reply With Quote