+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  FF4j (Translated w/JCE): Creating New Magic Menus
Pages: [1]
Author Topic: FF4j (Translated w/JCE): Creating New Magic Menus  (Read 2 times)
Edea
Guest
« on: March 03, 2008, 04:36:57 pm »

Problem: It's probably been asked before, but I ran a few searches for "Final Fantasy" in this forum and couldn't find anything like this, so here goes.  I would like to give a couple characters in my FF4j game (patched with JCE's translation) access to some extra magic menus (specifically I'm trying to give Kain limited Black magic, in particular Psych and Drain (in imitation of the Lancet ability), and I'm trying to give the adult Rydia her White magic menu back).

Here is what little I do know regarding my problem:
----------------------------------------------------------------------
*I know where Character Menu Commands are located in the ROM and which addresses apply to which characters.  So giving a character the actual "Black", "White", etc. commands, I can do.
*I know where Spells Learned data is kept (like when Cecil learns the Sight spell at level 3, that's "03 17" at the start of that section of the ROM) and what most of the numbers themselves mean (using "FF" or multiple "FF"s to segment the different characters' submenus).
*I know where the Starting Spells data is kept for characters like Tella and FuSoYa.
----------------------------------------------------------------------

These are the parts I couldn't find in JCE's documentation and don't know anything about:
--------------------------------------------------------------------------------------------------------------------
*The pointers (or whatever method the ROM uses) for the different magic menus for each character.  As an example: I could give Kain the !Black command, but it'll be completely empty, and I have no idea how to get spells in there via the ROM (actually I'm not even sure if there are GG codes for that).
*How the Spells Learned and Starting Spells data is read while the game is playing.  For example, if I paste either set of data from the original Japanese version to the American 1.1 ROM, the data is used properly (so Rosa will learn Dspel, Armor and Shell normally through levelling up, something that doesn't happen in the American ROM).  But, if I write in my own series of Spells Learned data, while starting from the same point in the ROM and using the exact same sequence of "FF" breaks, the characters won't learn any spells through levelling up -at all-.
--------------------------------------------------------------------------------------------------------------------

I guess my question consists of this: Is this a simple manner of finding a table with pointers, that I can then reassign after finding it, or do the magic menus in FF4j use routines to determine how spells are learned/kept for each character that would require knowledge of ASM to rewrite?  I'm hoping it's the former, as my knowledge of assembly hacking is zero Sad .  I've considered doing a sprite swap for Rydia, but I'd rather avoid that if possible.  Thanks for any advice in advance.
Phoenix Hacks
Guest
« Reply #1 on: March 03, 2008, 05:35:18 pm »

I've successfully given magic to a non-magic user in FF2us, so it should work the same for FF4j. The info I think you're missing is the magic list number to battle command/learning link. For FF2us, this data is located from 9FFDD to A000C (offsets in a headered ROM). The data is 3 bytes per character, corresponding to the character's top list, middle list, and bottom list (White Magic is always the top list, Black the middle list, and Call the bottom list, except for Edge whose middle list is Ninja). If the data is not located there, you can search for this data (it's the hex dump for the FF2us data):

FFFFFFFFFFFF0203040506FFFFFFFF07FFFFFFFFFFFF08FF09FFFF00FFFFFFFFFFFF0304FF0CFF0A0BFF0A0BFFFFFFFF

However, be aware that this doesn't change the menu behavior while you're out of battle. I was trying something similar, and it took me forever to find it, but I finally found the data: it's from A81A2 to A81CB. It follows the same data format as above (3 bytes per characters: top list, middle list, bottom list). So, to give Kain black magic, you'll give him the Black command (as you've done), then change the second set of FFFFFF's into FF01FF in both areas I've mentioned. You'll need to use 01 because that's the only unused magic list number. The others are:

00 Cecil (White)
01 ?
02 Rydia (White)
03 Rydia (Black)
04 Rydia (Call)
05 Tellah (White)
06 Tellah (Black)
07 Rosa (White)
08 Palom (Black)
09 Porom (White)
0A FuSoYa (White)
0B FuSoYa (Black)
0C Edge (Ninja)

I haven't tried values above 0C, so I don't know if they work. As for the characters' initial spells and spells learned data: the initial spells are only added to characters' lists at the very beginning of the game. So if you change that data, you'll need to start a new game to see the changes. You have the data for the spells learned correct (2 bytes, first level then spell), but I think the problem is that you're not separating them correctly. Each FF signifies the end of the spells learned for that magic list. So if there's two FFs, it's the end of two spell lists. This data (7C900 to 7CABF in the US ROM) is:

0317080D0F0F13161812FFFF030E04170701FF0220052308290A1C0C1B0D190F2C141A1A261F2E232D2622281F2A252C282E2A3027312B32303C2FFFFFFFFF
0B130D0F0F0212121409170418031C101D151E082018220A26112A14300BFF0B210B1A0C1E0D240E2C1326161917281A2D1D1B2022211F2225242A282E2E
2B3027322F3430FF0B130D0F0F02120913161412170419031F152110260828182C0A3011340B3814FFFFFF1B4621452647FF

That means it separates into this:

00: 0317080D0F0F13161812FF
01: FF
02: 030E04170701FF
03: 0220052308290A1C0C1B0D190F2C141A1A261F2E232D2622281F2A252C282E2A3027312B32303C2FFF
04: FF
05: FF
06: FF
07: 0B130D0F0F0212121409170418031C101D151E082018220A26112A14300BFF
08: 0B210B1A0C1E0D240E2C1326161917281A2D1D1B2022211F2225242A282E2E2B3027322F3430FF
09: 0B130D0F0F02120913161412170419031F152110260828182C0A3011340B3814FF
0A: FF
0B: FF
0C: 1B4621452647FF

To change it just add the spells you want and put FF after the end, keeping the rest of the data after that the same. There's plenty of blank of space after this data, so you can extend it without a problem.

Hope this answers all your questions! You can also visit http://slickproductions.org/forum/index.php?board=13.0 for more in-depth info on FF4.
Edea
Guest
« Reply #2 on: March 03, 2008, 07:06:52 pm »

WOW, thanks for the fast reply!  That helps a LOT.  Going to try all this out ASAP :DDD.  I was so worried I wouldn't be able to handle it.

Durrrr, the varying number of FFs just indicated empty/pre-learned spell lists.  No wonder it was screwing up  Embarrassed

EDIT:  Kain's hands look so weird when he's casting a spell, lol.
« Last Edit: March 04, 2008, 02:03:31 am by Edea »
Pages: [1]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC