Jump to content

The replace command and how to use it?


Recommended Posts

So I started off just making dialog files and copying them into the override file. However, I soon realized that since I was replacing the dialog files of original bioware characters, this approach would make my mod incompatable with everything else.


So I graduated to using





which seems to work better. However, there are some blocks of original bioware dialog that I want to replace.


Is there a replace command that can do this? If there is would you mind posting an example of how one would use it to replace a block of text in a dialog file?


Thanks so much,



Edit: Changed the topic title so other people can benefit from the description below

Link to comment

If you absolutely have to (and only if you absolutely have to) you can use


REPLACE_SAY (somewhat destructive) with another command to either alter or add to the triggers and actions;


REPLACE_SAY ~%tutu_var%BRIELB~ 14 @1
ALTER_TRANS ~%tutu_var%BRIELB~ BEGIN 14 END BEGIN 0 END BEGIN ACTION ~SetGlobal("P#Briel_Stay","GLOBAL",1) RealSetGlobalTimer("X#BriLostPatience","GLOBAL",1800)~ END




REPLACE_TRANS_ACTION ~%KIVAN_BANTER%~ BEGIN 4 END BEGIN END ~SetGlobal("Kivanfight","GLOBAL",1)~ ~SetGlobal("X#KivanfightBanterBlocked","GLOBAL",1)~


you sometimes have to build just a new trigger or action to go along with this, but ALTER_TRANS is the best way to go. The common followup is


REPLACE_TRANS_ACTION _QUAYLP BEGIN 2 END BEGIN END ~JoinParty()~ ~SetGlobal("KickedOut","LOCALS",0) JoinParty()~
REPLACE_STATE_TRIGGER ~_BYESLI~ 9 ~InteractingWith("kagain") RandomNum(8,1) Global("X#BIOYE1","LOCALS",0)~



You can also REPLACE the whole dialogue state (really destructive, but sometimes the only way to do stuff)


REPLACE ~%tutu_var%BRIELB~
IF ~Global("HelpBrielbara","GLOBAL",1)~ THEN BEGIN 16 // from:
SAY @2
IF ~Global("P#CoranBaby","GLOBAL",2) Global("P#Briel_Stay","GLOBAL",1) InParty("coran")~ THEN DO ~SetGlobal("X#BriFinale","GLOBAL",1)~ GOTO returnBriel
IF ~GlobalLT("P#CoranBaby","GLOBAL",2) Global("P#Briel_Stay","GLOBAL",1) InParty("coran")~ THEN DO ~SetGlobal("X#BriFinale","GLOBAL",1)~ GOTO NamaraCor
IF ~Global("P#Briel_Stay","GLOBAL",2) InParty("coran")~ THEN DO ~SetGlobal("X#BriFinale","GLOBAL",1)~ GOTO BrielCurse
IF ~Global("P#Briel_Stay","GLOBAL",3)~ THEN DO ~SetGlobal("X#BriFinale","GLOBAL",1)~ GOTO CoranStay
IF ~Global("P#Briel_Stay","GLOBAL",1) !InParty("coran")~ THEN DO ~SetGlobal("X#BriFinale","GLOBAL",1)~ EXIT
IF ~!Global("P#Briel_Stay","GLOBAL",1) !InParty("coran")~ THEN DO ~SetGlobal("X#BriFinale","GLOBAL",1)~ EXIT
IF ~GlobalGT("P#Briel_Stay","GLOBAL",1)~ THEN DO ~SetGlobal("X#BriFinale","GLOBAL",1)~ EXIT


If you are able to confirm that the original string is stable over all of the various installs, you can use


STRING_SET  6709 @140

by designating the string number and changing what it says, leaving the original structure completely untouched, since all you are doing is altering the string.


For mod-added materials, it is a journey into the land of STATE_WHICH_SAYS, which I think is definitely cool but carries serious drawbacks, not the least f which is you need to account for all the variant GTUs and any homemeade reapairs to the dialog.tlk; not for the faint of heart or limited of install space (or for that matter not for those of us who are pretty much uni-lingiual, unless we are working with a multi-lingual team).


Technically, there are legacy ways of doing the same thing by decompiling your dialogues and doing really horrible REPLACE_TEXTUALLY, etc., but the bigg coded up all sorts of weapons to use that are much more efficient.


Basically, look through the WeiDU docs and every place it says "DO NOT USE THIS COMMAND", it probably has to do with what you are asking. As a reminder, any time you alter an original dialogue state rather than building a new branch off of it via EXTEND_BOTTOM, or setting a variable via I_C_T and then using it to kicjk off a new independent dialogue, you are risking other people's work, too. They are expecting the base dialogue.


That is not saying "don't do this", because there are times when it is absolutely necessary. But using variants of REPLACE in general is one of those things that you do only after you have asked the question "is there any other way i can do this that won't mess with other modders?"


Then ask it agian. Then sleep on it and see if inspiration strikes. And if there is no other way of doing it, then go ahead, but make a note of it, because eventually someone will say "hey, there is a bug here - Imoen comments that she has decided to become a Druid/WildMage follower of Sune, and then there are three options from another mod here that talk about her thieving skills... what gives?" :) (plus, if you rebuild the whole state using REPLACE, you blow away everything that added stuff to that state before your mod is installed).

Link to comment

Hey thanks! I really appreciate your detailed reply. That would have taken me forever to figure out without some help.


I am going to stay far away from the STATE_WHICH_SAYS as its seems way beyond my ability level.


I also appreciate your point on the use of REPLACE. I'll think some more on ways around it before I pull the trigger.


Thanks again,


Link to comment


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

  • Create New...