Users browsing this thread: 1 Guest(s)
Shock/Health: Hardcoded animation?

#1
Posts: 378
Threads: 94
Thanks Received: 17
Thanks Given: 26
Joined: Jul 2013
Reputation: 11
Status
Charmed
Hi. I wish to change how Shock (or Health) works so it casts a different spell. I can easily make it so it casts anything else, but there's one problem: The animation. It stays like Shock (or Megahit) no matter what spell is chosen.

And no, the workaround of simply chainging Megahit's code won't work for me, since Madsiur gave me a patch to make the spell cast be different for an interval of levels.

Code:
Shock

C2/171A: A9 82        LDA #$82       ("Megahit" spell, which is what has Shock's data)
C2/171C: 80 02        BRA $1720      (go set that as spell/animation)

Changing 82 (which is the Megahit spell) to anything else will take on the properties of the new assigned spell, but the animation is still the same.

Help?


Step forward, spriters! We are also responsible to make hacks look new and fresh, we are no less important than code or ASM hackers! CHARGE!!
Quote  

#2
Posts: 3,970
Threads: 279
Thanks Received: 236
Thanks Given: 58
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
The LDX #$0F6C (C1/BB6A) use in many commands seem to be a base for animation data index, in the case of Health, 0 is added to it but on other commands using it it's probably not the case. The data pulled is 4180 FFFF FFFF 0000 0000 1041 0010, see animation data for details.

I could easily have a pointer selection around C1/BB6A depending of which spell chosen. Basically replacing the LDX #0F6C by a conditional of four that would point to their respective spell animation data. More news this week!

Edit: I made a test with #0000 pointing to first data (fire). I had the fire animation but followed by the Health animation. There might be a second call to an animation somewhere, more investigation needed.

