Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port over OoT's new text pipeline #1685

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

hensldm
Copy link
Collaborator

@hensldm hensldm commented Sep 7, 2024

Ported over OoT's newish msgdis.py and msgenc.py. The extracted data is much nicer imo with a new HEADER macro for the message headers, ability to use sfxIDs directly, decimal for timers, and imporved formatting.

Main differences in order to get it to work with MM are:

  1. Add the ability to decode message headers
  2. Add an additional encoding to msgenc/charmap for the credits as the newline character is different between the 2.
  3. Had to add an additional check for sfxIds since 5 messages seem to use ids that don't exist

One thing to note is I decided to follow OoT and not use the CMD prefix for message commands.

This also splits off text extraction out of extract_assets.py and just calls msgdis.py directly

Tested myself and everything seems to be working fine, including adding additional text. Additional testing would be appreciated though.
Note: their is no check anymore for if the data has already been extracted, so running the script will overwrite the message data (including anything added). This will be better when we switch to actually extracting assets to extracted.

Copy link
Contributor

@Thar0 Thar0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 things

Comment on lines +2589 to +2596
def format_sfx_id(self, c : int) -> str:
try:
if c & 0x800:
return sfx_ids[c & ~0x800]
else:
return f"{sfx_ids[c]} - SFX_FLAG"
except KeyError:
return f"0x{c:04X}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mentioned this case in the PR description, could you list the sfx ids that this applies to?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MessageID: SfxID
0x08E8: 0x2693
0x0963: 0x6394
0x0CEA: 0x3AE8
0x0CEF: 0x3AE8
0x0E14: 0x3AFD

tools/text/msgdis.py Outdated Show resolved Hide resolved
@AngheloAlf AngheloAlf removed the Needs-first-approval First approval label Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants