Jump to content


Photo

Tweakins existing .dlg files


10 replies to this topic

#1 Salk

Salk
  • Modders
  • 2915 posts
  • Gender:Male
  • Location:Sweden

Posted 28 November 2017 - 03:29 AM

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!



#2 Jarno Mikkola

Jarno Mikkola

    The Imp

  • Modders
  • 6308 posts
  • Gender:Male
  • Location:The town where the dead haven't keeled over, yet. In Finland.

Posted 28 November 2017 - 06:23 AM

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, 28 November 2017 - 06:24 AM.

Welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand.
Here's how to install all the ... mods you ever really could want to Infinity Engine games. I removed the stable word from there as Roxanne began to add BS mods that are likely to break compatibility from the BWS.

#3 CamDawg

CamDawg

    Dreaming of a red Xmas

  • Gibberling Poobah
  • 9303 posts
  • Gender:Not Telling

Posted 28 November 2017 - 06:42 AM

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.


I came here with a simple dream: a dream of killing all humans. And this is how it must end? Who's the real seven billion ton robot monster here? Not I. Not... I.


#4 Salk

Salk
  • Modders
  • 2915 posts
  • Gender:Male
  • Location:Sweden

Posted 28 November 2017 - 06:47 AM

Thanks for the answers, CamDawg. :beer:



#5 Mike1072

Mike1072
  • Gibberling Poobah
  • 2384 posts
  • Gender:Male
  • Location:Canada

Posted 28 November 2017 - 07:31 AM

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?

#6 Roxanne

Roxanne

    Modder

  • Modders
  • 1673 posts
  • Gender:Female
  • Location:Auckland, NZ

Posted 28 November 2017 - 07:34 AM

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 by Roxanne, 28 November 2017 - 07:35 AM.

The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#7 Salk

Salk
  • Modders
  • 2915 posts
  • Gender:Male
  • Location:Sweden

Posted 29 November 2017 - 04:51 AM

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, 29 November 2017 - 04:51 AM.


#8 Roxanne

Roxanne

    Modder

  • Modders
  • 1673 posts
  • Gender:Female
  • Location:Auckland, NZ

Posted 29 November 2017 - 05:04 AM

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, 29 November 2017 - 06:04 AM.

The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#9 Salk

Salk
  • Modders
  • 2915 posts
  • Gender:Male
  • Location:Sweden

Posted 29 November 2017 - 06:00 AM

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, 29 November 2017 - 06:01 AM.


#10 Roxanne

Roxanne

    Modder

  • Modders
  • 1673 posts
  • Gender:Female
  • Location:Auckland, NZ

Posted 29 November 2017 - 08:03 AM

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.

 

Spoiler

Edited by Roxanne, 29 November 2017 - 08:14 AM.

The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#11 CamDawg

CamDawg

    Dreaming of a red Xmas

  • Gibberling Poobah
  • 9303 posts
  • Gender:Not Telling

Posted 29 November 2017 - 09:21 AM

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, 29 November 2017 - 09:23 AM.

I came here with a simple dream: a dream of killing all humans. And this is how it must end? Who's the real seven billion ton robot monster here? Not I. Not... I.




Reply to this topic



  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users