Skip to content

How do I add an item to a shop?

KaitekKaitek Member Posts: 43
edited April 2016 in BG:EE Mods
I want to add an item to Maltz's shop (from TeamBG mod), how do I do that with Near Infinity? I've put the .itm file in the override folder and I know how to find Maltz's .sto file within the editor but the item itself is called "Who're you?" so I'm confused, the item's name should be Scarlet's Ninja-To +3 (from Joluv mod).

Comments

  • lunarlunar Member Posts: 3,460
    edited April 2016
    You can't just drop an item file and expect the game to recognise it. All text, item name and description texts are referenced via dialog.tlk. Mods patch dialog.tlk and add new lines while installing. If there is a conflict or if the mod is not installed properly or when the game version changes, line references get all mixed up and you end up with random text in item names and descriptions.

    Use dltcep. Open up the item, choose a new string for its name and description, and edit its name and description to whatever you wanted to, save it, it should create new lines for the item and thus patch dialog.tlk. Then use dltcep again and open up the store you want to edit, there should be 'add item' to the store, click on it, it adds a blank item, choose your item from 'browse' section and add it.

    Note that dltcep might not be able to access dialog.tlk. My old version can not, because it still looks for it in the main game folder like it was in bg2. In bg:ee dialog.tlk (the super important file in which all-game text, item descriptions, dialogues, etc. Are stored) is in languages folder and eng folder. So copy the dialog.tlk from there to main game folder where chitin.key is, edit your item, dltcep will patch the dialog.tlk you just copied. Now copy this patched, new dialog.tlk to language/eng folder to replace it, so the game can recognise it. In summary:dltcep can not read dialog.tlk from language folder and the game can not acknowledge dialog.tlk file from anywhere but the language/eng folder so this is a workaround. If the new version of dltcep can see dialog.tlk in language folder no need for that.
  • KaitekKaitek Member Posts: 43
    Thanks for a detailed reply, I'll try and use dltcep next time. I was impatient so I tried something different instead, it seems to work perfectly. Instead of adding this new item I just edited an existing item (another Ninja-To from the same shop), I simply copied over Scarlet's ability and effect lines and then edited the item's name and description (which required an overwrite of dialog.tlk). I bought and tested the weapon and it seems to work perfectly, including the poison on hit effect and the extra attack that it gives.

    I made a backup of my dialog.tlk though just in case, I didn't know it stored so much info about the game. Will I have problems with my dialog.tlk because of this?
  • shevy123456shevy123456 Member Posts: 265
    > but the item itself is called "Who're you?"

    Aha! I have had similar odd string messages, installed by some mods, and
    I never fully understood how that came about. Some mods work very well
    whereas other mods seem to cause such issues. I am currently re-building
    my own internal listing of mods and their installation order - so far in the
    first ~10 or so I have found no issue.
  • shevy123456shevy123456 Member Posts: 265
    Is there a way to modify the binaries as-is without that editor?

    I would ideally prefer to solve this programmatically so I can
    use commandline scripts for that.
  • jmerryjmerry Member Posts: 3,881
    You could do things the same way mods do, with WeiDU code; adding an item to a shop is a simple command ADD_STORE_ITEM.

    Then comes the string stuff. You see, text in these games is not stored in those individual binary .itm and .sto files; it's stored in a master list dialog.tlk, and the individual binary files have numerical fields that reference that list. Obviously, BG2-only strings like the name and the description of that sword won't be in BG1; those will need to be added. Which is another simple WeiDU command; SAY adds a string to the master list and puts its reference number in the field you're pointing at.

    Finally, there's another wrinkle to BGEE modding. Some distributions of SoD package the additional content in a "dlc" archive. Which then needs to be unpacked before any mod that changes the tlk, or it'll override your changes. So that means that, on some distributions of BGEE with SoD, you need to run DLCMerger before your mod.
Sign In or Register to comment.