Jump to content

How to WeiDU a dialog file with no TRA's?


Qwinn

Recommended Posts

Okay, the great PS:T WeiDUization project continues.

 

PS:T doesn't do TRA files that I can tell, and I have no desire to do the extra work that would be necessary to make it compatible (there's simply so much dialog in this game that I can't imagine anyone trying to translate it without pay). All I've got here is a dialog.tlk and a dialogf.tlk. So, the tutorials I'm finding out there are all pretty useless to me, because they're all dealing with .TRA's. Same with trying to figure out how to do it by looking at existing mods.

 

What I'm looking to do is take the dialog.tlk that cames with the patched game, and from scratch fix any typos and grammar issues I can find. (Basically, I'm exporting it to a text file and then running Microsoft Word spell and grammar check on it in order to find out what STRREFs the typos and such are. This is pretty painful considering how much text in PS:T is -intentionally- misspelled, but I'm willing to do it).

 

Anyways, once I've identified a typo, how do I fix it with WeiDU? I see the STRING_SET command available, but the readme says don't use it.

 

Could someone please give me a hint of how I should proceed? Here's what I'd like to know:

 

1) Give me an example of how I should fix a typo within a given string?

2) Where would I put the commands to fix the typos in dialog.tlk? Directly in the TP2, or in a .d file, or somewhere else?

3) Does the dialogf.tlk matter? How do I account for it? The dialog.tlk and dialogf.tlk are the exact same size, so I don't know if there's even any differences between them.

4) I could swear I once read somewhere that some utility out there (maybe Near Infinity) has tools for exactly what I'm looking to do here. Any specifics?

 

Any help would be -really- appreciated. Just doing typo and grammar fixes on the dialogue file alone will probably take me a few days, so any hints on a way to make it less painful would be really appreciated.

 

Qwinn

Link to comment
Anyways, once I've identified a typo, how do I fix it with WeiDU? I see the STRING_SET command available, but the readme says don't use it.

That comment may obsolete. When it was written, WeiDU couldn't undo the string modification. Now it can so you can use without preventing proper uninstall.

The BG2 Fixpack is using STRING_SET for the text update component (see gtu.tph file in lib). You may want to use the BG2 Fixpack as an example.

 

The tph is "included" by the TP2 so it behaves as if the tph content was actually inside the TP2 file. So you can write the STRING_SET stuff directly in the TP2 as well. You can also avoid using a @nn reference to a tra file and write the fixed string instead, such as in

STRING_SET mm ~The fixed string~

where mm is the StrRef of the original text.

 

The dialogF.tlk is used with languages where the female version of the text would be different from the male one. In French, you cannot use simple things such as <HIS_HER> to adapt the text and adjectives, for instance, shall adapt. For example, to translate "I'm happy", you shall say "Je suis heureux" for male and "Je suis heureuse" for female. In this case, "Je suis heureux" would go in dialog.tlk while "Je suis heureuse" goes in dialogF.tlk.

With WeiDU, you write that as :

STRING_SET mm ~Je suis heureux~ ~Je suis heureuse~

First the male text then the female.

If there is only one string, WeiDU will apply it to both the dialog.tlk and the dialogF.tlk.

 

Some games have different executables according to countries and some don't recognise the dialogF.tlk, it seems. I don't know for PS:T. But you probably don't need the dialogF.tlk in English.

 

4) I could swear I once read somewhere that some utility out there (maybe Near Infinity) has tools for exactly what I'm looking to do here. Any specifics?

How did you get the text in Word in the first place ? WeiDU has an easy way to extract the text with a simple command:

weidu --traify-tlk --out dialog.tra

And you get all the texts in the dialog.tra file. It's a text file. You can name it dialog.txt if you want and open it with any text editor.

There is also another command to go from the tra/txt form back to the dialog.tlk form. Once it's done, another simple WeiDU command is able to generate all the STRING_SET required to create the TP2 file and allow you to share your fixes.

There is detailed example in the WeiDU documentation.

