Help:Text modding: Difference between revisions

→‎Icons: Remove zr as it's not recognized by any libraries
m (→‎Choices: Tweaks to variable_kind control and choice control's unknown value.)
(→‎Icons: Remove zr as it's not recognized by any libraries)
 
(12 intermediate revisions by 3 users not shown)
Line 8: Line 8:


==Accessing the files==
==Accessing the files==
All text in the game is located inside the <code>content/Pack/Bootup_xxXX.pack</code> files in what are called [[message archives]]. The <code>xxXX</code> is the locale of the message contents. If you want your mod to support multiple locales, you'll need to make your text changes in every locale file you want to support.
All text in the game is located inside the <code>content/Pack/Bootup_XXxx.pack</code> files in what are called [[message archives]]. The <code>XXxx</code> is the locale of the message contents, for example <code>EUen</code> for European English or <code>USes</code> for American Spanish. If you want your mod to support multiple locales, you'll need to make your text changes in every locale file you want to support.


Copy the message pack(s) you want to edit into your mod folder, then either open them with Wild Bits or unbuild your mod folder with Hyrule Builder. (If you use the latter, the new location of the message pack(s) will be <code>content/Message</code>.)
Copy the message pack(s) you want to edit into your mod folder, then either open them with Wild Bits or unbuild your mod folder with Hyrule Builder. (If you use the latter, the new location of the message pack(s) will be <code>content/Message</code>.)
Line 56: Line 56:


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, read about [[#Icons|the icon system]].


===Control nodes===
===Control nodes===
Line 85: Line 87:
           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 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 98: Line 131:
           kind: pause
           kind: pause
           frames: 30
           frames: 30
</syntaxhighlight>It has not been tested if this assumes a 30FPS frame rate.
</syntaxhighlight>This assumes a 30FPS frame rate. However, frame rate mods should correctly convert your actual frame rate to 30, so a <code>frames</code> value of 30 should always correspond to 1 second, unless your game is lagging.


A common use of pauses is to break up sentences auditorily, like one would when speaking in real life. <code>short</code> is typically used after regular sentences while <code>long</code> and <code>longer</code> are used after exclamations, questions, and ponderings. The specific duration depends on the desired emphasis for the preceding sentence.
A common use of pauses is to break up sentences auditorily, like one would when speaking in real life. <code>short</code> is typically used after regular sentences while <code>long</code> and <code>longer</code> are used after exclamations, questions, and ponderings. The specific duration you should use depends on how much you want to emphasize the preceding sentence.


====Size====
====Size====
Line 117: Line 150:
           variable_kind: 19
           variable_kind: 19
           name: Gerudo_CarryIce_s
           name: Gerudo_CarryIce_s
</syntaxhighlight>The purpose of <code>variable_kind</code> refers to the kind of Game Flag that is referenced (this includes strings, int and float values).
</syntaxhighlight>The value of <code>variable_kind</code> is the type of Game Flag that is referenced (this includes strings, int and float values). Refer to existing in-game implementations of variables to determine how to use them in your dialogue.


The value of <code>name</code> is the name of the variable to insert.
The value of <code>name</code> is the name of the variable to insert.


Refer to existing in-game implementations of variables to determine how to use them in your dialogue. Usage of variables requires the associated event to be configured to set them.
Usage of variables requires the associated event flow to be configured to set them. Refer to existing in-game event flows that deal with variables.


===Dialogue-only control nodes===
===Dialogue-only control nodes===
Line 137: Line 170:
           kind: auto_advance
           kind: auto_advance
           frames: 101
           frames: 101
</syntaxhighlight>The value of <code>frames</code> is the number of frames to wait before auto-advancing. It has not been tested if this assumes a 30FPS frame rate.
</syntaxhighlight>The value of <code>frames</code> is the number of frames to wait before auto-advancing. This assumes a 30FPS frame rate. However, frame rate mods should correctly convert your actual frame rate to 30, so a <code>frames</code> value of 30 should always correspond to 1 second, unless your game is lagging.


====Choices====
====Choices====
Line 155: Line 188:
           kind: single_choice
           kind: single_choice
           label: 9
           label: 9
</syntaxhighlight>The text for dialogue choices is not defined directly. It must be defined in keys whose identifiers are four-digit numbers surrounded by double-quotes. (e.g. <code>"0009"</code>, which corresponds with the <code>9</code> under <code>choice_labels</code>)
</syntaxhighlight>The text for dialogue choices is not defined directly. It must be defined in keys whose identifiers are four-digit numbers surrounded by double-quotes. (e.g. <code>"0009"</code>, which corresponds with the <code>9</code> under <code>choice_labels</code>) Nintendo's internal MSBT library converts the u16 labels to %04d-formatted strings for accessing the choice text.


The value of <code>selected_index</code> is the choice that is selected by default when the choice selector appears, based off of a zero-indexed list (where 0 is first, 1 is second, 2 is third, and 3 is fourth) of the <code>choice_labels</code>. It does '''not''' refer to choices with the same number system as labels. For example, trying to put <code>9</code> as the value of <code>selected_index</code> in the example above would not work because the list is only four items long; in that case, you would want to put <code>0</code>. From a game design standpoint, this should usually refer to the first choice, <code>0</code>.
Because the MSBT library used by Wild Bits and Hyrule Builder is out of date, the existence of <code>selected_index</code> is, as far as is currently known, an error. Always make sure <code>selected_index</code> is 0. It does not correspond to any valid part of the Choice control's binary layout, so any other value will produce unintended results. The parameter is believed to have been a misunderstanding made by the original reverse engineer, in that all Choice controls come at the end of a dialogue line, and therefore end with <code>0x0000</code>, a "null character" which tells the game that the string has ended. It could also be a Nintendo internal library inconsistency between BotW and other games.


The value of <code>cancel_index</code> is the choice that is selected when the player presses the B button. It refers to the same zero-indexed list as <code>selected_index</code>. From a game design standpoint, this should usually refer to the last choice.
The value of <code>cancel_index</code> is the choice that is selected when the player presses the B button. It refers to the <code>choice_labels</code> as a zero-indexed list, i.e. the first label is 0, second is 1, third is 2, and fourth is 3. From a game design standpoint, this should usually refer to the last choice.


As implied by its name, the purpose of <code>unknown</code> is not understood. It has been observed that in instances where dialogue choices only include two options, the unknown field is set to <code>6</code>. Similarly for cases where there are 3 or 4 options the values <code>8</code> and <code>10</code> are used respectively.
The <code>unknown</code> code field's purpose is the total byte size of the parameters. There is one parameter per choice plus the <code>cancel_index</code>, and each of those is 2 bytes long, so it should always be 6 for a two-choice, 8 for a three-choice, and 10 for a four-choice control.


To implement branching-path dialogue with this control node, the associated event flow must have the switch-type event <code>EventSystemActor::GeneralChoiceX</code>, where <code>X</code> is the number of choices available.
To implement branching-path dialogue with this control node, the associated event flow must have the switch-type event <code>EventSystemActor::GeneralChoiceX</code>, where <code>X</code> is the number of choices available.
Line 176: Line 209:
|+
|+
!
!
!Facial Emotion
!Emotion
!Sound
!Sound
|-
|-
Line 227: Line 260:
|Yes
|Yes
|}
|}
There is also a <code>sound2</code> control node. It is unknown how this differs from the <code>sound</code> control node.
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.)


==Saving the files==
==Saving the files==
Line 238: Line 271:
==References==
==References==
<references />
<references />
[[Category:Guides]]
autopatrol, editnews
151

edits