Originally Posted by GreedyQuestioner
I'm especially interested if this is possible without defining a node for each option, otherwise this seems possible by predefining a node for each option (requires knowing every possible thing beforehand) and setting and checking flags.

You will always need as many nodes as the maximum number of options that can be enabled simultaneously, since every option that you can choose by definition corresponds to a node. All dialog nodes are added via the dialog editor. You cannot add and connect additional nodes from script.

However, using dialog variables you can dynamically change the content of each node, and using flags you can dynamically enable/disable nodes. This is what is done for Han on the Lady Vengeance in Act 2 and later. He can fetch up to 104 different ingredients depending on which recipes you know and what level you are, so his dialog (Mods\DivinityOrigins..\Story\Dialogs\LadyVengeance_Hub\RC_LV_Han.lsj) contains 104 question nodes that are dynamically filled in and enabled/disabled by story when his dialog starts (story goal GLO_LVHub_Runner).

That one uses translated string variables, because the ingredient names are localised. You can however also use fixed strings, in which case you can specify any string directly from story without the need to create a translated string for every option. In that case you use DialogSetVariableFixedString() instead of DialogSetVariableTranslatedString().

To add/declare dialog variables, open the dialog editor and go to Tools -> Edit Dialog Variables.

To reference a dialog variable in a dialog text block, use [Name_UUID] (including with the square brackets), replacing Name_UUID with the value that is in this field when you select the dialog variable in the dialog variables list.

To set the value of a dialog variable from story, use the above API. You can have a look at the GLO_LVHub_Runner goal for usage examples.