FF6 Hacking
Changing a characters equip ID? - 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: Changing a characters equip ID? (/thread-2657.html)



Changing a characters equip ID? - Scorcher - 08-09-2014

Would it be possible to make it so Leo has Celes' equip ID? Like, could you make it so that Leo can equip whatever Celes can?

CoverHitKungfu!


RE: Changing a characters equip ID? - HatZen08 - 08-10-2014

The check of the menu access for equipment is at C3/1E5F and C3/1E74. C3/1E5F is related with normal equipment and C3/1E74 is related with relics. Specifically, the CMP opcode in the functions are worth of interest:

Code:
C3/1E6B BD 00 00 LDA $0000,X  char ID
C3/1E6E C9 0D    CMP #$0D     (Umaro or higher?)
C3/1E70 B0 3F    BCS $1EB1
C3/1E72 80 28    BRA $1E9C

Code:
C3/1E80 BD 00 00 LDA $0000,X  char ID
C3/1E83 C9 0E    CMP #$0E     (Leo or higher?)
C3/1E85 B0 2A    BCS $1EB1
C3/1E87 80 13    BRA $1E9C

The equipment which can be equipped is the issue. At C3/9C41 function, the code converts the char ID from its numeric value to its bit value. The first character is the first bit, the second character is the second bit, the third character is the third bit, etc. For this purpose, it uses the C3/9C67 table. It has only 16 indexes and characters ID higher than 16 will bypass the table boundary and garbage will be loaded.

You can try to track down the use of the C3/9C67 table to find the other codes related with equipment. If you want to use characters ID beyond 16, you must reconstruct the code(s) to load a valid value from inside the table based on the character ID. How exactly it can be done is debatable. Options are:
  • Move and expand the table
    Remap from a character ID to another character ID
    Kill and recycle the “imp based” and “merit award” flags

Unfortunately, you can't do it without assembly modifications, and I fear it may not be easy. You probably must deal with other codes as well...


RE: Changing a characters equip ID? - Scorcher - 08-10-2014

I just replaced a bunch of those with EA and now guests can equip anything.


RE: Changing a characters equip ID? - HatZen08 - 08-10-2014

Quote:I just replaced a bunch of those with EA and now guests can equip anything.

Yes, they equip almost everything because the equipment bytes loaded from beyond the C3/9C67 table generally has more than one bit set. The code expected only one bit by character, but multiple bits are found instead. The guest can equip the sum of all equipment which bit is set, one bit by character. Multiple bits allows to equip the equipment of multiple characters.

Specifically for Leo, his character ID is 15 and he uses the merit award flag as its equipment flag. If you don't care about the symbiotic relationship between the merit award effect and Leo, you only need to restrict the access to equipment menu for the default characters and Leo only. The merit award flag will determine Leo's available equipment and the merit award equipment.

As a note, Banon ID is 14 and his equipment flag is the imp equipment flag. Because of its special effect, the items he can equip are only imp equipments and they are only useful with the imp status. For the other guests equal or beyond the ID 0f 16, the code won't work correctly and it loads garbage for the guests equipment bits.


RE: Changing a characters equip ID? - Scorcher - 08-10-2014

But wait, they can both equip anything, not just Leo.


RE: Changing a characters equip ID? - Gi Nattak - 08-10-2014

Yeah because you NOP'd the part of the code that tells it to restrict the equipment.


RE: Changing a characters equip ID? - Scorcher - 08-10-2014

Ah, that makes sense