Salk Posted November 28, 2017 Share Posted November 28, 2017 Hello! I have a few simple questions and I am hoping there are equally simple WeiDU solutions. 1) What's the easiest and safest way to remove a reply (response) from an existing dialogue? 2) What's the best way to add a new state to a dialogue? 3) Is there a way to find something in the DIALOG.TLK file (ex. part of a string) and replace it with some other text without providing the STRREF number? Thanks! Quote Link to comment
Jarno Mikkola Posted November 28, 2017 Share Posted November 28, 2017 (edited) 3) Is there a way to find something in the DIALOG.TLK file (ex. part of a string) and replace it with some other text without providing the STRREF number? Yes, replace textually will work... of course giving more information would give you better answer, so I won't bother. Like actually case. Edited November 28, 2017 by Jarno Mikkola Quote Link to comment
CamDawg Posted November 28, 2017 Share Posted November 28, 2017 1) What's the easiest and safest way to remove a reply (response) from an existing dialogue? ADD_TRANS_TRIGGER dlgfile 1 ~False()~ DO 2 // replace 1 with state number, 2 with reply number 2) What's the best way to add a new state to a dialogue? APPEND dlgfile // regular dlg code follows IF ~~ THEN BEGIN newstate name SAY @107 IF ~~ THEN EXIT END END 3) Is there a way to find something in the DIALOG.TLK file (ex. part of a string) and replace it with some other text without providing the STRREF number? This one's a bit trickier. It's easy to search and replace within a string, but I'm not sure about doing it with the entire tlk. Quote Link to comment
Salk Posted November 28, 2017 Author Share Posted November 28, 2017 Thanks for the answers, CamDawg. Quote Link to comment
Mike1072 Posted November 28, 2017 Share Posted November 28, 2017 For #3, you could make global replacements using ALTER_TLK or ALTER_TLK_RANGE. Global replacements aren't really very common, though. What are you trying to do? Quote Link to comment
Roxanne Posted November 28, 2017 Share Posted November 28, 2017 (edited) Unless your problem is solved already, it would be easier to see the use case and expected result. It may be relatively easy (or not) given the actual case. (Is it all in one dialogue?) Edited November 28, 2017 by Roxanne Quote Link to comment
Salk Posted November 29, 2017 Author Share Posted November 29, 2017 (edited) Okay, what I am trying to do is to change the text of some strings. The problem is that those line are not always associated to the same string number, depending on what mods are installed and what order they are installed in. This means I cannot use STRING_SET but rather need to find where that line is in some other way. Edited November 29, 2017 by Salk Quote Link to comment
Roxanne Posted November 29, 2017 Share Posted November 29, 2017 (edited) Okay, what I am trying to do is to change the text of some strings. The problem is that those line are not always associated to the same string number, depending on what mods are installed and what order they are installed in. This means I cannot use STRING_SET but rather need to find where that line is in some other way. You can use STATE_WHICH_SAYS strref to find the respective line- but then? If it is a line in a dialogue that is often interjected there is a big problem. Edited November 29, 2017 by Roxanne Quote Link to comment
Salk Posted November 29, 2017 Author Share Posted November 29, 2017 (edited) I fear I have not explained myself properly so I better give a straightforward example. One BG1 UB journal entry says: Lahl was grateful for my defeat of Karoug. and I want it to be instead: Lahl was grateful for my defeat of some beasts outside the walls. I used this: ACTION_GET_STRREF 75168 palinchange OUTER_PATCH_SAVE palinchange ~%palinchange%~ BEGIN REPLACE_TEXTUALLY ~Lahl was grateful for my defeat of Karoug.~ ~Lahl was grateful for my defeat of some beasts outside the walls.~ END STRING_SET_EVALUATE 75168 ~%palinchange%~ because at that time the STRREF for that line was 75168. But when I reinstalled the game a second time, that STRREF was wrong. I suppose one could use ALTER_TRANS? Edited November 29, 2017 by Salk Quote Link to comment
Roxanne Posted November 29, 2017 Share Posted November 29, 2017 (edited) ACTION_GET_STRREF 75168 palinchange OUTER_PATCH_SAVE palinchange ~%palinchange%~ BEGIN REPLACE_TEXTUALLY ~Lahl was grateful for my defeat of Karoug.~ ~Lahl was grateful for my defeat of some beasts outside the walls.~ END STRING_SET_EVALUATE 75168 ~%palinchange%~ because at that time the STRREF for that line was 75168. But when I reinstalled the game a second time, that STRREF was wrong. I suppose one could use ALTER_TRANS? ALTER_TRANS used to not work with JOURNAL and @tra texts. But my knowledge here may be outdated, last time I tried was many weidu versions ago... The Lahl dialogue state with the respective journal entry is a stand alone state with no dependencies. It will be just easy to add a new state with weight that adds the new text. APPEND Lahl IF WEIGHT #-2~ Dead("karoug") Global("scLahlQuest","GLOBAL",1)Global("Kaishas1","GLOBAL",1)~ THEN BEGIN newsalk SAY~Thank you for destroying those terrible beasts. To tell you the truth I didn't think much of you when you first arrived, but now, I have to say you'd make welcome additions to the pa... er... village.~ IF ~~ THEN DO ~SetGlobal("scLahlQuest","GLOBAL",2) ~ UNSOLVED_JOURNAL~The Mysterious Island Lahl was grateful for my defeat of some beasts outside the walls. I have made a lot of friends here. He said I would make a good addition to the village.~EXIT END END Edited November 29, 2017 by Roxanne Quote Link to comment
CamDawg Posted November 29, 2017 Share Posted November 29, 2017 (edited) Nah, you could get away with just an EXTEND_BOTTOM. Since it's evaluated bottom-up, the new branch (and its new journal entry) will be used instead of the existing. EXTEND_BOTTOM lahl 8 IF ~~ THEN DO ~SetGlobal("scLahlQuest","GLOBAL",2)~ UNSOLVED_JOURNAL @100 EXIT ENDedit: But yes, ALTER_TRANS would work better, if it does. Edited November 29, 2017 by CamDawg Quote Link to comment
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.