Help:Text modding: Difference between revisions

Choice node fix, misc clarifications
m (→‎Choices: Tweaks to variable_kind control and choice control's unknown value.)
(Choice node fix, misc clarifications)
Line 98: Line 98:
           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 depends on the desired emphasis for the preceding sentence.
Line 137: Line 137:
           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 155:
           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>Nintendo's internal MSBT library converts the u16 labels to %04d-formatted strings for accessing the choice text. (e.g. label 9 corresponds to the key <code>"0009"</code>)


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>.
The MSBT library used by WildBits is out of date, and has slight errors.
 
The value of <code>selected_index</code> is, as far as is currently known, an error. It does not correspond to any valid part of the Choice control's binary layout. It 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 same zero-indexed list as <code>selected_index</code>. 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. A single_choice control does not contain a <code>cancel_index</code>, however, it does always contain a <code>0x01CD</code> at the end, so its parameter size is 4.


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 227: Line 229:
|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.


==Saving the files==
==Saving the files==
autopatrol, editnews
201

edits