FF6 Hacking
Swdtech/Runic weapon check, for other skills? - Printable Version

+- FF6 Hacking (https://www.ff6hacking.com/forums)
+-- Forum: Discussion Forums (https://www.ff6hacking.com/forums/forum-5.html)
+--- Forum: Magitek Research Facility (https://www.ff6hacking.com/forums/forum-9.html)
+--- Thread: Swdtech/Runic weapon check, for other skills? (/thread-3271.html)



Swdtech/Runic weapon check, for other skills? - FF6Fanatic - 06-19-2016

Code:
Check for greyed out commands (judging from this, adding Sketch shouldn't be difficult)
C3/5F25: 48       PHA
C3/5F26: C90B     CMP #$0B (is it runic?)
C3/5F28: F010     BEQ $5F3A
C3/5F2A: C907     CMP #$07 (is it swdtech?)
C3/5F2C: F016     BEQ $5F44
C3/5F2E: A920     LDA #$20
C3/5F30: 8529     STA $29         (set text color to white)
C3/5F32: 68       PLA
C3/5F33: 60       RTS

C3/5F34: A924     LDA #$24
C3/5F36: 8529     STA $29         (set text color to gray)
C3/5F38: 68       PLA
C3/5F39: 60       RTS

Grey out Runic command if no weapons have Runic ability
C3/5F3A: ADDA11   LDA $11DA
C3/5F3D: 0DDB11   ORA $11DB
C3/5F40: 10F2     BPL $5F34
C3/5F42: 80EA     BRA $5F2E

Grey out SwdTech command if no weapons have SwdTech ability
C3/5F44: ADDA11   LDA $11DA
C3/5F47: 0DDB11   ORA $11DB
C3/5F4A: 8902     BIT #$02
C3/5F4C: F0E6     BEQ $5F34
C3/5F4E: 80DE     BRA $5F2E

^From Lenophis' site.

I want this kind of check to be made for the Lore command. So if the player doesn't have the appropriate weapon equipped, Lore should be greyed out.

I also have this:


Code:
Hex values for skills:

Fight - 00
Item - 01
Magic - 02
Morph - 03
Revert - 04
Steal - 05
Capture - 06
SwdTech - 07
Throw - 08
Tools - 09
Blitz - 0A
Runic - 0B
Lore - OC
Sketch - 0D
Control - OE
Slot - OF
Rage - 10
Leap - 11
Mimic -12
Dance -13
Row - 14
Def - 15
Jump - 16
X-Magic - 17
GP Rain - 18
Summon - 19
Health - 1A
Shock -1B
Possess -1C
MagiTek -1D

So let's say I want the weapon check for Runic to effect Lore instead. It should be a simple matter of replacing hex, right? Like

Code:
C3/5F26: C90B     CMP #$0B (is it runic?)

to

Code:
C3/5F26: C90C     CMP #$0C (is it lore?)

Thats the "check for greyed out commands" part. But what about the "grey out Runic command if no weapons have Runic ability"?

Looking at the code for that part, it's not really obvious what I should do. Any ideas?


RE: Swdtech/Runic weapon check, for other skills? - HatZen08 - 06-19-2016

I suspect the code you mentioned is for the menus outside battle. For the menus inside battle, you also need to check the code at C2/527D. The following tables, related with this code, may be relevant:

Code:
(Data - commands that can potentially get grayed out on the menu in battle,
 or have a property like their aiming altered.)

C2/52E9: 03    (Morph)
C2/52EA: 0B    (Runic)
C2/52EB: 07    (SwdTech)
C2/52EC: 0C    (Lore)
C2/52ED: 17    (X-Magic)
C2/52EE: 02    (Magic)
C2/52EF: 06    (Capture)
C2/52F0: 00    (Fight)

Code:
(Data - addresses of functions to check whether above command should be
 enabled, disabled, or otherwise modified on battle menu)

C2/52F1: 26 53   (Morph)
C2/52F3: 22 53   (Runic)
C2/52F5: 1D 53   (SwdTech)
C2/52F7: 14 53   (Lore)
C2/52F9: 14 53   (X-Magic)
C2/52FB: 14 53   (Magic)
C2/52FD: 01 53   (Capture)
C2/52FF: 01 53   (Fight)



RE: Swdtech/Runic weapon check, for other skills? - FF6Fanatic - 06-19-2016

I found a workaround, it's already functional. Thanks Hatzen, I'll copy that data to my notes. I'm a fan of your hacks, btw.