STATE_WHICH_SAYS will let the installation fail with an error if it doesn't find the specified line in the according dialogue file.
I would like STATE_WHICH_SAYS just skip or give an negative result if the specified line is not present in the requested dlg. As far as I understood, STATE_WHICH_SAYS is used to identify a dialogue state of which only the text line is known. In my case, this is an added line by a mod. I can check whether the mod is installed beforehand. But what I do not know is in which language the mod is installed. So, I wanted to loop STATE_WHICH_SAYS through the mod's language versions until it gives a hit and then append to the identified dlg state. This of course doesn't work, as the install fails for the wrong language versions. I don't know why it was implemented this way, but I think making the whole install fail makes STATE_WHICH_SAYS rather useless in nowadays mods with several language versions?
I would like this to work:
/* bg1npc is installed: Viconia's interjection kills the new reply option to settle the discpute with Seniyad peacefully. Add the reply option to Viconia's new state, as well: */
ACTION_IF ((MOD_IS_INSTALLED ~BG1NPC/BG1NPC.TP2~ "1") AND (FILE_EXISTS
~bg1npc/tra/english/x#viint.tra~)) BEGIN // appropriate component check from BG1 NPC
/* grab the correct vic_state */
OUTER_SET vic_state = STATE_WHICH_SAYS 5 IN ~bg1npc/tra/german/x#viint.tra~ FROM ~viconij.dlg~ // whatever tra file this is from
ACTION_IF (vic_state >= 0) BEGIN
OUTER_SET vic_state_final = vic_state
END
OUTER_SET vic_state = STATE_WHICH_SAYS 5 IN ~bg1npc/tra/english/x#viint.tra~ FROM ~viconij.dlg~
ACTION_IF (vic_state >= 0) BEGIN
OUTER_SET vic_state_final = vic_state
END
OUTER_SET vic_state = STATE_WHICH_SAYS 5 IN ~bg1npc/tra/french/x#viint.tra~ FROM ~viconij.dlg~
ACTION_IF (vic_state >= 0) BEGIN
OUTER_SET vic_state_final = vic_state
END
OUTER_SET vic_state = STATE_WHICH_SAYS 5 IN ~bg1npc/tra/polish/x#viint.tra~ FROM ~viconij.dlg~
ACTION_IF (vic_state >= 0) BEGIN
OUTER_SET vic_state_final = vic_state
END
OUTER_SET vic_state = STATE_WHICH_SAYS 5 IN ~bg1npc/tra/spanish/x#viint.tra~ FROM ~viconij.dlg~
ACTION_IF (vic_state >= 0) BEGIN
OUTER_SET vic_state_final = vic_state
END
<<<<<<<< ...inlined/aldeth_bg1npc.d
EXTEND_BOTTOM ~viconij~ %vic_state_final%
IF ~~ THEN REPLY @0 EXTERN SENIYA JA#SENIYA_00
END
>>>>>>>>
COMPILE EVALUATE_BUFFER ~JA#BGT_AdvPack/DLG/JA#ALDETH.D~
~...inlined/aldeth_bg1npc.d~
USING ~JA#BGT_AdvPack/languages/%s/JA#ALDETH.tra~
END ELSE BEGIN //Viconia interjection from bg1npc is not installed
COMPILE EVALUATE_BUFFER ~JA#BGT_AdvPack/DLG/JA#ALDETH.D~
END