Help:Text modding: Difference between revisions

m Add special character info
Ginger (talk | contribs)
m Turned Raw into a page section, giving it a ToC entry
 
(7 intermediate revisions by 4 users not shown)
Line 13: Line 13:


Read about [[message archives]] for more information on what the subfolders are for.
Read about [[message archives]] for more information on what the subfolders are for.
==== MSYT ====
MSYT is community-driven code library for reading the MSBT format.
MSBT is Message Studio Binary Text, or "a binary representation of text as used by Message Studio." (which is a Nintendo tool)
MSYT is Message Studio YAML Text, or "a YAML representation of Message Studio Binary Text." (since Message Studio doesn't actually use MSYT)


==Editing the files==
==Editing the files==
Line 57: Line 64:
When putting spaces or line breaks at the beginning or end of a text node, the entire value of the node must be surrounded by unescaped double-quotes.<ref>https://github.com/polarbunny/msyt-tools/blob/master/docs/notes.txt#L98</ref>
When putting spaces or line breaks at the beginning or end of a text node, the entire value of the node must be surrounded by unescaped double-quotes.<ref>https://github.com/polarbunny/msyt-tools/blob/master/docs/notes.txt#L98</ref>


The font used in the game supports a number of special characters, including <code>♪</code>. For special characters not listed here, such as controller buttons, see [[#Icons|Icons]].
The font used in the game supports a number of special characters, including <code>♪</code>. For special characters not listed here, such as controller buttons, read about [[#Icons|the icon system]].


===Control nodes===
===Control nodes===
Line 87: Line 94:
           kind: icon
           kind: icon
           icon: y
           icon: y
</syntaxhighlight>The value of <code>icon</code> is the name of the icon to show. Options include arrows (<code>right_arrow</code>, <code>left_arrow</code>, <code>up_arrow</code>) and controller-related images (<code>gamepad</code>, <code>a</code>, <code>b</code>, <code>x</code>, <code>y</code>, <code>l</code>, <code>r</code>, <code>zl</code>, <code>zr</code>, <code>l_stick_press</code>, <code>l_stick_forward</code>, <code>l_stick_back</code>, <code>r_stick_press</code>, <code>d_pad_down</code>, <code>d_pad_left</code>, <code>d_pad_up</code>, <code>d_pad_right</code>, <code>plus</code>, <code>minus</code>).<ref>https://github.com/polarbunny/msyt-tools/blob/master/docs/notes.txt#L47</ref>
</syntaxhighlight>The value of <code>icon</code> is the name of the icon to show. The following is an exhaustive list of valid vanilla options:<ref>https://github.com/ascclemens/msyt/blob/master/src/botw/mod.rs#L453</ref>
* <code>right_arrow</code>
* <code>left_arrow</code>
* <code>up_arrow</code>
* <code>gamepad</code>
* <code>a: 10</code>
* <code>a: 11</code>
* <code>b</code>
* <code>x: 12</code>
* <code>x: 37</code>
* <code>x: 38</code>
* <code>y</code>
* <code>l</code>
* <code>r</code>
* <code>zl: 14</code>
* <code>zl: 15</code>
* <code>l_stick_press</code>
* <code>l_stick_forward</code>
* <code>l_stick_back</code>
* <code>r_stick_press</code>
* <code>d_pad_down</code>
* <code>d_pad_left</code>
* <code>d_pad_up</code>
* <code>d_pad_right</code>
* <code>plus</code>
* <code>minus</code>
* <code>l_stick_left</code>
* <code>l_stick_right</code>
* <code>r_stick_vertical</code>
* <code>r_stick_horizontal</code>


Note that some "icons" are actually available as [[#Text_nodes|standard characters]].
Note that some any icon that has a number has multiple images, and the number determines which image is used. Also, some "icons" are actually available as [[#Text_nodes|standard characters]].


====Pausing====
====Pausing====
Line 232: Line 268:
|}
|}
There is also a <code>sound2</code> control node. It is unknown how this differs from the <code>sound</code> control node, aside from it only having 1 parameter and being terminated with a <code>0xCD</code> byte (which is represented in MSYT by a <code>205</code> entry.)
There is also a <code>sound2</code> control node. It is unknown how this differs from the <code>sound</code> control node, aside from it only having 1 parameter and being terminated with a <code>0xCD</code> byte (which is represented in MSYT by a <code>205</code> entry.)
====Raw====
Raw controls are those which MSYT doesn't have the knowledge to convert to something human-readable. In essence, a Raw control is a collection of raw binary data that has not been meaningfully converted to a different format. Instead, the original bytes are collected into the Raw control, allowing you to edit them directly, if you understand the format.
This is, understandably, unlikely, and in most cases you shouldn't bother trying to edit a Raw control.
In the time since MSYT was last updated, more progress has been made on reverse engineering the format, so we now understand more about the structure. For example, the following code snippet...<syntaxhighlight lang="yaml">
      - control:
          kind: raw
          two_hundred_one:
            dynamic:
              - 0
              - len: 4
                field_2:
                  - 2
                  - 1
                  - 1
                  - 0
</syntaxhighlight>...can be explained as follows:
<code>two_hundred_one</code>: The text form of the number 201, whose binary form (<code>0x00C9</code>) is what MSBT uses to represent the GrammarTag<ref>https://github.com/GingerAvalanche/MsbtLib/blob/master/MSBT/Controls/GrammarTag.cs</ref> structure (which is a "TagGroup").
<code>dynamic</code>: The amount of data in a 201 (GrammarTag) can change, depending on which specific Tag is used.
<code>- 0</code>: The number directly under the "dynamic" (the 0, in this case) is the actual Tag. In the case of GrammarTag, the 0 Tag is Info<ref>https://github.com/GingerAvalanche/MsbtLib/blob/master/MSBT/Controls/GrammarTags/Info.cs</ref>. An Info Tag contains 4 bytes, as can be seen by the 4 values inside <code>field_2</code>. (In the binary, the Info Tag - and all tags - are terminated by the <code>0xCD</code> byte, as mentioned earlier, so that byte is not represented in a Raw control)
The missing formats that have been implemented in MSYT (and, by extension, WildBits and Hyrule Builder) as Raw controls are now understood (at least, their data layout is - not all of what they are used for is understood) and can be found by looking through [https://github.com/GingerAvalanche/MsbtLib/tree/master/MSBT/Controls the Control namespace in MsbtLib]. (MsbtLib is a different library that converts controls into inlined XML-like tags, and was used in the creation of a different tool that is, as of yet, unfinished, and as such, MsbtLib and that other tool are outside the scope of this article, except for the documentation they provide on the MSBT format)


==Saving the files==
==Saving the files==
Line 242: Line 307:
==References==
==References==
<references />
<references />
[[Category:Guides]]