While working on an old mod, I ran across a dialogue which used REPLACE (on a vanilla dialogue), when it actually only had to add some lines to a transition action.
My question is: what is the best way to do that, in particular for maximum compatibility with other mods (which might have patched the same dialogue before)?
In particular, the aim of the patch is to turn some more people in the area hostile. The old transition is
THEN REPLY ~reply~ DO ~SetSomeVars Enemy()~ SOLVED_JOURNAL ~journal~ EXIT
And must be turned into
THEN REPLY ~reply~ DO ~SetSomeVars Enemy() ActionOverride(Someoneelse,Enemy())~ SOLVED_JOURNAL ~journal~ EXIT
My ideas:
1. without a .d file:
DECOMPILE... REPLACE_TEXTUALLY ~^[^a-zA-Z]*Enemy()[^a-zA-Z]*$~ ~Enemy()%LNL%ActionOverride(...)~ COMPILE...
With a .d file:
2. ALTER_TRANS
3. REPLACE_TRANS_ACTION
these two actions only work on selected transitions and states, so, if a previous mod did COPY_TRANS, the new transitions would not be patched.
4. REPLACE_ACTION_TEXT
IMO, the most compatible? works like REPLACE_TEXTUALLY but only on transitions (so, doesn't break triggers by mistake); UNLESS can be used to prevent the new piece to be added if another mod did the same thing. Finally, this patches all occurrencies of Enemy(), even those added by other mods.
Of course, if other, already installed, mods wanted those others never to turn hostile, this could become a problem. But then, the two mods are conceptually incompatible, so a "correct" way to deal with them does not exist in that case
I would rather use the 4th method, but I'm not so sure, so I'm asking for other opinions. What do you think? Do you have other ideas? What would you suggest to use? TIA for any hint
PS: if this is the wrong forum, I apologize; please move it wherever it is appropriate