Symbolic labels in D files

Is there a way to resolve symbolic labels inside D files without recompiling all of the interconnected dialogue files?

I have an optional component that appends to a DLG that was previously compiled from my own D file and has references to its states for transitions. Changing all of the numeric state references every time I happen to change the main dialog's state order is becoming a massive pain and I would like to know if there's an easier way to go about it.

I would settle for being able to pre-set the labels at the start of the file if there's no way to resolve the references without recompiling.

There is none unless you have a stable part in your main dialogue (which you do not have, if I understand correctly).

I would do it this way -

Include the optional dialogues into the main dialogues and add an additional trigger for them.

Use the install option to set this trigger in a way that those optional dialogue lines only happen if the optional component is installed that sets the value for them.

Better give an example -

You create the optional component with EXTEND_TOP of a suitable BCS file from your mod with this

IF

Global("OptionalTriggers","Global",0)

THEN
RESPONSE #100

SetGlobal("OptionalTriggers","Global",1)

END

in a way that when the user selects the option, this block is added, it triggers as soon as your script is valid and it sets

Global("OptionalTriggers","Global",1)

Now all the dialogue states or responses etc in your d-file that belong to the option contain the condition Global("OptionalTriggers","Global",1) - this way they only appear if the option is chosen and you can refer criss and cross to all internal labels at will.

I use it too, but actually I wonder how does it work with non-english games?

STATE_WHICH_SAYS basically does an equality check between what's in the state's SAY (as a strref) and the strref your string resolves into, so yeah, it's not fool-proof and if the text is not an exact match, it will fail.

I use it too, but actually I wonder how does it work with non-english games?

STATE_WHICH_SAYS basically does an equality check between what's in the state's SAY (as a strref) and the strref your string resolves into, so yeah, it's not fool-proof and if the text is not an exact match, it will fail.

It can also lead to wrong results for the case that the text is not unique in a dialogue, which can often be the case (so make sure before using).