FF6 Hacking
Giving another character Morph - 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: Giving another character Morph (/thread-2696.html)



Giving another character Morph - CrumpledMedal - 09-18-2014

Would it be possible to give another character the Command Morph besides Terra?


RE: Giving another character Morph - HatZen08 - 09-19-2014

The game engine uses only one counter for the morph timer. It is $1CF6 (RAM). If more than one character use the morph command, they will conflict over the use of the timer.

I consider difficult to implement multiple morph timers for multiple characters. It will require good hacking skills to modify the game engine. In my opinion, it isn't worth the effort. In comparison, it should be easier to rewrite the behavior of the morph command for something anew.

The morph duration is updated at the end of the battles, but it is hard coded with Terra's presence. It doesn't matter whoever has the morph command, only Terra can update the morph duration.


RE: Giving another character Morph - GrayShadows - 09-19-2014

... I'm curious about this now. Give me a couple of hours and I'll see what I can find. (Thank you, C2, for being the best documented code bank.)

-----

Okay, at a quick glance, the code is set to allow only one character to be morphed at a given time.

Code:
C2/0B03: AD E2 3E     LDA $3EE2      (Which target is Morphed)
C2/0B06: 10 2B        BPL $0B33      (Exit function if someone is already Morphed)

I'll have to look at the RAM around that to see exactly what's going on with it, but I suspect there's only one byte set aside for denoting who's Morphed at any given time. Considering it's also a status, however, I'm not sure how that's dealt with.

Assuming that's fixable, I think the easiest way to code multiple people having Morph would be to use a modified version -- a toggled Morph rather than a timed one. That bypasses the issue of only one SRAM byte for the Morph timer and avoids having to code a string of CMP to figure out which character's SRAM byte we're supposed to be looking at.

Basically: short answer, no. As it exists, Morph only works with one character, although certain hardcoded to Terra parts are pretty easy to move around to a different character.

Long answer: still no, at least as it exists. Any kind of reasonable change to the Morph command that allows multiple characters to use it is going to require an overhaul of the underlying code in such a way that it will have to act differently. A toggled rather than a timed Morph is probably the easiest. It would prooooobably be an in-line hack, since a lot of the code governing the Morph timer could be overwritten if necessary.