Users browsing this thread: 1 Guest(s)
Script Rewrite (Final Draft) Underway!

#20
Posts: 86
Threads: 6
Thanks Received: 14
Thanks Given: 2
Joined: Jul 2020
Reputation: 8
Status
None
(03-09-2023, 01:39 AM)Joshua H. Wrote: Welp, I've hit a major roadblock in the patch.  The changes I've made to the game hold up fine until Setzer hands control of the Blackjack over to the player.

What issue are you running into?

There is a bug with FF3usME's dialogue editor where lines will get messed up sometimes if the index that separates banks $CD and $CE changes and you edit lines on either side of it before saving.

I don't know how familiar you are with how the dialogue is encoded and extracted, but the dialogue text spans two banks in the ROM: $CD and $CE.  The dialogue indices map to pointers that contain the two-byte address offset from either $CD or $CE where the line starts.  There's also a single "pivot" entry for the value of the dialogue index where the text transitions from bank $CD to $CE so it calculates the offset against the correct bank.  In the vanilla ROM, this dialogue index is $0626, which is around the Cave to the Sealed Gate point of the game (though if you've been going through the dialogue, you've noticed it's not entirely sequential). So it's basically: "if dialogue_index < $0626, dialogue_text = $CD + dialogue_index.address_pointer, else dialogue_text = $CE + dialogue_index.address_pointer".

When editing dialogue in FF3usME, any time the length of a line of dialogue is changed, it shifts the positions of every line that comes after it, and their pointer values have to be updated accordingly.  If the line you're editing is before $0626, that means that the lines that cross the $CD/$CE boundary are shifting, and the "pivot" index needs to be updated accordingly.  There's a bug in FF3usME where this isn't always properly calculated, causing the lines around that "pivot" point to be messed up.

Note that in the vanilla ROM, the dialogue wasn't as efficiently compressed as it could have been, so simply opening the ROM in FF3usME and then re-saving it, thereby re-compressing the dialogue, will shift everything, anyway, making $0626 no longer the pivot point, and will free up a bunch of text space without even doing anything.

If you want to check if this is your problem, open the ROM in a hex editor and check what the two bytes at $CCE600 are, as this is where the "pivot" index value is saved (with the bytes reversed, so $0626 looks like 26 06).  Then go and cross reference that dialogue index with your script and see if it's at or around the same place where you're seeing issues.

If this is your problem, I think you can fix it by simply re-importing your text export of the dialogue script and re-saving it.

(03-09-2023, 04:03 PM)Joshua H. Wrote: Yes, I’m removing the dialog captions from the event code.  That way they aren’t even being displayed.

Are you removing the dialogue captions from the event code manually via a hex editor or through a tool?  Because depending on how the caption was encoded, some of them need more done than simply removing the event that calls the dialogue box.

If it's just a regular dialogue caption called with event code $4B, these are generally safe to NOP out since they don't have any dependencies.

Some dialogue captions are called with event code $48.  These are for cases where there's something that needs to happen before you can dismiss the dialogue box, and there will be a separate event code called later, $49, to flag when it will allow you to dismiss it.  If you remove a $48 dialogue box, you need to remove the paired $49 later in the code, too, or it's not going to know what to do when it gets there.

But if it's messing up with Setzer handing over the airship, what I suspect has happened is that you deleted a dialogue box that has options in it like, "Do you want me to teach you some tricks?  Y/N".  Dialogue boxes with options in them are always going to be followed by a $B6 command with the address offsets for the events triggered by each selection.  This $B6 command needs to be removed, too, since it can't exist in a void with no dialogue selection made.
  Find
Quote  



Messages In This Thread
RE: Script Rewrite (Final Draft) Underway! - by Fast Moon - 03-09-2023, 09:13 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite