Help:Text modding: Difference between revisions

m
Citation fixes
(Complete text modding page)
m (Citation fixes)
Line 19: Line 19:
Message files use a key-value system, which marks different strings of text with a unique identifier. When creating new keys, the identifiers can be whatever you want, but ideally, you should make them easy to remember and be consistent. (e.g. Talk01, Talk02)
Message files use a key-value system, which marks different strings of text with a unique identifier. When creating new keys, the identifiers can be whatever you want, but ideally, you should make them easy to remember and be consistent. (e.g. Talk01, Talk02)


The <code>attributes</code> section, while not fully understood, seems to label the actor that is speaking the <code>contents</code> section.<ref>https://github.com/polarbunny/msyt-tools/blob/master/docs/notes.txt#L120</ref> It is unknown if this has any effect in-game.
The <code>attributes</code> section, while not fully understood, seems to label the actor that is speaking the <code>contents</code> section. It is unknown if this has any effect in-game.


In the game, the nodes within the <code>contents</code> section are played back top-to-bottom.
In the game, the nodes within the <code>contents</code> section are played back top-to-bottom.
Line 55: Line 55:
In YAML, line breaks and double-quotes have a special structural meaning, so they cannot be used directly in your text. Instead, <code>\n</code> (for line breaks) and <code>\"</code> (for double-quotes) must be used. This is called "escaping" the characters.
In YAML, line breaks and double-quotes have a special structural meaning, so they cannot be used directly in your text. Instead, <code>\n</code> (for line breaks) and <code>\"</code> (for double-quotes) must be used. This is called "escaping" the characters.


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.


===Control nodes===
===Control nodes===


==== Color<ref>https://github.com/polarbunny/msyt-tools/blob/master/docs/notes.txt#L62</ref> ====
====Color====
A color-type control node sets the color that the text is displayed in. (Note the British-English spelling of the value of <code>kind</code> -- "colour".)<syntaxhighlight lang="yaml">
A color-type control node sets the color that the text is displayed in. (Note the British-English spelling of the value of <code>kind</code> -- "colour".)<syntaxhighlight lang="yaml">
       - control:
       - control:
           kind: set_colour
           kind: set_colour
           colour: blue
           colour: blue
</syntaxhighlight>The value of <code>colour</code> is the name of the color to set: <code>blue</code>, <code>red</code>, <code>grey</code>, <code>light_green1</code>, <code>light_green4</code>, <code>light_grey</code>, <code>orange</code>
</syntaxhighlight>The value of <code>colour</code> is the name of the color to set: <code>blue</code>, <code>red</code>, <code>grey</code>, <code>light_green1</code>, <code>light_green4</code>, <code>light_grey</code>, or <code>orange</code>.


The color setting will remain in effect until it is changed again or when the end of the <code>contents</code> section is reached. To set the color back to white, use the <code>reset_colour</code> control node:<syntaxhighlight lang="yaml">
The color setting will remain in effect until it is changed again or when the end of the <code>contents</code> section is reached. To set the color back to white, use the <code>reset_colour</code> control node:<syntaxhighlight lang="yaml">
Line 71: Line 71:
</syntaxhighlight>From a game design standpoint, <code>blue</code> is used for the most important bits of information in a piece of dialogue. <code>red</code> is used when this pertains to the progression of a quest or when an irreversible action is about to occur, such as a purchase or exchange. <code>grey</code> is used when the NPC talking is supposed to sound quiet, often used in combination with a text size of <code>80</code>. In the unmodded game, the other colors are only used in the menus.
</syntaxhighlight>From a game design standpoint, <code>blue</code> is used for the most important bits of information in a piece of dialogue. <code>red</code> is used when this pertains to the progression of a quest or when an irreversible action is about to occur, such as a purchase or exchange. <code>grey</code> is used when the NPC talking is supposed to sound quiet, often used in combination with a text size of <code>80</code>. In the unmodded game, the other colors are only used in the menus.


==== Font<ref>https://github.com/polarbunny/msyt-tools/blob/master/docs/notes.txt#L43</ref> ====
====Font====
A font-type control node sets the font that the text is displayed in.<syntaxhighlight lang="yaml">
A font-type control node sets the font that the text is displayed in.<syntaxhighlight lang="yaml">
       - control:
       - control:
Line 80: Line 80:
The font setting will remain in effect until it is changed again or when the end of the <code>contents</code> section is reached.
The font setting will remain in effect until it is changed again or when the end of the <code>contents</code> section is reached.


==== Icons<ref>https://github.com/polarbunny/msyt-tools/blob/master/docs/notes.txt#L47</ref> ====
====Icons====
An icon-type control node displays the specified icon inline with the text.<syntaxhighlight lang="yaml">
An icon-type control node displays the specified icon inline with the text.<syntaxhighlight lang="yaml">
       - control:
       - control:
Line 87: Line 87:
</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>).
</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>).


==== Pausing<ref>https://github.com/polarbunny/msyt-tools/blob/master/docs/notes.txt#L54</ref> ====
====Pausing====
A pause-type control node "pauses" for a period of time before playing back the subsequent nodes.<syntaxhighlight lang="yaml">
A pause-type control node "pauses" for a period of time before playing back the subsequent nodes.<syntaxhighlight lang="yaml">
       - control:
       - control:
Line 94: Line 94:
</syntaxhighlight>The value of <code>length</code> is how long to pause for: <code>short</code>, <code>long</code>, or <code>longer</code>.
</syntaxhighlight>The value of <code>length</code> is how long to pause for: <code>short</code>, <code>long</code>, or <code>longer</code>.


The duration of a pause can also be specified in frames by using the <code>frames</code> parameter:<syntaxhighlight lang="yaml">
The duration of a pause can also be specified in frames by using the <code>frames</code> parameter:<ref>https://github.com/polarbunny/msyt-tools/blob/master/docs/notes.txt#L58</ref><syntaxhighlight lang="yaml">
       - control:
       - control:
           kind: pause
           kind: pause
Line 102: Line 102:
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 depends on the desired emphasis for the preceding sentence.


==== Size<ref>https://github.com/polarbunny/msyt-tools/blob/master/docs/notes.txt#L85</ref> ====
====Size====
A size-type control node sets the size that the text is displayed in:<syntaxhighlight lang="yaml">
A size-type control node sets the size that the text is displayed in:<syntaxhighlight lang="yaml">
       - control:
       - control:
Line 111: Line 111:
In the unmodded game, <code>80</code> is used for any small text, and <code>125</code> is used for any large text. Other values have not been tested for efficacy.
In the unmodded game, <code>80</code> is used for any small text, and <code>125</code> is used for any large text. Other values have not been tested for efficacy.


==== Variables<ref>https://github.com/polarbunny/msyt-tools/blob/master/docs/notes.txt#L89</ref> ====
====Variables====
A variable-type control node inserts the value of the specified game variable into the text. Examples include displaying the score of a minigame, showing the cost of the selected item, etc.<syntaxhighlight lang="yaml">
A variable-type control node inserts the value of the specified game variable into the text.<ref>https://github.com/polarbunny/msyt-tools/blob/master/docs/notes.txt#L89</ref> Examples include displaying the score of a minigame, showing the cost of the selected item, etc.<syntaxhighlight lang="yaml">
       - control:
       - control:
           kind: variable
           kind: variable
Line 123: Line 123:
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.
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.


=== Dialogue-only control nodes ===
===Dialogue-only control nodes===


==== Animations<ref>https://github.com/polarbunny/msyt-tools/blob/master/docs/notes.txt#L24</ref> ====
====Animations====
An animation-type control node plays an animation on the currently speaking NPC.<syntaxhighlight lang="yaml">
An animation-type control node plays an animation on the currently speaking NPC.<ref>https://github.com/polarbunny/msyt-tools/blob/master/docs/notes.txt#L24</ref><syntaxhighlight lang="yaml">
       - control:
       - control:
           kind: animation
           kind: animation
