Jump to content

Tweakins existing .dlg files


Salk

Recommended Posts

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!

Link to comment

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 by Jarno Mikkola
Link to comment

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.

Link to comment

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 by Salk
Link to comment

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 by Roxanne
Link to comment

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 by Salk
Link to comment
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 by Roxanne
Link to comment

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
END
edit: But yes, ALTER_TRANS would work better, if it does. Edited by CamDawg
Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...