Skip to content

dialogue.tlk file troubleshooting; solving problems you might have

sarevok57sarevok57 Member Posts: 6,025
so i've been messing around with some IE modding lately and i have made some discoveries that i will lend to the interwebs so at least i will be out there so you don't have to go through the same problem i did;

editting dilalogue.tlk files:

you can use NI ( Near Infinity ) if you desire but you can mess things up quite nicely so i will give a tip later on how to use it best so you dont corrupt your file

but first;

there is another program i started using called; talk table editor and it works perfectly fine so far, i've had no troubles with it ( been using it to work on IWD stuff ) and its been a non dialogue file breaking experience so far, so if you want to use that by all means ( i will add the file at the end of this discussion )

although tip for using the above program: make sure Near Infinity or EE keeper or any other tool modding application is not open at the same time to make sure you don't corrupt your file, what i do is:
open note pad, put the stref reference in first, then the string in afterwards, if you do this, this should minimize your corruption to zero....

now NI, i used this program a lot back in the day, and after fighting it's wonkiness with the dialogue.tlk file editting, i was able to add and edit around 2000+ lines and have everything be fine....

so here is how to use NI to edit dialogue.tlk files and not corrupt them ( or at least again, hopefully next to 0% of doing so )

number 1, holy jumpins, SAVE YOUR ORIGINAL tlk file, you will thank yourself later if all else goes to hell, this makes it so you can at least start from ground 0 as opposed to wiping everything

number 1.b make back ups of your edited versions - this can be a life saver of tons of work and time, i say every day that you work on your mod, save a copy of your days work in a different folder, so if half way through your project things mess up, you can hopefully go back to a time before things went sideways, again THIS IS A HUGE time saver if things go bad

number 2 DO NOT, and for the love of god DO NOT have more than 1 instance of your dialogue file open, this is the easiest way to mess it up completely

number 3, im going to repeat this again for its importance; DO NOT, and for the love of god DO NOT have more than 1 instance of your dialogue file open, this is the easiest way to mess it up completely

number 4, know what, i dont think it has set in yet, and its really important, so im going to say it again: DO NOT, and for the love of god DO NOT have more than 1 instance of your dialogue file open, this is the easiest way to mess it up completely

number 5, okay now i think you get it, but from my experience in the past i want to say that 95+% of the time the reason why my .tlk file got all wonky is because i had 2 NI's open with 2 dialogue file editors going and things went sideways at warp speed, so make sure not to have 2 of them open

number 6, in fact, speaking about having programs open, ONLY, and ONLY keep one instance of NI on for the game that you are modding

for example; messing around with files for IWD using NI, good, but dont have 2 or more of those instances on, even if you are using one dialogue editor, all you are doing is increasing the chance to mess things up even further so stap

number 7: the BEST way to use the dialogue editor with NI is thus: -follow steps 1 through 6 flawlessy- THEN when you edit even ONE stref reference, SAVE then CLOSE the dialogue editor, when you go to edit your next stref reference, you will open the editor, do your edit then SAVE then CLOSE the editor. after you have done your edits and to make sure they are truly locked in, close then entire program ( near infinity itself ) then open it up again and check whatever file you were messing with ( without going into the dialogue editor ) to see if it saved properly, chances are that it should, and then go on your merry way using this strategy

now some extra IMPORTANT TIPS, this is the "trouble shooting" part were i found 2 HUGE hic cups with the dialogue file editor so LISTEN UP

number 1: DO NOT have EE keeper open when you are editing ( or attempting to edit ) your dialogue files, because they WILL NOT save at all, somehow EE keeper interferes with NI so DO NOT have both programs on at the same time if you want to use the dialogue editor

number 2: this one i just found out by accident and thank jeebus i didnt just delete everything in frustration because i figured out why this is happening: for the love of god DO NOT, DO NOT, DO NOT touch the .2da file:

ENGINEST.2da

all i did was add in one line for x10 back stab multiplier and everything went wonky and i swore my dialogue.tlk file was to blame but it was not, because i added that extra line in ENGINEST.2da the game didn't know what was happening and shifted ALL THE engine strefs one below each other, messing up everything, so....

DO NOT TOUCH: ENGINEST.2DA

and seriously, notepad is your friend use that a lot, so you can do a bunch of copy paste edits in one go to have the least amount of editing programs open at once

