REPLACE_(ACTION | TRIGGER)_TEXT doesn't respect translation ids. Why do I want this? See
for yourself:
REPLACE_ACTION_TEXT udardul ~EraseJournalEntry(6535)~
/* ~The Drow Summoning Ritual
I gave the real dragon eggs to Matron Ardulace, proof of Phaere's treachery, and she has called for Phaere to be brought before her.~ */
~EraseJournalEntry(6535)
EraseJournalEntry(@1)
EraseJournalEntry(@2)
EraseJournalEntry(@3)
EraseJournalEntry(@4)~
In other words, I want to make sure that whenever journal entry #6535 is erased, so are my new entries. I realize REPLACE_ just does your run-of-the-mill regexp replacement, but I think doing the .TRA replacements as well is a good idea. Pehaps new operations are better (REPLACE_(ACTION | TRIGGER)_TEXT_TRANSIDS?) to prevent upsetting run-of-the-mill REPLACE_ applications that happen to use at-signs (very common case, that. :-)
Of course I can work around this deficiency in various ways; the most obvious being to put in an additional SetGlobal() with REPLACE_ and use a script (in this particular case, the area script) to erase the entries. But since ACTION_TEXTs *are* scripts, I think it's more consistent to pull in translation id replacement natively.
R.
REPLACE_ and translation ids
Started by Rassadihn, Feb 25 2003 07:17 AM
6 replies to this topic
#1
Posted 25 February 2003 - 07:17 AM
#2
Posted 09 March 2003 - 02:08 PM
OK, I just saw this message today.
And now that I've read it, I must admit that I still have no idea what you're talking about :-). Sorry! Normally I'm half-decent at English, but today I'm at a loss.
Can you give me an example of
(1) BEFORE.DLG
(2) modify.D that contains REPLACE_ACTION_TEXT (or whatever) operating on BEFORE.DLG
(3) AFTER.DLG which is the result
(4) WANTED.DLG which is what you wanted the result to be
or something equally explicit? I get the feeling that you're asking for a useful feature here but I can't quite get a handle on it.
And now that I've read it, I must admit that I still have no idea what you're talking about :-). Sorry! Normally I'm half-decent at English, but today I'm at a loss.
Can you give me an example of
(1) BEFORE.DLG
(2) modify.D that contains REPLACE_ACTION_TEXT (or whatever) operating on BEFORE.DLG
(3) AFTER.DLG which is the result
(4) WANTED.DLG which is what you wanted the result to be
or something equally explicit? I get the feeling that you're asking for a useful feature here but I can't quite get a handle on it.
#3
Posted 10 March 2003 - 07:06 AM
You flatter me by suggesting the incomprehensibility is due to yourself. :-)
Alright, here we go. Step by step.
(1). This is state #56 from the unmodified UDARDUL.DLG, up to the point where it gets interesting:
IF ~~ THEN BEGIN 56 // from: 55.0
SAY #52126 /* ~No drow would be so insipid as to DARE such a thing!! Who are you?! Why are you here?! I *shall* find out, and then I shall TEAR YOU LIMB FROM LIMB!!~ */
IF ~~ THEN DO ~StartCutSceneMode()
ClearActions(Player1)
ClearActions(Player2)
ClearActions(Player3)
ClearActions(Player4)
ClearActions(Player5)
ClearActions(Player6)
EraseJournalEntry(5810)
EraseJournalEntry(6535)
...
(2). Then there's NEWARDU.D, my own contraption. The exact content is irrelevant, but let's just say it has an associated NEWARDU.TRA with four strings numbered @1 through @4. Let's also say these strings are used as journal entries through UNSOLVED_JOURNAL, although this is really not relevant.
Now, these journal entries belong to an intermittent quest, and must be erased (I've decided) whenever the original game erases entry #6535. So I wrote the exact REPLACE_ACTION_TEXT as you can see in my original post.
(3). This is from WeiDU's decompiled new UDARDUL.DLG:
IF ~~ THEN BEGIN 56 // from: 55.0
SAY #52126 /* ~No drow would be so insipid as to DARE such a thing!! Who are you?! Why are you here?! I *shall* find out, and then I shall TEAR YOU LIMB FROM LIMB!!~ */
IF ~~ THEN DO ~StartCutSceneMode()
ClearActions(Player1)
ClearActions(Player2)
ClearActions(Player3)
ClearActions(Player4)
ClearActions(Player5)
ClearActions(Player6)
EraseJournalEntry(5810)
EraseJournalEntry(6535)
EraseJournalEntry(@1)
EraseJournalEntry(@2)
EraseJournalEntry(@3)
EraseJournalEntry(@4)
...
(4). Oops -- not what I had in mind. I was expecting actual, brand new string refs in place of the ids. REPLACE_ACTION_TEXT knows nothing about actions or translations, it just does a mindless search and replace.
More recent versions of WeiDU handle this correctly for about any means of using translation ids *but* REPLACEing -- roll-your-own states are handled correctly, patched states are not.
Incidentally, in the particular case of UDARDUL.DLG this is overkill, because there is only one state in which this replace is necessary -- but the point of the exercise is that I want my journal entries to be erased in connection with an existing one, and I don't want to search for & draw up a list of individual states to patch.
I hope this clears things up a bit.
Alright, here we go. Step by step.
(1). This is state #56 from the unmodified UDARDUL.DLG, up to the point where it gets interesting:
IF ~~ THEN BEGIN 56 // from: 55.0
SAY #52126 /* ~No drow would be so insipid as to DARE such a thing!! Who are you?! Why are you here?! I *shall* find out, and then I shall TEAR YOU LIMB FROM LIMB!!~ */
IF ~~ THEN DO ~StartCutSceneMode()
ClearActions(Player1)
ClearActions(Player2)
ClearActions(Player3)
ClearActions(Player4)
ClearActions(Player5)
ClearActions(Player6)
EraseJournalEntry(5810)
EraseJournalEntry(6535)
...
(2). Then there's NEWARDU.D, my own contraption. The exact content is irrelevant, but let's just say it has an associated NEWARDU.TRA with four strings numbered @1 through @4. Let's also say these strings are used as journal entries through UNSOLVED_JOURNAL, although this is really not relevant.
Now, these journal entries belong to an intermittent quest, and must be erased (I've decided) whenever the original game erases entry #6535. So I wrote the exact REPLACE_ACTION_TEXT as you can see in my original post.
(3). This is from WeiDU's decompiled new UDARDUL.DLG:
IF ~~ THEN BEGIN 56 // from: 55.0
SAY #52126 /* ~No drow would be so insipid as to DARE such a thing!! Who are you?! Why are you here?! I *shall* find out, and then I shall TEAR YOU LIMB FROM LIMB!!~ */
IF ~~ THEN DO ~StartCutSceneMode()
ClearActions(Player1)
ClearActions(Player2)
ClearActions(Player3)
ClearActions(Player4)
ClearActions(Player5)
ClearActions(Player6)
EraseJournalEntry(5810)
EraseJournalEntry(6535)
EraseJournalEntry(@1)
EraseJournalEntry(@2)
EraseJournalEntry(@3)
EraseJournalEntry(@4)
...
(4). Oops -- not what I had in mind. I was expecting actual, brand new string refs in place of the ids. REPLACE_ACTION_TEXT knows nothing about actions or translations, it just does a mindless search and replace.
More recent versions of WeiDU handle this correctly for about any means of using translation ids *but* REPLACEing -- roll-your-own states are handled correctly, patched states are not.
Incidentally, in the particular case of UDARDUL.DLG this is overkill, because there is only one state in which this replace is necessary -- but the point of the exercise is that I want my journal entries to be erased in connection with an existing one, and I don't want to search for & draw up a list of individual states to patch.
I hope this clears things up a bit.
#4 -jcompton-
Posted 10 March 2003 - 08:49 AM
This might just be a case where you're better off replacing the entire state.
#5
Posted 11 March 2003 - 03:05 AM
Plural, please. All relevant states in UDDEMON.DLG and UDPHAE01.DLG have to be changed as well (haven't counted them yet). I'd copy & paste all the relevant states, inserting my EraseJournalEntries() at the appropriate point, and use the fact that nobody's ever going to change those states again anyway because it's a fairly obscure part of the game.This might just be a case where you're better off replacing the entire state.
That works. If all I was interested in "getting it to work", I'd do it. But this isn't one of those epic mods that's intended to woo the audience with its gripping storyline (hey, we can't all be writers :-). I'm not even sure I'm ever going to put it up for download, or something. The process of getting there is more interesting than the actual result.
So, despite the fact that my mod is likely to never, ever suffer incompatibility with anyone, and that I might just as well copy the entire *dialogues* and modify them in whatever fashion I like -- this is just not what I want to do. I want to modify the dialogue in exactly the amount needed, and not a state trigger more.
I'm not saying this is so universally useful that Wes should include it with WeiDU -- I could implement it myself if I liked, but that would be a major pain (every new version of WeiDU would have to be re-patched). I just thought I'd put it up for consideration, as this seems to be the kind of thing Westley would want to know about -- WeiDU is all about modifying dialogues as inobtrusively as possible, after all. YMMV.
#6
Posted 11 March 2003 - 11:12 AM
OK, Ras.
I have added REPLACE_ACTION_TEXT_PROCESS (triggers don't have meaningful strrefs).
Example Input:
Result:
Note that the third argument to _PROCESS must be a valid action list. No partial substrings allowed.
I have added REPLACE_ACTION_TEXT_PROCESS (triggers don't have meaningful strrefs).
Example Input:
@1 = #12345 // whatever REPLACE_ACTION_TEXT_PROCESS ~BODHI~ ~StartCutSceneMode()~ ~DisplayString("weimer",@1)~
Result:
IF ~~ THEN BEGIN 2 // from: 1.0 SAY #21468 /* ~I have asked you here because we are unlikely to be overheard, and so you can see the benefits of working with me. Follow, please, and stay exactly in my step. You would...regret doing other.~ [BODHIX11] */ IF ~~ THEN DO ~ClearAllActions() DisplayString("weimer",12345) StartCutScene("Cut25a") ~ UNSOLVED_JOURNAL #6605 /* ~Meeting with Valen's mistress.
Note that the third argument to _PROCESS must be a valid action list. No partial substrings allowed.
#7
Posted 13 March 2003 - 03:02 AM
Muchos gracias, seņor. This makes me a moderately happy camper. :-)