Find using table... (command Search/Find using table...)
Translhextion can use standard Thingy Tables to find encoded text
in a file. In the dialog you can choose whether you want to
"Optimize" the bytes of the find string (see below) and
you can select the search direction.
NOTE: Because of the nature of Thingy Tables, all searches using
tables are CASE SENSITIVE.
What is the difference between enabling and disabling "Optimize
bytes"?
The answer to this question requires a good understanding of
Thingy tables and DTE (Dual Tile Encoding). You may also want to
read about MTE (Multiple Tile Encoding). The answer, in short, is
as follows:
NOTE: In the following explanation, where braces ' { ' and ' } '
are used they represent the default value of the separated-byte
left enclosure & right enclosure characters which can be
specified in Options/Preferences... You must use the characters
specified in this setting while using any table-related command!
"Optimize bytes" disabled:
The search string is parsed through the Thingy table with each
byte translated literally. Each character literal is translated
into its equivalent character literal in the table without
considering DTE, MTE, or multi-byte values and each byte literal
of the form {XX} is translated into it's equivalent multi-character-byte
literal using DTE and MTE.
Example:
If I want to search for "Crystal" in Final Fantasy 2 (US),
it happens to be encoded in two forms, the first with all
character literals (7-bytes) and the second using DTE (4-bytes).
As you can see, byte-literals must be used to find the DTE
version of "Crystal".
FIND STRING |
STRING FOUND |
BYTES |
Crystal |
"Crystal" |
7-bytes |
C{ry}{st}{al} |
"Crystal" |
4-bytes |
If, however, I want to search for "Crew" instead, it
cannot be found using this setting without typing in byte-literals
because the only encoding of it uses DTE (3-bytes).
FIND STRING |
STRING FOUND |
BYTES |
Crew |
N/A |
0-bytes |
C{re}w |
"Crew" |
3-bytes |
Finally, if I want to find an MTE value such as "Cecil"
I MUST enter the byte-literal to find it.
FIND STRING |
STRING FOUND |
BYTES |
Cecil |
N/A |
0-bytes |
{Cecil} |
"Cecil" |
2-bytes |
"Optimize bytes" enabled:
The search string is parsed through the Thingy table and DTE, MTE,
& multi-byte replacements are made where possible. DTE, MTE,
& multi-byte byte-literals CAN still be used if desired.
Example:
If I want to search for "Crystal" in Final Fantasy 2 (US),
it happens to be encoded in two forms, the first with all
character literals (7-bytes) and the second using DTE (4-bytes).
In this case, the DTE version is found with or without typing in
byte-literals.
FIND STRING |
STRING FOUND |
BYTES |
Crystal |
"Crystal" |
4-bytes |
C{ry}{st}{al} |
"Crystal" |
4-bytes |
*NOTE: This setting CANNOT be used to find the 7-byte version of
"Crystal" at all which is why the other setting is
available.
If, however, I want to search for "Crew" (DTE, 3-bytes)
instead, it be found with or without typing in byte-literals
using this setting.
FIND STRING |
STRING FOUND |
BYTES |
Crew |
"Crew" |
3-bytes |
C{re}w |
"Crew" |
3-bytes |
Finally, if I want to find an MTE value such as "Cecil"
I can enter the byte-literal to find it or I can just search for
the string itself.
FIND STRING |
STRING FOUND |
BYTES |
Cecil |
"Cecil" |
2-bytes |
{Cecil} |
"Cecil" |
2-bytes |
The reason "Optimize bytes" is recommended is because *MOST*
game data is usually optimized using DTE, MTE, & multi-byte
values if they are present at all. This means that most of the
time you are looking for a string that is fewer bytes than the
number of characters you typed. The only time this setting isn't
useful is when the string you are searching for COULD have used
DTE, MTE, or a multi-byte value but didn't.