Jump to content

.bat file mass decompilation of .dlg > .d using WeiDU


cmorgan

Recommended Posts

Hey - I have used NI to export all of EasyTutu's dialog into a separate folder.

 

I now want to decompile them using the c:\Black Isle\BaldursGateTutu chitin.key, dialog.tlk.

 

I want the information to be as complete as possible.

 

I ran a variation of the following on the full export of the BGII-SoA/ToB vanilla installs, and it worked (though I had to do a second step):

 

decompile.bat

FOR %%A IN (BG2_DLG\*.dlg) DO BG2_DLG\WeiDU.exe %%A  --out BG2_DLG\%%~nxA

This resulted in everything but MONK 8.DLG being batch processed, overwriting the original files. I moved MONK 8.DLG out, and finished off the run, no problems;

 

then changed to the command prompt, browsed to the directory, and

ren *.DLG *.D

cleaned it up.

 

 

Voila - full vanilla set of 4000+ .d files availale for textsearches and context. Cool.

 

Two questions, though -

 

I want more data, and now need to specify the directory to look for the materials. How close is

 

EayTutuDecompile.bat

FOR %%A IN (EASYTUTU_DLG\*.dlg) DO EASYTUTU_DLG\WeiDU.exe %%A --game (c:\Black Isle\BaldursGateTutu\) --full-from --transitive --out BG2_DLG\%%~nxA

 

and can I get the darned mass-read to output with the .D extension?

 

 

Follow up question - I tried

FOR %%A IN (BG2_DLG\*.dlg) DO BG2_DLG\WeiDU.exe %%A  --out BG2_DLG\

and it threw a truncation error, failing to process the files. Since

weidu scarles.d --out BG2_DLG\

should handle this, can someone step me through why my .bat construction logic is failing?

Link to comment
and can I get the darned mass-read to output with the .D extension?

Try

FOR %%A IN (EASYTUTU_DLG\*.dlg) DO (
 EASYTUTU_DLG\WeiDU.exe "%%A" --game "c:\Black Isle\BaldursGateTutu\" --full-from --transitive --out "BG2_DLG\%%~nA.d"
)

(Parentheses after DO not really necessary, unless you specify a group of commands)

You do know that --transitive is potentially dangerous, don't you? (endless loops)

 

Follow up question - I tried
FOR %%A IN (BG2_DLG\*.dlg) DO BG2_DLG\WeiDU.exe %%A  --out BG2_DLG\

and it threw a truncation error, failing to process the files. Since

weidu scarles.d --out BG2_DLG\

should handle this, can someone step me through why my .bat construction logic is failing?

Not sure. Maybe it's the backslash after the directory.

Link to comment
(Parentheses after DO not really necessary, unless you specify a group of commands)

You do know that --transitive is potentially dangerous, don't you? (endless loops)

Heck no, I didn't know that - so the --transitive , while potentially providing more info, is probably overkill anyways, and is possibly dangerous to boot. I don't think I'll go down that route!

 

Not sure. Maybe it's the backslash after the directory.

 

urk - I had better also check to see if a .bat file on WinXP SP3 will allow spaces in filenames...

 

\Black Isle\

 

might choke it up, the same way

 

MONK 8

 

did...

Link to comment
(Parentheses after DO not really necessary, unless you specify a group of commands)

You do know that --transitive is potentially dangerous, don't you? (endless loops)

Heck no, I didn't know that - so the --transitive , while potentially providing more info, is probably overkill anyways, and is possibly dangerous to boot. I don't think I'll go down that route!

I haven't tested this recently, just remembered it from the readme.

 

urk - I had better also check to see if a .bat file on WinXP SP3 will allow spaces in filenames...

 

\Black Isle\

 

might choke it up, the same way

 

MONK 8

 

did...

That's why I put quotes around the variables/parameters.

Link to comment

Got it!

 

Well, almost. The darned .bat is still looking for the wrong dialog.tlk

 

 // creator  : EASYTUTU_DLG\WeiDU.exe (version 20800)
// argument : EASYTUTU_DLG\_ALBERT.DLG
// game		 : C:\Program Files\Black Isle\BGII - SoA
// source	 : EASYTUTU_DLG\_ALBERT.DLG
// dialog	 : C:\Program Files\Black Isle\BGII - SoA/dialog.tlk
// dialogF  : (none)

 

results from using

 

FOR %%A IN (EASYTUTU_DLG\*.dlg) DO (
 EASYTUTU_DLG\WeiDU.exe "%%A" --game "c:\Program Files\Black Isle\BaldursGateTutu\" --full-from --out "EASYTUTU_DLG\%%~nA.d"
)

 

so somehow, I must be incorrectly setting --game. WeiDU is reverting to the registry entries for SoA. The output is perfectly set up, but ends up being a shell of Invalid Strrefs.

 

EDIT\ I cheated it by dumping the dialog file folder and the output folder into the BaldursGateTutu game directory, and running

 

decipher.bat

FOR %%A IN (EASYTUTU_DLG\*.dlg) DO (
 EASYTUTU_DLG\WeiDU.exe %%A  --full-from --out TEMP_DLG\%%~nA.d
)

 

but I would still like to check this out. I strongly suspect my lack of skills, but just in case there is a hitch somewhere else...

Link to comment

Archived

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

×
×
  • Create New...