Jump to content

How to check for an existing TRANS_ACTION


jastey

Recommended Posts

How do I check whether a transaction is already there?

I don't want to completely REPLACE_TRANS_ACTION in case another mod adde4d something else. I have nothing to swap the action with (because the original action is empty). I cannot use ADD_TRANS_ACTION since then in case the action is already there it would be two times.

 

I am asking because I want to fix a transaction that might already be fixed by Dudleyfix (or not), in this case giving the PC the promised 2000 gold extra in Scar's dialogue. Dudleyfix already adds the mising ~GiveGoldForce(2000)~

 

IF ~~ THEN BEGIN 17 // from: 14.2

SAY #48 /* ~It is sad that a good man like Jhasso had to die, but I am impressed that you defeated all of those horrible creatures. You are a fine group of warriors and worth every bit that I'm about to pay you. We have to keep in touch, especially if the Iron Throne is as underhanded as you say it is.~ */

IF ~~ THEN GOTO 26

END

Link to comment

Umm... probably DECOMPILE_DLG_TO_D and then COUNT_REGEXP_INSTANCES. If you need to check whether the action occurs within a given state or something, you'd have to use some nasty whitespace-checking code in there too. Would be easier if ADD|REPLACE_TRANS* commands took an UNLESS argument (maybe they do, I dunno). Possibly ALTER_TRANS could do it but I haven't messed with that much.

Link to comment

quick and dirty:

REPLACE_ACTION_TEXT_PROCESS scar ~GiveGold\(Force\|\)([24]000)~ ~~
ADD_TRANS_ACTION scar BEGIN 11 17 END BEGIN 0 END ~GiveGoldForce(2000)~
ADD_TRANS_ACTION scar BEGIN 13	END BEGIN 0 END ~GiveGoldForce(4000)~

Link to comment
quick and dirty:

REPLACE_ACTION_TEXT_PROCESS scar ~GiveGold\(Force\|\)([24]000)~ ~~
ADD_TRANS_ACTION scar BEGIN 11 17 END BEGIN 0 END ~GiveGoldForce(2000)~
ADD_TRANS_ACTION scar BEGIN 13	END BEGIN 0 END ~GiveGoldForce(4000)~

That's going to break mods that ICT and the like. Also, the _PROCESS isn't needed (it's only needed if you use DisplayString() and the like).

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...