Additional Command Change Flag
#1
Thanks to Serity for their help with this one.

This is a walkthrough for how to turn the "raise pre-emptive strike" flag of the Gale Hairpin (which is pretty useless imho) into a flag to change commands like the Fake Mustache, etc.

There are two parts - the battle menu, and the Status menu.

Code:
C2/53A5: B9 FC 00     LDA $00FC,Y   (get command from menu slot)
C2/53A8: A2 04        LDX #$04
C2/53AA: 48           PHA
C2/53AB: A9 04        LDA #$04
C2/53AD: 85 EE        STA $EE        (start checking Bit 2 of variable $11D6)
C2/53AF: BF 52 54 C2  LDA $C25452,X  (commands that can be changed FROM)
C2/53B3: C3 01        CMP $01,S      (is current command one of those commands?)
C2/53B5: D0 0D        BNE $53C4      (branch if not)
C2/53B7: AD D6 11     LDA $11D6     (check Battle Effects 1 byte.
                                    Bit 2 = Fight -> Jump, Bit 3 = Magic -> X-Magic,
                                    Bit 4 = Sketch -> Control, Bit 5 = Slot -> GP Rain,
                                    Bit 6 = Steal -> Capture)
               
C2/53BA: 24 EE        BIT $EE
C2/53BC: F0 06        BEQ $53C4
C2/53BE: BF 57 54 C2  LDA $C25457,X   (commands to change TO)
C2/53C2: 83 01        STA $01,S       (replace command on stack)
C2/53C4: 06 EE        ASL $EE         (will check the next highest bit of $11D6
                                      in our next iteration)
C2/53C6: CA           DEX
C2/53C7: 10 E6        BPL $53AF       (loop for all 5 possible commands that can be
                                      converted)
The command lists at C2/5452 and C2/5457 will need to be relocated to empty space to make room to add an additional command to both lists. The bit counts backwards, so at the END of those lists, add "FF XX", where XX is the hex value for the command you want to change and what to change it into (FF is to skip the Back Guard byte). For my project I'm changing Runic to Shock, so that's 0B and 1B
You'll then have to change how long your list is. Change C2/53A8 to "A2 06" and C2/53AB to "A9 01".
The command will now be changed in battle, which is the most important, but it won't show up in the character's command list in the Status Menu.

Code:
C3/616F:    B91600      LDA $0016,Y    ; Command
C3/6172:    85E0        STA $E0        ; Memorize it
C3/6174:    7B          TDC            ; Clear A
C3/6175:    AA          TAX            ; 1st: Capture
C3/6176:    ADD611      LDA $11D6      ; Relic effects
C3/6179:    297C        AND #$7C       ; Cmd upgrades
C3/617B:    0A          ASL A          ; Shift bits
C3/617C:    0A          ASL A          ; Got current?
C3/617D:    900A        BCC $6189      ; Skip if not
C3/617F:    48          PHA            ; Save upgrades
C3/6180:    BF9861C3    LDA $C36198,X  ; Cmd to switch
C3/6184:    C5E0        CMP $E0        ; Current cmd?
C3/6186:    F00A        BEQ $6192      ; Replace if so
C3/6188:    68          PLA            ; Cmd upgrades
C3/6189:    E8          INX            ; Index +1
C3/618A:    E00500      CPX #$0005     ; Done Fight?
C3/618D:    D0ED        BNE $617C      ; Loop if not
C3/618F:    A5E0        LDA $E0        ; Original cmd
C3/6191:    60          RTS

Change C3/618A to "E0 05 XX", where XX is the hex value of whatever your original command being changed is; before Fight-Jump was the last command checked and then the game looped back, now with FF XX tacked onto the end, the XX will be the last command checked. Then change C3/6179 to "29 7B" to not filter out Bit 0 which DOES change a command now.

And you're done! The Gale Hairpin flag in usME is now a "change command" flag.
Reply
#2
Any ideas on where the code for calling Interceptor would be located? It'd be cool to give Shadow a special relic that allows the player to call on Interceptor whenever they choose to do so.
Reply
#3
No, that's entirely different from what this is.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Adding additional Sprite frames? Northerner 0 1,345 11-24-2022, 05:08 AM
Last Post: Northerner
  Command Change Custom Event GrayShadows 8 8,570 05-22-2022, 11:07 PM
Last Post: fedorajoe
  Relic change command doofenH 11 9,213 05-09-2022, 11:53 AM
Last Post: Xontract
  Command Change Relic Table Expansion Celestial84 2 2,671 12-04-2021, 07:01 AM
Last Post: Celestial84
  Formation Special Event Flag Findings Gi Nattak 1 2,228 01-07-2021, 04:48 PM
Last Post: C-Dude
  Need help with event flag. Mantecol 3 5,861 07-23-2018, 08:47 PM
Last Post: GrayShadows
  "Low on HP" spells and "Active if Imp" flag DrakeyC 4 5,032 02-23-2018, 02:18 PM
Last Post: dn
  Creating An Additional Learnable Menu of Spells? Timbo 5 10,455 03-28-2017, 09:34 PM
Last Post: madsiur
  Mug command change Royaken 7 10,964 02-12-2016, 07:09 AM
Last Post: Catone
  Change the Health command effect Blue Mage Gab 18 15,621 12-08-2015, 08:31 AM
Last Post: Zozma

Forum Jump:


Users browsing this thread: