abstract
| - The above script is an example of a randomized dialogue script. In this example it would be assigned as a conditional script to the first of four dialogue nodes. The second dialogue node would be given a similar conditional script, but instead of the iResult = d100() <26; it would be: This tells D'Jinni to roll a 100 sided die when initiating the dialogue. If the result is <26, play that dialogue node. If the die result is >25, it moves on to the next dialogue, and rolls there. It's important to note that the scripts must be placed from least likely chance to most likely chance, top to bottom respectively, on the dialogue nodes in the .dlg. This is because D'Jinni reads from top to bottom, and if the top node is iResult = d100() < 100; then it will be the dialogue selected 100 percent of the time, defeating the purpose of the script. Likewise, each dialogue node in the .dlg file should have separate conditional scripts, each with an equal chance of being rolled, according to the total number of possible dialogue nodes. Whats this mean? Well, if you have 10 dialogue nodes that you want to be randomly chosen each time Geralt speaks to this person, then the conditional script will read as above, but with the following variables:
* iResult = d100() < 11;
* iResult = d100() < 21;
* iResult = d100() < 31;
* iResult = d100() < 41;
* iResult = d100() < 51;
* iResult = d100() < 61;
* iResult = d100() < 71;
* iResult = d100() < 81;
* iResult = d100() < 91;
* iResult = d100() < 100;
|