Check the examples called "Converting one TLK file to another" and "Converting Between TLK and TRA Files".

Link to comment

Holy -crap-, that is incredibly useful information. So glad I asked. THANK you!

 

I've been doing bugfixes in the meantime. Already have 8 bugfixes in my fixpack, using all sorts of different WeiDU commands! ;) And they're tested and they work! ;) *dance dance dance*

 

Currently dealing with the following issue: I'm trying to change the STRREF that a particular reply in an existing dialogue file uses. I could create a new STRREF that looks exactly like an existing one, but I'd rather just use an existing STRREF - that should be possible, shouldn't it?

 

From the WeiDU tutorial, I'm trying this:

 

ALTER_TRANS DMORTE BEGIN 188 END BEGIN 4 END BEGIN "REPLY" ~REPLY #18519~ END

 

But instead of having the reply refer to STRREF 18519, and pull the text from the dialogue file, it is instead creating a new entry in the dialog.tlk with the literal value "REPLY #18519", and replacing the reply with that value. I've tried several variations of the above statement, and none are working. I could just create the entry with the text, but if there's a better way I'd prefer to figure it out before I really get heavily into this. What am I doing wrong?

 

Oh, and I used Near Infinity to export the dialog.tlk file as a text file, and brought it into Word that way :laugh:

 

Qwinn

Link to comment

Huh - never mind! I put the exact string I wanted after the "REPLY" in that ALTER_TRANS statement, and WeiDU amazingly seems to have found an existing STRREF that matches it and used it automatically. That is WAY too cool.

 

Qwinn

Link to comment

Actually, concerning that last issue, for any who find this thread dealing with a similar problem, I found out what the deal was. The tutorial says to repeat the word REPLY (or JOURNAL) within the tildes in the ALTER_TRANS statement, but this will actually cause an error.

 

I reported it over at PPG here:

 

http://forums.pocketplane.net/index.php/topic,25339.0.html

 

 

(Phew, at least one of my early questions wasn't really all that stupid :(

 

Qwinn

Link to comment

Ok, bit of a crisis.

 

At the beginning of my project, I followed the advice in this thread and converted the PS:T .tlk to a .tra file with this:

 

How did you get the text in Word in the first place ? WeiDU has an easy way to extract the text with a simple command:

 

CODE

weidu --traify-tlk --out dialog.tra

 

And you get all the texts in the dialog.tra file. It's a text file. You can name it dialog.txt if you want and open it with any text editor.

 

This is what I did. And tonight, I went and tried to turn it back into a .tlk. Except, rather major problem. When it initially traified the file, it duplicated every carriage return. So now, for example, in every spell description I've got a blank line between every line. This is... bad.

 

I think I can use Word to strip out most of the extra carriage returns, in a somewhat dangerous fashion. But for future reference, was there any way this could've been avoided?

 

Qwinn

Link to comment

&($#*&$(#*&$(*#&$#(*

 

After spending hours fixing the file up, and writing this post...

 

Well, it's finally done, after several hours I got the file sorted with all the blank lines taken out so they look right in the game.

 

Unfortunately, after running weidu --tlkcmp-from X --tlkcmp-to Y on the two files, every line that has even one carriage return is coming up as different between the two files. Thankfully most don't... but still, there's quite a few entries that should be coming up as identical, and -look- identical in NI, but somehow all that carriage-return business makes them different somehow, even after I stripped the extra carriage returns out.

 

Also - every entry in the new .dlg file that I got from my --make-tlk option came out with type 7 - Message with tags, which according to the IESDP is supposed to be BG2 only. Dunno if it matters. I initially thought that's why I was getting such a large differential file and wrote a script to reset the Types to match the original dialog.tlk, but no, that didn't make a difference.

 

Anyways, at this point, with that issue, I've got 1700 differences between the two files. Probably around half of them aren't legit changes, just this carriage return business. I'm going to manually go through and try to get rid of the bogus ones... but, seriously, was there any way I could've avoided this?

 

I tried pulling an original traified file into notepad, one that I'd never edited - and no extra blank lines! Both ConTEXT and Microsoft word are adding them. And once you save in either program, they're permanent, and notepad pulls them up too. GRRRRRR. Sigh.

 

So I tried another test. What happens if I traify a talk file... then pull it up in Notepad, and SAVE it, -then- pull it up in Context. Get this - all carriage returns -except- the ones following each new entry is gone. Carriage returns -within- each entry, all gone.

 

So it would -appear- that when you run the --traify function, there's a difference between the carriage return that comes after each full entry, and the carriage return you get within entries. Notepad pulls it up properly, but strips the ones within each entry when you save. ConTEXT and Word duplicate the carriage returns within entries, and double them up.

 

Gaaaaaah.

 

So, gonna go through the 1700 entries and delete the bogus ones. See ya in a few days. Sigh.

 

Qwinn

Link to comment

Well, if anyone's following this, just found something out after a bunch of testing. It's not MS Word's fault, and it's not WeiDU's fault, it's just ConTEXT doing this. I traify'd the original dialog.tlk, pulled it up in Word (no extra lines), made a single change, turned that file back into a .tlk, ran the differential and it worked great, only the single change came out. The only time I get the extra lines and all the associated problems is pulling it up in ConTEXT.

 

Not sure why ConTEXT is doing this. Anyone familiar with the tool have an idea? I suspect the "Convert Text" option under Tools has something to do with it... it's currently set to DOS (CRLF), but I didn't change it and I certainly don't want it doing any such thing. Anyone familiar with it that can tell me how to get it to stop doing this?

 

Anyways, for the time being, I'm just going to have to ditch my previous files (except for just using them as a reference) and make a new corrected file only in Word, making sure to never pull it up in ConTEXT. Which means reapplying literally hundreds of typo and grammar corrections. But at least I -know- this time it'll work. Ah well.

 

Qwinn

Link to comment

I did exactly that, actually. MS Word allowed me to do things like replace three carriage returns with one, for example, and I fixed a lot of it with that. Other tricks like replacing commonly used words after a line break (like "Damage:" and "Enchantment:" and "Duration:") I got rid of most of the others. Then a couple hours paging through for all the "special:" stuff in the item descriptions.

 

So, I was all done. My file -looked- like it should. And I turned it into a .tlk. And went into NI, and it all looked great. And, despite it looking just like the other, when I went and did tlkcmp-from and tlkcmp-to on them, I still got every entry that had a carriage return. If there was some other character in there making them different, it was invisible to me I'm afraid.

 

I'm a third of the way through reapplying the changes to an uncorrupted traified version of the original, and finding more stuff to fix along the way. That's the one good thing about this, at any rate... none of these passes are totally useless, cause I always find at least a dozen or two more grammar errors every time I do. At least it's something for a couple days work, heh.

 

Qwinn

Link to comment

I do appreciate the offer, Taimon, thanks lots :crazyeyes: And yeah, it would've saved me some time... but truth is, it's actually been pretty productive, taking these additional two passes through the file. I'd say I've increased the number of typos/grammar mistakes I've found and I'm fixing with my fixpack by a good 30% or so as a result, so, it's paid off. Pretty sure I'll be fixing at least three times the number of those as all previous fixpacks put together. Thanks anyway though :groucho:

 

I'm still expecting the simultaneous first release of the PST Fixpack, PST Unfinished Business and Qwinn's PST Tweak Pack by the end of May, if not sooner.

 

Qwinn

Link to comment

cmorgan,

 

You've never played PS:T? ZOMG, I envy ya - I'd love to get to play it again for the first time. Seriously, there's never been another game like it. People have compared it to the NWN2 - MOTB expansion, but honestly I still think PS:T easily wins in that contest.

 

I looked the other day on Ebay, copies were still floating around on there for $25 or so, if you don't have it, I'd definitely order one while they're still around.

 

Qwinn

Link to comment

Archived

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

×
×
  • Create New...