Trace
Code:
c19cc8 sep #$20               A:0000 X:0f6c Y:0000 S:15df D:0000 DB:7e nvmxdIZc V:170 H:245 F:40
c19cca lda $d07fb2,x [d08f1e] A:0000 X:0f6c Y:0000 S:15df D:0000 DB:7e nvMxdIZc V:170 H:249 F:40
c19cce sta $6273,y   [7e6273] A:0041 X:0f6c Y:0000 S:15df D:0000 DB:7e nvMxdIzc V:170 H:257 F:40
c19cd1 inx                    A:0041 X:0f6c Y:0000 S:15df D:0000 DB:7e nvMxdIzc V:170 H:265 F:40
c19cd2 iny                    A:0041 X:0f6d Y:0000 S:15df D:0000 DB:7e nvMxdIzc V:170 H:268 F:40
c19cd3 cpy #$000e             A:0041 X:0f6d Y:0001 S:15df D:0000 DB:7e nvMxdIzc V:170 H:271 F:40
c19cd6 bne $9cca     [c19cca] A:0041 X:0f6d Y:0001 S:15df D:0000 DB:7e NvMxdIzc V:170 H:275 F:40
c19cca lda $d07fb2,x [d08f1f] A:0041 X:0f6d Y:0001 S:15df D:0000 DB:7e NvMxdIzc V:170 H:339 F:40
c19cce sta $6273,y   [7e6274] A:0080 X:0f6d Y:0001 S:15df D:0000 DB:7e NvMxdIzc V:171 H:  6 F:40
c19cd1 inx                    A:0080 X:0f6d Y:0001 S:15df D:0000 DB:7e NvMxdIzc V:171 H: 14 F:40
c19cd2 iny                    A:0080 X:0f6e Y:0001 S:15df D:0000 DB:7e nvMxdIzc V:171 H: 17 F:40
c19cd3 cpy #$000e             A:0080 X:0f6e Y:0002 S:15df D:0000 DB:7e nvMxdIzc V:171 H: 20 F:40
c19cd6 bne $9cca     [c19cca] A:0080 X:0f6e Y:0002 S:15df D:0000 DB:7e NvMxdIzc V:171 H: 25 F:40
c19cca lda $d07fb2,x [d08f20] A:0080 X:0f6e Y:0002 S:15df D:0000 DB:7e NvMxdIzc V:171 H: 29 F:40
c19cce sta $6273,y   [7e6275] A:00ff X:0f6e Y:0002 S:15df D:0000 DB:7e NvMxdIzc V:171 H: 37 F:40
c19cd1 inx                    A:00ff X:0f6e Y:0002 S:15df D:0000 DB:7e NvMxdIzc V:171 H: 45 F:40
c19cd2 iny                    A:00ff X:0f6f Y:0002 S:15df D:0000 DB:7e nvMxdIzc V:171 H: 48 F:40
c19cd3 cpy #$000e             A:00ff X:0f6f Y:0003 S:15df D:0000 DB:7e nvMxdIzc V:171 H: 51 F:40
c19cd6 bne $9cca     [c19cca] A:00ff X:0f6f Y:0003 S:15df D:0000 DB:7e NvMxdIzc V:171 H: 55 F:40
c19cca lda $d07fb2,x [d08f21] A:00ff X:0f6f Y:0003 S:15df D:0000 DB:7e NvMxdIzc V:171 H: 60 F:40
c19cce sta $6273,y   [7e6276] A:00ff X:0f6f Y:0003 S:15df D:0000 DB:7e NvMxdIzc V:171 H: 67 F:40
c19cd1 inx                    A:00ff X:0f6f Y:0003 S:15df D:0000 DB:7e NvMxdIzc V:171 H: 75 F:40
c19cd2 iny                    A:00ff X:0f70 Y:0003 S:15df D:0000 DB:7e nvMxdIzc V:171 H: 78 F:40
c19cd3 cpy #$000e             A:00ff X:0f70 Y:0004 S:15df D:0000 DB:7e nvMxdIzc V:171 H: 81 F:40
c19cd6 bne $9cca     [c19cca] A:00ff X:0f70 Y:0004 S:15df D:0000 DB:7e NvMxdIzc V:171 H: 86 F:40
c19cca lda $d07fb2,x [d08f22] A:00ff X:0f70 Y:0004 S:15df D:0000 DB:7e NvMxdIzc V:171 H: 90 F:40
c19cce sta $6273,y   [7e6277] A:00ff X:0f70 Y:0004 S:15df D:0000 DB:7e NvMxdIzc V:171 H: 98 F:40
c19cd1 inx                    A:00ff X:0f70 Y:0004 S:15df D:0000 DB:7e NvMxdIzc V:171 H:106 F:40
c19cd2 iny                    A:00ff X:0f71 Y:0004 S:15df D:0000 DB:7e nvMxdIzc V:171 H:109 F:40
c19cd3 cpy #$000e             A:00ff X:0f71 Y:0005 S:15df D:0000 DB:7e nvMxdIzc V:171 H:112 F:40
c19cd6 bne $9cca     [c19cca] A:00ff X:0f71 Y:0005 S:15df D:0000 DB:7e NvMxdIzc V:171 H:116 F:40
c19cca lda $d07fb2,x [d08f23] A:00ff X:0f71 Y:0005 S:15df D:0000 DB:7e NvMxdIzc V:171 H:121 F:40
c19cce sta $6273,y   [7e6278] A:00ff X:0f71 Y:0005 S:15df D:0000 DB:7e NvMxdIzc V:171 H:128 F:40
c19cd1 inx                    A:00ff X:0f71 Y:0005 S:15df D:0000 DB:7e NvMxdIzc V:171 H:146 F:40
c19cd2 iny                    A:00ff X:0f72 Y:0005 S:15df D:0000 DB:7e nvMxdIzc V:171 H:149 F:40
c19cd3 cpy #$000e             A:00ff X:0f72 Y:0006 S:15df D:0000 DB:7e nvMxdIzc V:171 H:152 F:40
c19cd6 bne $9cca     [c19cca] A:00ff X:0f72 Y:0006 S:15df D:0000 DB:7e NvMxdIzc V:171 H:157 F:40
c19cca lda $d07fb2,x [d08f24] A:00ff X:0f72 Y:0006 S:15df D:0000 DB:7e NvMxdIzc V:171 H:161 F:40
c19cce sta $6273,y   [7e6279] A:0000 X:0f72 Y:0006 S:15df D:0000 DB:7e nvMxdIZc V:171 H:169 F:40
c19cd1 inx                    A:0000 X:0f72 Y:0006 S:15df D:0000 DB:7e nvMxdIZc V:171 H:177 F:40
c19cd2 iny                    A:0000 X:0f73 Y:0006 S:15df D:0000 DB:7e nvMxdIzc V:171 H:180 F:40
c19cd3 cpy #$000e             A:0000 X:0f73 Y:0007 S:15df D:0000 DB:7e nvMxdIzc V:171 H:183 F:40
c19cd6 bne $9cca     [c19cca] A:0000 X:0f73 Y:0007 S:15df D:0000 DB:7e NvMxdIzc V:171 H:187 F:40
c19cca lda $d07fb2,x [d08f25] A:0000 X:0f73 Y:0007 S:15df D:0000 DB:7e NvMxdIzc V:171 H:192 F:40
c19cce sta $6273,y   [7e627a] A:0000 X:0f73 Y:0007 S:15df D:0000 DB:7e nvMxdIZc V:171 H:199 F:40
c19cd1 inx                    A:0000 X:0f73 Y:0007 S:15df D:0000 DB:7e nvMxdIZc V:171 H:207 F:40
c19cd2 iny                    A:0000 X:0f74 Y:0007 S:15df D:0000 DB:7e nvMxdIzc V:171 H:210 F:40
c19cd3 cpy #$000e             A:0000 X:0f74 Y:0008 S:15df D:0000 DB:7e nvMxdIzc V:171 H:213 F:40
c19cd6 bne $9cca     [c19cca] A:0000 X:0f74 Y:0008 S:15df D:0000 DB:7e NvMxdIzc V:171 H:218 F:40
c19cca lda $d07fb2,x [d08f26] A:0000 X:0f74 Y:0008 S:15df D:0000 DB:7e NvMxdIzc V:171 H:222 F:40
c19cce sta $6273,y   [7e627b] A:0000 X:0f74 Y:0008 S:15df D:0000 DB:7e nvMxdIZc V:171 H:230 F:40
c19cd1 inx                    A:0000 X:0f74 Y:0008 S:15df D:0000 DB:7e nvMxdIZc V:171 H:238 F:40
c19cd2 iny                    A:0000 X:0f75 Y:0008 S:15df D:0000 DB:7e nvMxdIzc V:171 H:241 F:40
c19cd3 cpy #$000e             A:0000 X:0f75 Y:0009 S:15df D:0000 DB:7e nvMxdIzc V:171 H:244 F:40
c19cd6 bne $9cca     [c19cca] A:0000 X:0f75 Y:0009 S:15df D:0000 DB:7e NvMxdIzc V:171 H:248 F:40
c19cca lda $d07fb2,x [d08f27] A:0000 X:0f75 Y:0009 S:15df D:0000 DB:7e NvMxdIzc V:171 H:253 F:40
c19cce sta $6273,y   [7e627c] A:0000 X:0f75 Y:0009 S:15df D:0000 DB:7e nvMxdIZc V:171 H:260 F:40
c19cd1 inx                    A:0000 X:0f75 Y:0009 S:15df D:0000 DB:7e nvMxdIZc V:171 H:268 F:40
c19cd2 iny                    A:0000 X:0f76 Y:0009 S:15df D:0000 DB:7e nvMxdIzc V:171 H:271 F:40
c19cd3 cpy #$000e             A:0000 X:0f76 Y:000a S:15df D:0000 DB:7e nvMxdIzc V:171 H:274 F:40
c19cd6 bne $9cca     [c19cca] A:0000 X:0f76 Y:000a S:15df D:0000 DB:7e NvMxdIzc V:171 H:338 F:40
c19cca lda $d07fb2,x [d08f28] A:0000 X:0f76 Y:000a S:15df D:0000 DB:7e NvMxdIzc V:172 H:  2 F:40
c19cce sta $6273,y   [7e627d] A:0010 X:0f76 Y:000a S:15df D:0000 DB:7e nvMxdIzc V:172 H: 10 F:40
c19cd1 inx                    A:0010 X:0f76 Y:000a S:15df D:0000 DB:7e nvMxdIzc V:172 H: 18 F:40
c19cd2 iny                    A:0010 X:0f77 Y:000a S:15df D:0000 DB:7e nvMxdIzc V:172 H: 21 F:40
c19cd3 cpy #$000e             A:0010 X:0f77 Y:000b S:15df D:0000 DB:7e nvMxdIzc V:172 H: 24 F:40
c19cd6 bne $9cca     [c19cca] A:0010 X:0f77 Y:000b S:15df D:0000 DB:7e NvMxdIzc V:172 H: 28 F:40
c19cca lda $d07fb2,x [d08f29] A:0010 X:0f77 Y:000b S:15df D:0000 DB:7e NvMxdIzc V:172 H: 33 F:40
c19cce sta $6273,y   [7e627e] A:0041 X:0f77 Y:000b S:15df D:0000 DB:7e nvMxdIzc V:172 H: 40 F:40
c19cd1 inx                    A:0041 X:0f77 Y:000b S:15df D:0000 DB:7e nvMxdIzc V:172 H: 48 F:40
c19cd2 iny                    A:0041 X:0f78 Y:000b S:15df D:0000 DB:7e nvMxdIzc V:172 H: 51 F:40
c19cd3 cpy #$000e             A:0041 X:0f78 Y:000c S:15df D:0000 DB:7e nvMxdIzc V:172 H: 54 F:40
c19cd6 bne $9cca     [c19cca] A:0041 X:0f78 Y:000c S:15df D:0000 DB:7e NvMxdIzc V:172 H: 59 F:40
c19cca lda $d07fb2,x [d08f2a] A:0041 X:0f78 Y:000c S:15df D:0000 DB:7e NvMxdIzc V:172 H: 63 F:40
c19cce sta $6273,y   [7e627f] A:0000 X:0f78 Y:000c S:15df D:0000 DB:7e nvMxdIZc V:172 H: 71 F:40
c19cd1 inx                    A:0000 X:0f78 Y:000c S:15df D:0000 DB:7e nvMxdIZc V:172 H: 79 F:40
c19cd2 iny                    A:0000 X:0f79 Y:000c S:15df D:0000 DB:7e nvMxdIzc V:172 H: 82 F:40
c19cd3 cpy #$000e             A:0000 X:0f79 Y:000d S:15df D:0000 DB:7e nvMxdIzc V:172 H: 85 F:40
c19cd6 bne $9cca     [c19cca] A:0000 X:0f79 Y:000d S:15df D:0000 DB:7e NvMxdIzc V:172 H: 89 F:40
c19cca lda $d07fb2,x [d08f2b] A:0000 X:0f79 Y:000d S:15df D:0000 DB:7e NvMxdIzc V:172 H: 94 F:40
c19cce sta $6273,y   [7e6280] A:0010 X:0f79 Y:000d S:15df D:0000 DB:7e nvMxdIzc V:172 H:101 F:40
c19cd1 inx                    A:0010 X:0f79 Y:000d S:15df D:0000 DB:7e nvMxdIzc V:172 H:109 F:40
c19cd2 iny                    A:0010 X:0f7a Y:000d S:15df D:0000 DB:7e nvMxdIzc V:172 H:112 F:40
c19cd3 cpy #$000e             A:0010 X:0f7a Y:000e S:15df D:0000 DB:7e nvMxdIzc V:172 H:115 F:40
c19cd6 bne $9cca     [c19cca] A:0010 X:0f7a Y:000e S:15df D:0000 DB:7e nvMxdIZC V:172 H:120 F:40
  Find
