Wow. That is some coding, Sim!
Thanks.
I especially like the bit when you append action.ids. I would never have thought of that (and may use this in future) but how exactly does it work?
I assume you're talking about this:
APPEND ~ACTION.IDS~
~163 IG(S:GLOBAL*,S:Area*D0VTYPE,I:Value*)~
UNLESS ~163 IG(S:GLOBAL*,S:Area*D0VTYPE,I:Value*)~
It became necessary when I needed to replace all ReputationInc actions in dialogues with IncrementGlobal("D0Change2","GLOBAL",x). The problem is that the latter is a lot longer, and a simple REPLACE_TEXTUALLY would mess up the offsets in the DLG files.
It should at this point be noted that this coding was before REPLACE_ACTION_TEXT_REGEXP was implemented. I suppose really I should modernize.
Anyway, I needed to shorten the IncrementGlobal action as much as possible. The obvious change is shortenning the variable name. Next stage is changing the action to be shorter. This can be done by appending to IDS, so the IG action uses the same opcode as IncrementGlobal.
However, IG("X","GLOBAL",1) is still too long. The only bit left to shorten is the "GLOBAL". Therefore, I create a custom IDS file referenced in the new action I'm appending, which allows me to use 0 in place of "GLOBAL" in the action. The result is that IG("D0Chg2",0,1) is just the right length.