Jump to content

messing around with dialog.tlk...


Guest silas

Recommended Posts

Guest silas

I understand that the IE is very finicky with its dialog.tlk, and it generally shouldn't be messed with. But I like to change things around, and I'd like to keep most of my changes when I reinstall things. The first 74,000 or so strings never change when I reinstall (cuz I use a single unmodded disk image as the basis for all reinstalls); so and changes I make within those first 74,000 strings should be easy to carry over.

 

But the thing is, I'm not very adept with WeiDU.

 

I found the "--tlkcmp-from/--tlkcmp-to" function on the WeiDU documentation site, seems like that's what I need. Took me a while to figure out it only observes differences, it doesn't actually change the target .tlk file. So then I discovered the "--out" argument, and now have a text file that says stuff like this:

 

// TP2 File
STRING_SET 295 @1000295

...

// TRA File
@1000295 = ~Short bows were the first to be developed, although they were not called such...

 

Color me really, really stupid, but how do I use this to actually edit my target dialog.tlk? (I notice in the WeiDU docs, next to the STRING_SET command, it says do no use this command.)

Link to comment
I understand that the IE is very finicky with its dialog.tlk, and it generally shouldn't be messed with. But I like to change things around, and I'd like to keep most of my changes when I reinstall things. The first 74,000 or so strings never change when I reinstall (cuz I use a single unmodded disk image as the basis for all reinstalls); so and changes I make within those first 74,000 strings should be easy to carry over.

 

But the thing is, I'm not very adept with WeiDU.

 

I found the "--tlkcmp-from/--tlkcmp-to" function on the WeiDU documentation site, seems like that's what I need. Took me a while to figure out it only observes differences, it doesn't actually change the target .tlk file. So then I discovered the "--out" argument, and now have a text file that says stuff like this:

 

// TP2 File
STRING_SET 295 @1000295

...

// TRA File
@1000295 = ~Short bows were the first to be developed, although they were not called such...

 

Color me really, really stupid, but how do I use this to actually edit my target dialog.tlk? (I notice in the WeiDU docs, next to the STRING_SET command, it says do no use this command.)

 

 

You use the STRING_SET command. Originally, WeiDU would not uninstall things changed with STRING_SET, but now it will.

 

BTW, if you just want to restore your TLK file, why not just copy over the unmodded copy and then reinstall any mods?

Link to comment

Unless you install the exact same components of the exact same mods, in the exact same order, all the strings will be different and half the text in the game will make no sense. I want to be able to preserve changes I've made to the first 74,000 strings (which don't change between installs) whenever I add or remove mods.

 

In other words, I know the strrefs of the changes, and I know the text I want to change them to; I just need an easy way to patch a dialog.tlk file with those changes. I understand that the WeiDU STRING_SET command is supposed to do this; but every time I try to do it I get a fatal syntax error. I have a 'test.tp2' file with these contents:

 

STRING_SET 1 ~testing WeiDU~ []

 

Then I go to the command line and enter this:

 

weidu test.tp2 --tlkout test.tlk

 

That's as simple a test as I can come up with, and it keeps choking. What am I not getting?

Link to comment

A) --tlkout designates an existing TLK file to write to; you cannot create a new TLK file

B) --traify-tlk can be used to output the entire contents of the TLK file as a TRA file

C) --make-tlk can be used to turn a TRA file into a TLK file

D) --tlkcmp-* outputs a concatenated TP2 and TRA file (you need to place the TP2 portion in one file, specify the BACKUP, AUTHOR, and LANGUAGE directives, and you need to place the TRA portion in a separate file and make sure the LANGUAGE directive points to it)

 

If I understand what you're trying to do correctly, I'd suggest you just --traify-tlk the original DIALOG.TLK (74,106 strings), make your changes, and then use --make-tlk to create a new DIALOG.TLK (make sure you don't delete *any* strings from the TRA file). When you go to install, uninstall, or re-install mods, your TLK file shouldn't need to be modified (unless you somehow delete or corrupt the TLK file, or you completely re-install the game, there shouldn't really be a need to ever modify it).

Link to comment

Or, to save a step, since I have a modded version of dialog.tlk with my changes in the first 74,106 strings, could I try

 

weidu --traify-tlk --max 74106 --out new.tra

 

and then use --make-tlk to turn that back into a dialog.tlk?

 

Alternatively, if I'm reading the WeiDU documentation right, I think I could maybe use the --automate command. Most of my dialog.tlk tweaks are simply edits to reflect changes made to various items in the game. I have all the modded items in a folder. So I could use --automate with reference to that folder and my modded dialog.tlk to create a .tp2 file that would have lines like this for each item:

 

COPY ~MyMod/SomeFolder/potn52.itm~  ~override/potn52.itm~         
 SAY NAME ~Potion~ 
 SAY NAME2 ~Potion of Extra Healing~ 
 SAY UNIDENTIFIED_DESC ~Potions are typically found in ceramic, crystal, glass,
   or metal flasks or vials.  Flasks or other containers generally contain 
   enough fluid to provide one person with one complete dose to achieve the 
   effects of the potion.~ 
 SAY DESC ~When wholly consumed, this potion restores 18 hit points to the 
   person. The effect is instantaneous and the potion is destroyed in the 
   process.~ 
 SAY 0xde ~Gulp!~ [GULP]

 

This would work IF those 'SAY' commands create new strings and apply references to those new strings to the item. Which means the old strings would still be in the final dialog.tlk; they would simply not be referenced. Is that right?

Link to comment

I've never used the max command, but yes, it sounds about right. You can alternatively just open the resultant TRA and delete everything past 74,106 (you just can't delete any of the default strings, else you risk wreaking havoc in-game).

 

If *all* of your changes affect only item and/or spell descriptions then, yes, you can use automate if you've exported the changed items already. Be aware that this will create new versions of every item where you change the description in the override folder; the only difference in these items will be the string references.

 

If you're familiar with TP2 files, you can go ahead and use the output from --tlkcmp to just set the strings you've changed in the TLK file (you don't even have to use a TRA file; if you have a decent text editor, you can simply replace ^@(\d+) += ~ with STRING_SET \1 ~ and then just include use the "TRA portion" as your TP2 file). This will save you from having to dump all the ITMs (which may possibly be overwritten by other mods, unless you install your mod last) to the override folder.

Link to comment

Archived

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

×
×
  • Create New...