Quote  

#3
Posts: 149
Threads: 21
Thanks Received: 40
Thanks Given: 3
Joined: Dec 2013
Reputation: 9
Status
Auto-life
For animation purposes, $B5 and $B6 are used. $B5 is the command and $B6 is the command selection.

For the shock/health command, it looks like $B5 isn't altered and the animation used will be the animation for the command. It looks intentional by the game designers. 

You can use Umaro's storm code as a base to alter the shock/health command. It setups $B5 as the 'magic' command with the spell id as $B6. The code begins at C2/170D.

I did a custom code to alter shock/health to use custom assigned spells with their animations. It uses a piece of Umaro's storm code. You can change the 'shock_spell' and 'health_spell' variables for their new spells id and compile it with asar.

Code:
;===============================================================================
;
; shock/health use spell animation
;
;===============================================================================

header
hirom

!shock_spell    = #$05      ;change for shock spell id
!health_spell   = #$2E      ;change for health spell id

;-------------------------------------------------------------------------------
; shock
;-------------------------------------------------------------------------------
org     $C2171A
shock_command:

    ;setup spell
        LDA !shock_spell
        BRA data_setup

warnpc  $C2171E

;-------------------------------------------------------------------------------
; health
;-------------------------------------------------------------------------------
org     $C2171E
health_command:

    ;setup spell
        LDA !health_spell