number 3: this one is important as well, IF for some reason, you have more than one dialogue editor open at once ( sometimes NI just does this if you don't make a new stref and then save and close ) now IF you damn made sure you SAVED and then CLOSED the application and go to close NI, sometimes there will be a dialogue editor bug and it will ask: do you want to save any new changes before closing ( or something like this ) ALWAYS say no, because what is happening is that somehow NI had "2" instances running at once, and if you say yes, there is a good chance of messing up your stuff, so just like drugs kids, always say NO when it asks to save any new changes ( if you are using the SAVE and CLOSE technique from above then this shouldn't be necessary anyway )

and there you have it, if people have found any other bugs or strategies for editing dialgoue tlk files for the IE games, this is definitely the post to put it in

Comments

  • argent77argent77 Member Posts: 3,532
    Don't use two or more instances of NI at the same time when editing the string table. It confuses the string cache and will indeed corrupt the string table if you modify and save the string table in the second instance too.
  • argent77argent77 Member Posts: 3,532
    sarevok57 wrote: »
    number 2: this one i just found out by accident and thank jeebus i didnt just delete everything in frustration because i figured out why this is happening: for the love of god DO NOT, DO NOT, DO NOT touch the .2da file:

    ENGINEST.2da

    all i did was add in one line for x10 back stab multiplier and everything went wonky and i swore my dialogue.tlk file was to blame but it was not, because i added that extra line in ENGINEST.2da the game didn't know what was happening and shifted ALL THE engine strefs one below each other, messing up everything, so....

    DO NOT TOUCH: ENGINEST.2DA

    The game engine fetches ENGINEST.2DA entries through so called "virtual string references". They are based on the row indices in the ENGINEST.2DA table. You can safely add new entries, but they have to be added to the end.
  • sarevok57sarevok57 Member Posts: 6,025
    argent77 wrote: »
    sarevok57 wrote: »
    number 2: this one i just found out by accident and thank jeebus i didnt just delete everything in frustration because i figured out why this is happening: for the love of god DO NOT, DO NOT, DO NOT touch the .2da file:

    ENGINEST.2da

    all i did was add in one line for x10 back stab multiplier and everything went wonky and i swore my dialogue.tlk file was to blame but it was not, because i added that extra line in ENGINEST.2da the game didn't know what was happening and shifted ALL THE engine strefs one below each other, messing up everything, so....

    DO NOT TOUCH: ENGINEST.2DA

    The game engine fetches ENGINEST.2DA entries through so called "virtual string references". They are based on the row indices in the ENGINEST.2DA table. You can safely add new entries, but they have to be added to the end.

    ah, good to know

    although if you add new entries will they appear in game?

    for example, if i add the entry for x10 backstab multiplier will it actually work?
  • Gel87Gel87 Member Posts: 298
    edited February 26
    Yo, sometimes when i forget to put down near infinity while playing the game or installing a mod, many dialog files will be corrupted. Usually profience tables. Also had same issue with eekeeper before and now i dont even have that program.

    But i have a simple fix when many dialog files gets wield and random:
    With ur mod, install a baldur.bcs file. Can be a super simple one, does not matter what it is.
    When you install that Baldur.bcs file, and then uninstall it again the game will refresh itself as a new install.
    Ideally this should just be a single mod, preferable placed outside of baldurs gate folder and then place within when needed.
    Easiest way i found for new install. I know this works on Beamdog version of game at least. Dno about steam and gog versions.

    Example(Code may be wrongly written below as im a noob and dont have a reference where i am now) :
    THIS FIX WILL ALSO REMOVE ALL CURRENTLY INSTALLED MODS. SO MAY AFFECT SAVEGAMES.
    //FixGame.TP2
    BACKUP ~GelFix/backup~
    AUTHOR ~Gel87~
    
    VERSION ~v1.0~
    
    BEGIN ~Install Dialog String fix~  
    COMPILE ~GelFix/Scripts/Baldur.BAF~ ~Override~
    

    //Baldur.baf
    IF
        Class(Player1,RANGER)
        Global("GelFix1","GLOBAL",1)  //A global value that dont exists and never will come true
    THEN
        RESPONSE #100
            SetGlobal("GelFix1","GLOBAL",0)
    END
    

    Anyway, since i need to know and this seems like something people would love to know when making dialogs:
    Im going to add Stalker Gloves to the game with the mod im currently making. Only to bg2ee ofc, as they already exists in Sod.
    So i added them to Valgyar. (all 5 creatures of him). by the standard code. Worked fine for baldurs gate 2. But then i installed it into
    BGEE ofc that creature was missing and it failed the entire installation. So after several searches online, back and forth with chat gpt i was finally able to make a code that installed into BGEE with a "IF game include ~BG2EE~"
    Next problem will be the upgrade im supposed to add to Cromwell with stalker gloves + ankegg shell.

    So in this topic, some simple usefull weidu commands would be fitting to inform:
    How to choose only for a game(incase creature or dialogs dont exist in current game you install into)
    How to append bottom/top etc and which one to use.

    Because that i wonder about. I have the item mod, dno if im going to use it atm, but if your making a change to a dialog which other mods has made changes to, is it not best practice to copy existing and add bottom or top?
    I know to little how this works :P Any pointers?

    I also have a issue with spells having a string.
    Lets say i copy a blind spell from BG1, turn it into a innate albility etc. It contains a string to say "Blinded" when enemy fail saving throw. This ofc then works in bg1, but when i install mod to BG2EE it will use most likely the same string number, but then the string number will have a long "BLABLABLAL in the year of BLABLABLA etc text" when enemies are blinded.
    How can i make this smooth?
    A simple copy of Creeping doom from baldurs gate 1 to baldurs gate 2 will name it Geni in baldurs gate 2. This i know how to fix by SAY NAME and SAY DESC, but I have no idea how to add a string when enemies fail save which says blinded...

    And something wrong also happened when i made a smokebomb spell with projectile last evening.
    I already had custom shurikens (Ninjastars). But when I assign projectile to Smokebomb, all the versions of ninja star also got that projecile....

    Was wierd.

    Example, why do both both GelNin22.spl and GeShur1.itm get the GelSmok projectile in this instance? :
    // Copy Spell
    ADD_PROJECTILE ~GelNinj/PRO/GelSmok.PRO~
    COPY ~GelNinj/Spells/GelNi22.spl~ ~Override~
    	SAY NAME1 ~Black Powder Smoke Bomb~ // Unindentified name
    	SAY NAME2 ~Black Powder Smoke Bomb~ // Identified name
            SAY DESC ~~
    	WRITE_SHORT 0x098 ~%GelSmok%~
    
    // Copy items
    ADD_PROJECTILE ~GelNinj/PRO/GelShur.PRO~
    COPY ~GelNinj/Items/GelShu1.itm~ ~Override~
    	SAY NAME1 ~Ninja Star~ // Unindentified name
    	SAY NAME2 ~Ninja Star~ // Identified name
    	SAY UNIDENTIFIED_DESC ~The ninja star has 4 pointed, double-edged blades.
    STATISTICS:
    
    Damage: 1d8 (slashing)
    Speed Factor: 2
    Proficiency Type: Dart
    Type: One-handed
    Requires:
     3 Strength
    
    Weight: 0~
    	SAY IDENTIFIED_DESC ~The ninja star has 4 pointed, double-edged blades.
    STATISTICS:
    
    Damage: 1d8 (slashing)
    Speed Factor: 2
    Proficiency Type: Dart
    Type: One-handed
    Requires:
     3 Strength
    
    Weight: 0~
    	WRITE_SHORT 0x098 ~%GelShur%~
    
    Post edited by Gel87 on
  • argent77argent77 Member Posts: 3,532
    edited February 26
    sarevok57 wrote: »
    argent77 wrote: »
    The game engine fetches ENGINEST.2DA entries through so called "virtual string references". They are based on the row indices in the ENGINEST.2DA table. You can safely add new entries, but they have to be added to the end.

    ah, good to know

    although if you add new entries will they appear in game?

    for example, if i add the entry for x10 backstab multiplier will it actually work?

    Not automatically. You have to code it somehow. Probably somewhere in UI.MENU.

    A virtual string reference is calculated as 0xf00000 + <row index in ENGINEST.2DA> and can be used anywhere in the game.
  • jasteyjastey Member Posts: 2,840
    It is no problem to have Near Infinity open when installing a mod (with weidu).
    You have to refresh NI's tree after that, though, or it will work with "scrambled" ressources.
Sign In or Register to comment.