You are not logged in.
Hello! I'm trying to add new attack animations, since I'm adding new attacks to the game. I could just reuse existing animations, but I'd really like to try creating some new ones... the main issue I've ran in to so far lies in AttackAnimationPointers...in order for my new animations to align correctly with it's move ID, I would have to insert it after Struggle in this pointer table. That's fine, but it then goes and offsets all the OTHER animation pointers which follow that (causing such humorous effects as the Enemy playing its "confused" animation when my Pokemon gets sent out, heh)...
my assumption is that the game merely maps the move ID to whatever animation corresponds to the same value as itself in the pointer table, so I probably wouldn't be able to remap those simply. Since no attacks normally came after Struggle, this normally wouldn't have caused an issue. What I can't seem to figure out, however, is how the game determines where the non-attack animations are considered to start within the pointer table. My guess is that I just need to alter this, and I'd be all set....correct? Does anyone happen to know what code the game is using to calculate these? Also, am I limited to how many entries I can place in the pointer table? My initial assumption is I can't go over 255, which is a concern because I've got about 251 attacks now in total. Would I need to place the non-attack animations in a different place? I guess I'm not totally understanding how this is set up.
Thanks for the help in advance, this one's really left me scratching my head.
Last edited by KeiTaRo (2017-03-22 23:52:18)
If you want nearly 255 attacks and animation ids, you have to split move and status animations. Status animations are these: https://github.com/pret/pokered/blob/46 … #L174-L210
Here's a summary of what you'd have to do:
- Add const_value = 1 after the STRUGGLE constant in constants/move_constants.asm
- Create a flag in ram to identify if the animation to play is move or status (e.g. wAnimationCategory)
- In battle/core.asm, create a function that is similar to PlayMoveAnimation (e.g PlayStatusAnimation), but that sets wAnimationCategory to the "status animation" value/constant. Have PlayMoveAnimation set it to the "move animation" value/constant. Careful with PlayBattleAnimationGotID at the bottom of engine/battle/core.asm. I believe that function is only used for move anims, so set wAnimationCategory to "move animation" in that function.
- Split AttackAnimationPointers in data/animations.asm into two tables, one for move anims and another for status anims (e.g. new table called StatusAnimationPointers).
- In PlayAnimation at engine/battle/animations.asm, use the wAnimationCategory flag to determine whether to read from AttackAnimationPointers or StatusAnimationPointers.
- Split AnimationIdSpecialEffects in engine/battle/animations.asm into two tables, one for move anims and another for status anims (e.g. AnimationIdSpecialEffects_Moves and AnimationIdSpecialEffects_Status).
- In DoSpecialEffectByAnimationId at engine/battle/animations.asm, use the wAnimationCategory flag to determine whether to read from AnimationIdSpecialEffects_Moves or from AnimationIdSpecialEffects_Status.
- In the cp a,TOSS_ANIM line of MoveAnimation make sure to check that wAnimationCategory contains "status animation" before assuming that it is the pokeball animation (since some move will share id with it). Same applies to the SetAnimationPalette and IsCryMove functions (except for the latter, you check for "move animation" instead).
- For Amnesia and Rest in ShareMoveAnimations make sure to also set the wAnimationCategory flag to "status animation".
- Identify the PlayMoveAnimation calls in engine/battle/core.asm that are meant to play a status animation (i.e. when you see constants such as BURN_PSN_ANIM or POOF_ANIM loaded before) and replace those calls with PlayStatusAnimation calls.
There are probably some leftover issues that I missed but that should be most of it.
Last edited by Crystal_ (2017-03-28 23:32:36)
How do I make this step -" Create a flag in ram to identify if the animation to play is move or status (e.g. wAnimationCategory)" in constants/move_constants.asm?
you wouldn't, you'd do that in wram.asm, in a space that isn't being used by anything else...so for example, all those "ds 1", "ds 4", whatever, this stands for "designate space", and puts aside that many bytes for the ram flag you've defined. You can find unused space if you see a "ds somenumber" that isn't associated with any label. If you aren't feeling too confident about that, I know there's at least a few existing memory locations labeled as unused, so just double up on the labels and you'll be good to go! :)