data_setup:
    ;setup data
        JMP $1712

warnpc  $C21726

Keep in mind that specific spells may have animation issues, like the 'one step forward' bug and alike. Also, you may have issues with the spells targeting and the commands targeting if they aren't  compatible.
  Find
Quote  

#4
Posts: 281
Threads: 18
Thanks Received: 13
Thanks Given: 8
Joined: Mar 2014
Reputation: 8
Status
None
This sets the command to Magic, so enemies that counter the Magic command will counter Shock too. And you can't set enemies to counter the Shock command exclusively. It's a decent workaround but not ideal.As you said, it will have the problem with stepping back off the battlefield if used with a spell, since the Shock command doesn't have a "step forward" component to its animation.
  Find
Quote  

#5
Posts: 149
Threads: 21
Thanks Received: 40
Thanks Given: 3
Joined: Dec 2013
Reputation: 9
Status
Auto-life
I suppose all animations compatible with the 'magic' command should work. Other animations associated with other commands (sword tech, blitz, etc) may or may not have the 'one step forward' bug.

You can use C2/1DBF to determinate the correct command for any of the 256 spells/actions/moves table. It gets the spell/action/move identifier and returns the command identifier assigned for it. It should be the correct match between the command and the animation number of steps. However, you only need two spells for the health and shock commands. If they work correctly with the Umaro's storm route, to use C2/1DBF may be unnecessary.
  Find
