Jump to content

Another Text Parser


Crazycolorz5
 Share

Recommended Posts

Because sometimes FEditor just curbstomps your rom

I made an executable parser based on anti-huffman encoding. Needless to say, this method of text insertion requires the anti-huffman patch. This patch is auto-applied if you have opened and saved your ROM in FEditor. (If you'd rather not have FEditor touch your ROM at all, an EA installer for the Anti-Huffman Patch, based on the FEditor version, is here: http://feuniverse.us/t/fe7-fe8-anti-huffman-patch-ea-style/1703)

Here's the link: FEU Another Text Parser Thread

The usage is by basically making a file with the formatted text, then opening it with the parser. You can also parse a whole folder of text at once. It'll generate a .dmp file and you can insert that in the ROM and point to it, anti-huffman style (anyone got anti-huffman tutorials still lying around?).

There's also an executable for parsing all text files in a directory/subdirectories. The newest version also allows declaration of your own directives, such as:

(in definitions file:)


[LoadEirikaPortrait] = [LoadPortrait][0x02][0x01]

(in text file:)

[OpenLeft][LoadEirikaPortait]Eirika says hi![A][X]

Another example input:

[OpenRight][LoadPortrait][0x01][0x01]
[OpenLeft][LoadPortrait][0x02][0x02]
[OpenRight]
Eliwood, let me tell you[NL]
about a lost art.[A]
[OpenLeft]
What is it, o wise[NL]
question-mark man?[A]
[OpenRight]
Once upon a time, before the[NL]
time of FEditor, we did text[A][NL]
a different way. The anti-[NL]
huffman way. This involved[A][NL]
hex editing. In fact, FEditor[NL]
only automates this method.[A][NL]
[OpenLeft]
I see. Why are you telling me this?[A]
[OpenRight]
Since it's what FEditor is based on,[NL]
people should know how it works.[A][NL]
That way new ways of editing text[NL]
based on it can be created.[A][NL]
For example, imagine if we could[NL]
insert text through EA...[A][NL]
[OpenLeft]
That sounds like a[NL]
useful option to have.[A]
[OpenRight]
By the way, there are bandits[NL]
behind you, Eliwood.[A]
[OpenLeft][MoveLeft]
Ahh![A]
[ClearFace]
[OpenRight]
Bye![A]
[ClearFace][X]

And this is the hex output:

0B 10 01 01 0A 10 02 02 0B 45 6C 69 77 6F 6F 64 2C 20 6C 65 74 20 6D 65 20 74 65 6C 6C 20 79 6F 75 01 61 62 6F 75 74 20 61 20 6C 6F 73 74 20 61 72 74 2E 03 0A 57 68 61 74 20 69 73 20 69 74 2C 20 6F 20 77 69 73 65 01 71 75 65 73 74 69 6F 6E 2D 6D 61 72 6B 20 6D 61 6E 3F 03 0B 4F 6E 63 65 20 75 70 6F 6E 20 61 20 74 69 6D 65 2C 20 62 65 66 6F 72 65 20 74 68 65 01 74 69 6D 65 20 6F 66 20 46 45 64 69 74 6F 72 2C 20 77 65 20 64 69 64 20 74 65 78 74 03 01 61 20 64 69 66 66 65 72 65 6E 74 20 77 61 79 2E 20 54 68 65 20 61 6E 74 69 2D 01 68 75 66 66 6D 61 6E 20 77 61 79 2E 20 54 68 69 73 20 69 6E 76 6F 6C 76 65 64 03 01 68 65 78 20 65 64 69 74 69 6E 67 2E 20 49 6E 20 66 61 63 74 2C 20 46 45 64 69 74 6F 72 01 6F 6E 6C 79 20 61 75 74 6F 6D 61 74 65 73 20 74 68 69 73 20 6D 65 74 68 6F 64 2E 03 01 0A 49 20 73 65 65 2E 20 57 68 79 20 61 72 65 20 79 6F 75 20 74 65 6C 6C 69 6E 67 20 6D 65 20 74 68 69 73 3F 03 0B 53 69 6E 63 65 20 69 74 27 73 20 77 68 61 74 20 46 45 64 69 74 6F 72 20 69 73 20 62 61 73 65 64 20 6F 6E 2C 01 70 65 6F 70 6C 65 20 73 68 6F 75 6C 64 20 6B 6E 6F 77 20 68 6F 77 20 69 74 20 77 6F 72 6B 73 2E 03 01 54 68 61 74 20 77 61 79 20 6E 65 77 20 77 61 79 73 20 6F 66 20 65 64 69 74 69 6E 67 20 74 65 78 74 01 62 61 73 65 64 20 6F 6E 20 69 74 20 63 61 6E 20 62 65 20 63 72 65 61 74 65 64 2E 03 01 46 6F 72 20 65 78 61 6D 70 6C 65 2C 20 69 6D 61 67 69 6E 65 20 69 66 20 77 65 20 63 6F 75 6C 64 01 69 6E 73 65 72 74 20 74 65 78 74 20 74 68 72 6F 75 67 68 20 45 41 2E 2E 2E 03 01 0A 54 68 61 74 20 73 6F 75 6E 64 73 20 6C 69 6B 65 20 61 01 75 73 65 66 75 6C 20 6F 70 74 69 6F 6E 20 74 6F 20 68 61 76 65 2E 03 0B 42 79 20 74 68 65 20 77 61 79 2C 20 74 68 65 72 65 20 61 72 65 20 62 61 6E 64 69 74 73 01 62 65 68 69 6E 64 20 79 6F 75 2C 20 45 6C 69 77 6F 6F 64 2E 03 0A 80 0C 41 68 68 21 03 11 0B 42 79 65 21 03 11 00

This can then be pasted somewhere in the ROM, and a text table entry can be repointed to it (add 0x80000000 to the pointer to tell the engine that it's anti-huffman'd). This process can be automated by EA, keep an eye out for a tutorial on that soon!

Edited by Crazycolorz5
Link to comment
Share on other sites

  • 5 weeks later...

Bumping to say that I've released ParseFolder, which simplifies the process of parsing a lot of text files at once or updating texts. You can store all text used by your hack in one directory and make direct edits to the script and the only step between insertion is running ParseFolder then using EA to rebuild the ROM.

This version also allows definitions, as the OP is updated to show.

Link to comment
Share on other sites

People in the FEU discord really seemed to like these definitions so I'll share them:

Definitions file (at least, the relevant ones):

[Load?Portrait] = [LoadPortrait][0x01][0x01]
[LoadEliwoodPortrait] = [LoadPortrait][0x02][0x01]

[<-......] = [OpenFarFarLeft]
[<-] = [OpenFarFarLeft]
[v.....] = [OpenFarLeft]
[.v....] = [OpenMidLeft]
[..v...] = [OpenLeft]
[...v..] = [OpenRight]
[....v.] = [OpenMidRight]
[.....v] = [OpenFarRight]
[......->] = [OpenFarFarRight]
[->] = [OpenFarFarRight]

[N] = [NL]
[AN] = [A][N]

Text file:

[...v..][Load?Portrait]
[..v...][LoadEliwoodPortrait]

[...v..]
Eliwood, let me tell you[N]
about a lost art.[A]

[..v...]
What is it, o wise[N]
question-mark man?[A]

[...v..]
Once upon a time, before the[N]
time of FEditor, we did text[AN]
a different way. The anti-[N]
huffman way. This involved[AN]
hex editing. In fact, FEditor[N]
only automates this method.[AN]

[..v...]
I see. Why are you telling me this?[A]

[...v..]
Since it's what FEditor is based on,[N]
people should know how it works.[AN]
That way new ways of editing text[N]
based on it can be created.[AN]
For example, imagine if we could[N]
insert text through EA...[AN]

[..v...]
That sounds like a[N]
useful option to have.[A]

[...v..]
By the way, there are bandits[N]
behind you, Eliwood.[A]

[..v...][MoveLeft]
Ahh![A]
[ClearFace]

[...v..]
Bye![A]
[ClearFace][X]

It gives a more visual representation of who's where, and imo, makes it easier to keep track of who's saying what.

I was also entertaining the idea of allowing for define/redefine directives, so we could say like

[OpenLeft][LoadEliwoodPortrait]
{Eliwood=OpenLeft}

{Eliwood}
Hello![A]
[MoveRight]{Eliwood=OpenRight}

{Eliwood}
Hello again![A][X]
Link to comment
Share on other sites

  • 4 weeks later...

Bumping to say I've updated to V1.0 (ParseFile) and V0.2 (ParseFolder) for compatibility with EA and #incext.

Updated to version ParseFile 1.0. This mostly makes its --to-stdout flag compatible with EA's #incext.

Updated to version ParseFolder 0.2. This fixes a few issues with folder traversal. Namely, if you recompile on a UNIX machine, it should work properly there now.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...