Line 132: Line 132:
</syntaxhighlight>The value of <code>name</code> refers to the name of an animation defined in the speaking NPC's <code>.bfres</code> file in <code>content/Model</code>. You can use [[Help:Tools/Switch Toolbox|Switch Toolbox]] to browse the available animations.
</syntaxhighlight>The value of <code>name</code> refers to the name of an animation defined in the speaking NPC's <code>.bfres</code> file in <code>content/Model</code>. You can use [[Help:Tools/Switch Toolbox|Switch Toolbox]] to browse the available animations.


==== Auto-advance<ref>https://github.com/polarbunny/msyt-tools/blob/master/docs/notes.txt#L28</ref> ====
====Auto-advance====
An auto-advance-type control node "automatically advances" to the next dialogue bubble (without player input) after a given period of time.<syntaxhighlight lang="yaml">
An auto-advance-type control node "automatically advances" to the next dialogue bubble (without player input) after a given period of time.<ref>https://github.com/polarbunny/msyt-tools/blob/master/docs/notes.txt#L28</ref><syntaxhighlight lang="yaml">
       - control:
       - control:
           kind: auto_advance
           kind: auto_advance
Line 139: Line 139:
</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. It has not been tested if this assumes a 30FPS frame rate.


==== Choices<ref>https://github.com/polarbunny/msyt-tools/blob/master/docs/notes.txt#L32</ref> ====
====Choices====
A choice-type control node presents one or more selectable dialogue choices for Link.<syntaxhighlight lang="yaml">
A choice-type control node presents one or more selectable dialogue choices for Link.<ref>https://github.com/polarbunny/msyt-tools/blob/master/docs/notes.txt#L32</ref><syntaxhighlight lang="yaml">
       - control:
       - control:
           kind: choice
           kind: choice
Line 151: Line 151:
           cancel_index: 3
           cancel_index: 3
           unknown: 8
           unknown: 8
</syntaxhighlight>If you only want to present one dialogue choice (to make NPC monologues more interactive) use the <code>single_choice</code> control node:<ref>https://github.com/polarbunny/msyt-tools/blob/master/docs/notes.txt#L69</ref><syntaxhighlight lang="yaml">
</syntaxhighlight>If you only want to present one dialogue choice (to make NPC monologues more interactive) use the <code>single_choice</code> control node:<syntaxhighlight lang="yaml">
       - control:
       - control:
           kind: single_choice
           kind: single_choice
Line 165: Line 165:
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.


==== Sounds ====
====Sounds====
A sound-type control node plays a sound effect from the currently speaking NPC.<syntaxhighlight lang="yaml">
A sound-type control node plays a sound effect from the currently speaking NPC.<syntaxhighlight lang="yaml">
       - control:
       - control:
Line 229: Line 229:
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.


== Saving the files ==
==Saving the files==
If you're using Wild Bits, make sure that you save every file you edit. However, this only "saves" to a temporary unsaved version of the message pack. When you're done, '''remember to save the entire pack''' in the SARC tab. Remember to update the mod in your mod-management software.
If you're using Wild Bits, make sure that you save every file you edit. However, this only "saves" to a temporary unsaved version of the message pack. When you're done, '''remember to save the entire pack''' in the SARC tab. Remember to update the mod in your mod-management software.


If you're using Hyrule Builder, simply ensure that your files are saved from the text editor. You'll need to create a new build of your mod folder every time you want to test changes to your mod. Remember to update the mod in your mod-management software.
If you're using Hyrule Builder, simply ensure that your files are saved from the text editor. You'll need to create a new build of your mod folder every time you want to test changes to your mod. Remember to update the mod in your mod-management software.


If you encounter issues, make sure that the indentation in your message files matches the examples in this guide. The YAML format is strict with this because the indentations have special structural meaning.<references />
If you encounter issues, make sure that the indentation in your message files matches the examples in this guide. The YAML format is strict with this because the indentations have special structural meaning.
 
== References ==
<references />
<references />