Quote  

#6
Posts: 3,970
Threads: 279
Thanks Received: 236
Thanks Given: 58
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
(05-16-2017, 06:13 AM)seibaby Wrote: This sets the command to Magic, so enemies that counter the Magic command will counter Shock too. And you can't set enemies to counter the Shock command exclusively. It's a decent workaround but not ideal.

For this reason I'm not sure if I could continue my initial route or take this workaround? How would you explain changing what I thought was Health animation data does trigger the correct animation (e.g. Fire1) but does Health animation right after? Would Health animation be in fact 2x Cure2 animation? It's a bit of Kuga's call too but if I can't fix the 2nd animation or remove it might as well take Hatzen08 solution...
  Find
Quote  

#7
Posts: 1,633
Threads: 56
Thanks Received: 13
Thanks Given: 84
Joined: Apr 2014
Reputation: 12
Status
Atma
(05-16-2017, 06:13 AM)seibaby Wrote: And you can't set enemies to counter the Shock command exclusively. 
why not? might have missed a line or two of the discussion, still if you wanna make a custom counter for shock and a different one for any other magic then all what you need is to put as first counter a reaction to shock command or megahit spell; as second counter(below this one)
you make a counter to magic command.
Sure, if it's a matter of common sense, then it's another story...


THE GREATEST CHALLENGE OF ALL TIMES AWAITS:
http://www.ff6hacking.com/forums/showthr...p?tid=2593
DO YOU HAVE WHAT IT TAKES TO SLAY A GOD?
------------------------------------------------------------------------
Tenkarider's project #2 is started: FF6 Curse of the Madsiur Joke (CotMJ)
http://www.ff6hacking.com/forums/showthr...p?tid=2755
What happens when Madsiur tweaks your account? This full game hack will show that!
  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite