Users browsing this thread: 1 Guest(s)
Command Stance Exceptions

#1
Posts: 763
Threads: 83
Thanks Received: 56
Thanks Given: 7
Joined: Apr 2015
Reputation: 22
Status
Obliviscence
Say you are making a command set for a character and want them to use a mix of physical and magical attacks and would like the character to chant for the spells while standing attack-ready for the physical attacks... here's how you do it!

Code:
C1/9186:    BF9AE4C2    LDA $C2E49A,X    (command stance table)
C1/918A:    99BB61      STA $61BB,Y     (Command stance)
C1/918D:    60          RTS

This is the bit of code that tells the game what stance to load when you pick a command. It works by command ID, here's the data table for the corresponding commands.

Code:
C2/E49A: 0B           (Fight)
C2/E49B: 0B           (Item)
C2/E49C: 09           (Magic)
C2/E49D: 0B           (Morph)
C2/E49E: 0B           (Revert)
C2/E49F: 0B           (Steal)
C2/E4A0: 0B           (Capture)
C2/E4A1: 0B           (SwdTech)
C2/E4A2: 0B           (Throw)
C2/E4A3: 0B           (Tools)
C2/E4A4: 0B           (Blitz)
C2/E4A5: 0B           (Runic)
C2/E4A6: 0B           (Lore)
C2/E4A7: 0B           (Sketch)
C2/E4A8: 0B           (Control)
C2/E4A9: 0B           (Slot)
C2/E4AA: 0B           (Rage)
C2/E4AB: 0B           (Leap)
C2/E4AC: 0B           (Mimic)
C2/E4AD: 0B           (Dance)
C2/E4AE: 0B           (Row)
C2/E4AF: 0B           (Def.)
C2/E4B0: 0B           (Jump)
C2/E4B1: 0B           (X-Magic)
C2/E4B2: 0B           (GP Rain)
C2/E4B3: 09           (Summon)
C2/E4B4: 09           (Health)
C2/E4B5: 0B           (Shock)
C2/E4B6: 0B           (Possess)
C2/E4B7: 00           (Magitek)
C2/E4B8: 0B        
C2/E4B9: 0B          
C2/E4BA: 0B          
C2/E4BB: 0B          
C2/E4BC: 0B          
C2/E4BD: 0B            
C2/E4BE: 0B            
C2/E4BF: 0B          
C2/E4C0: 0B          
C2/E4C1: 0B          
C2/E4C2: 0B

One interesting note here is for people who use the Magitek menu for custom abilities, you can alter this so they don't just stand there before attacking by changing C2/E4B7 to $09 or $0B instead of $00.

Here is also a table for some animation IDs you can use for these stances:

Code:
$01 - Dead
$02 - Walking Down
$03 - Walking Right (left if formation on left screen)
$04 - Walking Left (right if formation of left screen)
$05 - Walking up
$06 - Standing
$07 - attack frame 2
$08 - flapping arms
$09 - Chanting
$0A - Crouched
$0B - Attacking stance
$0C - Taking Damage
$0D - Fallen (worldmap)
$0E - Facing Down Blinking
$0F - Facing right Blinking (left if on left screen)
$10 - Facing left blinking (right if on left screen)
$11 - winking
$12 - winking mirrored
$13 - facing down flapping arms
...
$25 - Confused

$01 = feign death ability maybe? Got bored testing these after $13.

So now that we have all the data in front of us. Now we need to write an exception for specific abilities.

Code:
Anywhere you have some free bytes:

AD 10 34        LDA $3410        (Spell ID)
C9 XX            CMP $XX          (This is the spell ID for your exception)
D0 03            BNE 03
A9 YY            LDA YY            (This is the animation ID you want to use)
6B                 RTL
BF 9A E4 C2    LDA $C2E49A,X  (command stance table)
6B                 RTL

You can put as many conditions as you want in here for as many different abilities as you want. You could potentially call all sorts of different criteria, such as statuses that could change your command stance, but for this we will stick with spell ID.

and lastly, you need to call your new function in place of the original table lookup:

Code:
C1/9186:    22XXXXXX    JSL $XXXXXX    (Your new function address!)
C1/918A:    99BB61      STA $61BB,Y     (Command stance)
C1/918D:    60          RTS

And that will do it. You can now split your physical/casting animations per spell ID and not just by command type. Let me know if you have any questions or need help getting this to work!

Happy Hacking!
  Find
Quote  
[-] The following 4 users say Thank You to B-Run for this post:
  • Blue Mage Gab (09-21-2013), Cyprus (06-02-2014), Gi Nattak (09-20-2013), GrayShadows (09-20-2013)



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite