Skip to content

Solved! How do I read existing .DLG files in .D format?

BCaesarBCaesar Member Posts: 480
edited May 2017 in General Modding
Near Infinity is great for reading the dialogs and trees, but I would like to be able to read the existing DLG files in .D format to help me figure out how to write things. Supposedly WeiDU can decompile .DLG files into .D files so one can read them, but even following the guide I can't get it to work.

Any suggestions? What's the best way to read in-game dialogs?

Thank you.
Post edited by BCaesar on

Comments

  •  TheArtisan TheArtisan Member Posts: 3,277
    I use Infinity Explorer to read dialogs and scripts.
  • AstroBryGuyAstroBryGuy Member Posts: 3,437
    WeiDU is very simple to use to decompile a DLG file.

    Just place the weidu executable in the game folder (the one with the CHITIN.KEY file for the game) and run it from the command line with the name of the DLG file you want to decompile.

    For example, to decompile Minsc's joined dialog file, MINSCJ.DLG:

    weidu.exe minscj.dlg

    or on OSX:

    ./weidu minscj.dlg

    You can use NI to determine the name of the DLG file you want to decompile.
  • BCaesarBCaesar Member Posts: 480

    WeiDU is very simple to use to decompile a DLG file.

    Just place the weidu executable in the game folder (the one with the CHITIN.KEY file for the game) and run it from the command line with the name of the DLG file you want to decompile.

    For example, to decompile Minsc's joined dialog file, MINSCJ.DLG:

    weidu.exe minscj.dlg

    or on OSX:

    ./weidu minscj.dlg

    You can use NI to determine the name of the DLG file you want to decompile.

    Ok thanks. I put WeiDU.exe in my game folder (the same folder I put all the mods in). And then I double-click on it to open it and it gives me a list of things along with the words Press Enter for more options.

    I type:
    weidu.exe mazzyj.dlg
    and I press Enter, and all I get are the lists or more options (since it says Press Enter for more options). Every time I press enter it gives me more options until is closes. It doesn't recognize what I'm typing.

    So I tried opening WeiDU with the Command Prompt instead but I can't figure out that either. It's in C:\GOG Games\Baldur's Gate II - Enhanced Edition\weidu.exe

    So I open the command prompt and it says C:\Users\Brandon>

    I type cd\ and press enter and it goes to C:\>

    Then after the C:\> I type GOG_Games\Baldur's_Gate_II_-_Enhanced_Edition\weidu.exe and it says it cannot find the path specified. I tried it with spaces instead of underscores and that didn't work. MS_DOS mode is not my thing. The only thing I ever learned how to do on it was play Warcraft I and II and Syndicate, and while after all these years I still remember the commands to run those on my friends computer, I'm having no luck with WeiDU. Any help?
  • BCaesarBCaesar Member Posts: 480

    I use Infinity Explorer to read dialogs and scripts.

    Is there a version of it that will work with BG2-EE? I tried downloading version 0.85 and couldn't get it to work and did a quick search and someone said it doesn't work with EE games.
  • argent77argent77 Member Posts: 3,478
    Infinity Explorer doesn't provide more features than Near Infinity when it comes to scripts and dialogs. They may be slightly differently implemented though. The biggest 'advantage' is probably that it doesn't require a Java Runtime Environment installed on your system. But at the same time it runs natively only on Windows. Because of the much lighter feature set it will also not be as resource hungry as NI. Latest version is from 2008 though (so no EE support available).

    If you simply want to inspect dialogs in WeiDU's .D format then you can decompile the .DLG files with the weidu binary following the instructions posted by @AstroBryGuy .

    Assuming the game is located in C:\GOG Games\Baldur's Gate II - Enhanced Edition you can use the following command to navigate into the game folder:
    cd /d "C:\GOG Games\Baldur's Gate II - Enhanced Edition"
    To decompile Minsc's interjection dialogs, execute
    weidu.exe minscj.dlg
    If WeiDU gives you an error message about not having a language set, use this command first to set the language (English in this case):
    weidu.exe --use-lang en_us
  • BCaesarBCaesar Member Posts: 480
    edited February 2017
    argent77 said:

    Infinity Explorer doesn't provide more features than Near Infinity when it comes to scripts and dialogs. They may be slightly differently implemented though. The biggest 'advantage' is probably that it doesn't require a Java Runtime Environment installed on your system. But at the same time it runs natively only on Windows. Because of the much lighter feature set it will also not be as resource hungry as NI. Latest version is from 2008 though (so no EE support available).

    If you simply want to inspect dialogs in WeiDU's .D format then you can decompile the .DLG files with the weidu binary following the instructions posted by @AstroBryGuy .

    The problem is when I open WeiDU I see this:

    [C:\GOG Games\Baldur's Gate II - Enhanced Edition\weidu.exe] WeiDU version 24000

    WeiDU (version 24000: "d41d8cd98f00b204e9800998ecf8427e")

    usage: WeiDU [options] BAF,BCS,D,DLG,TRA,TP,TP2-files

    General Input Options:

    --game X set main game directory to X
    --game-by-type X set main game directory to the one where X is installed
    (BG,BG2,IWD,IWD2,PST)
    --nogame do not load any default game files
    --search X look in X for input files (cumulative)
    --search-ids X look in X for input IDS files (cumulative)
    --tlkin X use X as DIALOG.TLK
    --ftlkin X use X as DIALOGF.TLK
    --use-lang X on games with multiple languages, use files in lang/X/
    --tlkmerge X merge X into loaded DIALOG.TLK

    Press Enter For More Options
    cd /d "C:\GOG Games\Baldur's Gate II - Enhanced Edition"
    --yes answer all TP2 questions with 'Yes'
    --uninstall answer all TP2 questions with 'Uninstall'
    --reinstall reinstall all installed TP2 components
    --language X Set the language to X
    --force-install X installs component X number (cumulative)
    --force-uninstall X uninstalls component X number (cumulative)
    --force-install-rest X Y... installs component number X, Y... (cumulative)
    --force-install-list X Y... installs component number X, Y... (cumulative)
    --force-uninstall-rest X Y... uninstalls component number X, Y... (cumu
    lative)
    --force-uninstall-list X Y... uninstalls component number X, Y... (cumu
    lative)
    --quick-menu X installs the quick menu selection X

    Press Enter For More Options
    -- C:\GOG Games\Baldur's Gate II - Enhanced Edtion
    --process-script X process installation script X
    --skip-at-view kills AT_* ~VIEW this~
    --quick-log Doesn't print the name of components in weidu.log (much faster)
    --safe-exit Prints weidu.log after starting the installation of every compon
    ent
    --version print version number and exit
    --exit print version number and exit
    --no-exit-pause Don't ask to press enter to exit
    --ask-every ask about every TP2 component
    --list-languages X lists the languages in X
    --list-components X Y lists all components in X using language Y
    --save-components-name rewrites weidu.log, printing every component nam
    e

    Press Enter For More Options
    weidu.exe minskj.dlg
    --change-log generates a changelog for the given resource (cumulative)
    --change-log-list generates a changelog for the given resource (cumulative
    )
    --change-log-rest generates a changelog for the given resource (cumulative
    )
    --noautoupdate do not auto-update WeiDU setup files
    --no-auto-tp2 do not run setup-mymod.tp2 even if argv[0] is setup-mymo
    d.exe
    --noselfupdatemsg do not print any self-updating messages
    --update-all auto-update all WeiDU setup files
    --args X X will be stored in the %argv[x]% variable (cumulative)
    --args-rest X Y... X, Y... will be stored in the %argvx% variables (cumulati
    ve)
    --args-list X Y... X, Y... will be stored in the %argvx% variables (cumulati
    ve)
    --print-backtrace prints OCaml stack trace when reporting an exception (ra
    rely of interest to end-users)

    Press Enter For More Options
    And it doesn't seem to matter what I type. I typed all the things you said and all it does is scroll through the options every time I press enter. It doesn't actually do anything. I don't even get error messages.
  • argent77argent77 Member Posts: 3,478
    edited February 2017
    The WeiDU help is displayed when you execute weidu.exe without any arguments (which is always the case when you double click on it in the Windows Explorer).

    As described in previous posts you have to start a command prompt, change into the game directory and execute weidu with the desired arguments.

    Edit: Use weidu.exe directly and not any of the setup-xxx.exe files. These files trigger elevated privileges and therefore execute in a separate environment.
  • BCaesarBCaesar Member Posts: 480
    argent77 said:

    The WeiDU help is displayed when you execute weidu.exe without any arguments (which is always the case when you double click on it in the Windows Explorer).

    As described in previous posts you have to start a command prompt, change into the game directory and execute weidu with the desired arguments.

    Edit: Use weidu.exe directly and not any of the setup-xxx.exe files. These files trigger elevated privileges and therefore execute in a separate environment.

    It worked! Thank you so much for walking me through that.

    For anyone else reading this who wants step-by-step instructions here's exactly what I did (in case you have no experience with command prompt, ms-dos mode, etc.)

    First I clicked on the windows icon in the lower left corner of the screen and searched for Command Prompt.

    Then I opened Command Prompt and I typed: cd /d "C:\GOG Games\Baldur's Gate II - Enhanced Edition"
    The stuff inside the quotes is the path to BG2 on my computer. Yours could be different depending on where and how you bought and downloaded the game. However if you copy weidu.exe into your BG2 folder (the folder that has the chitin.key file) and then open weidu, at the top it will tell you where it is. Whatever it says at the top is what you type inside the quotes, minus the last /weidu.exe

    Then I typed: weidu.exe bmazzy.dlg and hit enter, and mazzy's banter file in .D format was created in my BG2 folder.
  • ArdanisArdanis Member Posts: 1,736
    edited February 2017
    You can also execute those "weidu etc." commands from a .bat file located in the same directory. Just rename a .txt file and double click on it. Handy when you don't want to do a lot of manual typing in command prompt.
  • BCaesarBCaesar Member Posts: 480
    Ardanis said:

    You can also execute those "weidu etc." commands from a .bat file located in the same directory. Just rename a .txt file and double click on it. Handy when you don't want to do a lot of manual typing in command prompt.

    Would you mind spelling out exactly how to do this? I created a blank .bat file in my game folder but when I tried to open it it says that it is not a valid win32 application.
Sign In or Register to comment.