Dynamic Values¶
There are times where a dialogue text must contain some sort of variable value. For example, displaying the player's name that has previously been prompted.
Dynamic Values allow to replace special symbols on the text with values that come from more dynamic sources, such as Local Variables, Stats, etc...
There are two types of dynamic values: Local and Global ones.
Local Dynamic Values¶
Local dynamic values are set up inside the Dialogue component, right under the Text field of a node.
Each value is assigned an index value, starting from 0 at the top. Using the index number between curly braces {
and }
.
Player Name
In the screenshot above, the text {0}
will be replaced by the Global Variable value called name
.
A Local dynamic value can also have a specific color assigned to it, appear in bold and/or in italic characters.
Global Dynamic Values¶
Global dynamic values are very similar to the local ones, but their scope is project-wide, so they only need to be set up once. In the previous example, in order to display the player's name, we'd need to configure a Local dynamic value for each dialogue line that displays the player's name.
Instead, it's much more efficient to define a global value that any Dialogue can make use of.
To edit or create Global dynamic values, click on the top toolbar's Game Creator button and navigate to Settings. Click on the Dialogue tab and a list of all created values will appear, with a button to add new ones.
Global dynamic values have an extra field called Key, which is the unique ID assigned to that particular value.
In order to use a Global dynamic value, one must type the Key value between brackets. For example, if the key value is "player-name", the symbol that replaces itself with the Global dynamic value is {player-name}
.
Global dynamic values also allow to specify whether the replaced text should be printed in Bold, Italic and/or in a specific color.