[Mod Tutorial] How to make Items
Valendale
Member Posts: 34
Sparing others the pain I went through trying to learn this, this thread is meant to walk you through it step by step and tell you, specifically, how to make items.
First you need to copy your dialog.tlk file to your root directory and make a backup of it. You can find dialog.tlk in \Baldur's Gate II Enhanced Edition\lang\YourLanguageHere. Just move it back to the \Baldur's Gate II Enhanced Edition\ folder.
Next download WeiDU and place it in your \Baldur's Gate II Enhanced Edition folder, I think you can just extract the WeiDU folder there and copy/paste WeiDU.exe but I'm not sure because I copied everything while trouble shooting.
After that, you need to open a notepad or text file and edit it to read something like this. Just copy and paste the following bit to get started, make sure word wrap is turned off if you're using it.
Now you need to download Near Infinity, and if you don't already have it, you'll also need Java to run it. After downloading it with Java installed, extract it to your \Baldur's Gate II Enhanced Edition\ folder, to run it simply run NearInfinity-1.3.0.jar (there may also be a NearInfinity-1.3.0-ci.jar, I'm not sure of any difference). You should be able to find your new item under Override with the file name you gave it.
View gives you an overview, and if you click edit you can easily modify and delete stats and effects. If you want to make the armor usable by anyone for example, click "unusuable by" and uncheck everything on each section. Also if you want to remove any sneak or arcane casting penalties, you can do so by selecting the effects and clicking remove. You can modify it to your liking adding and removing effects and toying with the colors and attributes. It may be best to make a backup of it before you save it if you're not sure, but when you're done just click export.
If you'd like to add it straight to your inventory when starting the game, in your Baldur.ini file after 'Program Options', add
Alternately if all went well you should be able to find your new armor in Ribald's store.
First you need to copy your dialog.tlk file to your root directory and make a backup of it. You can find dialog.tlk in \Baldur's Gate II Enhanced Edition\lang\YourLanguageHere. Just move it back to the \Baldur's Gate II Enhanced Edition\ folder.
Next download WeiDU and place it in your \Baldur's Gate II Enhanced Edition folder, I think you can just extract the WeiDU folder there and copy/paste WeiDU.exe but I'm not sure because I copied everything while trouble shooting.
After that, you need to open a notepad or text file and edit it to read something like this. Just copy and paste the following bit to get started, make sure word wrap is turned off if you're using it.
Rename that txt file something like Silky.tp2. You can open it with your favorite text editor at any time if you right click and select "Open with..." (if extensions like .txt and .tp2 are hidden you may have to enable them in your folder option). Then rename a copy of WeiDU.exe to setup-Silky.exe and run it. This should create a copy chan18.itm and place it in your override folder with the new name and description. You're not done yet though!
BACKUP ~Silky/backup~
AUTHOR ~YourAuthorName, at http://forum.baldursgate.com~ // if you want, you can put your email here instead
BEGIN ~Silver Silk Chainmail~
COPY_EXISTING chan18.itm ~override/Silky.itm~ //note that the total file name, excluding file extension, must not exceed 8 characters.
SAY NAME1 ~Soft Mail~
SAY NAME2 ~Silver Silk Chainmail~
WRITE_LONG 0x1e THIS BAND BNOT BIT29 // Silver Spider Thread
SAY 0x50 ~At first glance it's hard to tell whether this is meant to be used as protection, but the fibers seem strong enough to deflect blows. Maybe someone can help identify it.~ // General description
SAY 0x54 ~The Silver Silk Chainmail was sewn from the webs of silver spiders, offering the protection of mail and the flexibility of cloth. It is believed that such rare vestments originate from a hidden monk sanctuary high atop a mountain at the Spine of the World.~ // Identified description
COPY_EXISTING ~ribald.sto~ ~override~
ADD_STORE_ITEM "Silky" #10 #0 #0 ~IDENTIFIED~ #5
Now you need to download Near Infinity, and if you don't already have it, you'll also need Java to run it. After downloading it with Java installed, extract it to your \Baldur's Gate II Enhanced Edition\ folder, to run it simply run NearInfinity-1.3.0.jar (there may also be a NearInfinity-1.3.0-ci.jar, I'm not sure of any difference). You should be able to find your new item under Override with the file name you gave it.
View gives you an overview, and if you click edit you can easily modify and delete stats and effects. If you want to make the armor usable by anyone for example, click "unusuable by" and uncheck everything on each section. Also if you want to remove any sneak or arcane casting penalties, you can do so by selecting the effects and clicking remove. You can modify it to your liking adding and removing effects and toying with the colors and attributes. It may be best to make a backup of it before you save it if you're not sure, but when you're done just click export.
If you'd like to add it straight to your inventory when starting the game, in your Baldur.ini file after 'Program Options', add
'Debug Mode', '1'IE
'Program Options', 'Debug Mode', '1'Then once you load a game you can hold CLT and press Space bar and inter the following command. CLUAConsole:AddItem("Silky")
Alternately if all went well you should be able to find your new armor in Ribald's store.
Post edited by Valendale on
2
Comments
Second, I'd use this mod template.
Third, I'd go to town on the game with code along these lines: If you want items with magical effects, WeiDU has the functions ADD_ITEM_EFFECT, ADD_ITEM_EQEFFECT and many more. If you want to make your items available for sale, there is the action ADD_STORE_ITEM. You can read about these things, and much, much more, in the WeiDU readme. You will also want to refer to the IESDP for information on file formats and what have you. Near Infinity is also a handy tool that synergises very well with WeiDU.
Lastly, I'd not be afraid to ask questions, because there's a bit of a learning curve and all.
WeiDU seems to do an awful lot and it's indecipherable to me right now, even the readmes are indecipherable. Back on BG2 Vanilla, I believe with one I used Shadow Keeper to copy an item and then a GUI Editor of some sort to edit it and it's description, but that was like 10 years ago and nothing seems to work now. Obviously I have to copy and move files around and stuff but I have no clue exactly what to place where, besides what I needed to move to get Shadowkeeper to run.
WeiDU requires you to create a text file called mymod.tp2 in your game folder, where "mymod" is the name of your mod. Once you have that file, you paste the mod template into it, and round it out with TP2 code that does what you want to do (e.g., the snippet I posted here). Once your TP2 file is in order, you download WeiDU and copy weidu.exe into your game folder. Rename weidu.exe into setup-mymod.exe and you are ready to install. If you have installed a WeiDU mod before, it should be pretty obvious. If you haven't, you should first familiarise yourself with how you install them. Looking at already created mods is also a good way to learn ('course, it's also a good way to pick up bad habits or bad ways of doing things, but that's just how it is).
If you prefer a graphical tool, NI can edit and create items just fine. There is also a tool called DLTCEP that gives you a more abstracted view of the files you edit. Unfortunately, I don't have a download link handy. Neither NI nor DLTCEP will allow you to create a distributable mod, however (for that you need WeiDU).
If so that's one problem solved, and if I can use this exact template with other items, it's a phenomenal help (assuming I can figure out how to make WeiDU run the script) but how do I alter the item's attributes?
!!!
Before I couldn't install a mod because I needed to delete all local content and reinstall the game. Much to my pleasant surprise, this has also made Near Infinity work. I have no clue what strangeness was preventing everything from working before, maybe something downloaded wrong the first time. Thanks for the help!
I mean don't use NI to change descriptions if you want to share your mod with others. In fact item descriptions are stored in DIALOG.TLK instead of the ITM file.
Sharing your DIALOG.TLK with others simply can't be done, because the actual content of this file depends on several factors (game version, other mods, etc.).
Using WeiDU and the command SAY, like in @Wisp example, can solve both problems at once, i.e. you can easily have a different description for the original and the edited item and at the same time your mod will work for others too. In fact WeiDU will be able to update DIALOG.TLK, during mod installation, and in the correct manner for each user of your mod.
It's all really confusing, and the readme is arcane if you don't already have an idea what you're doing.
That way I could add all kinds of nice little surprises and scatter them around to named beasts our hero will kill regardless of alignment.
If it works you'll get the message "SUCCESSFULLY INSTALLED mymod".
I normally create a folder "mymod" containing all the relevant files (including mymod.tp2) and subfolders, except setup-mymod.exe that I put just outside the folder "mymod".
Both the folder "mymod" and "setup-mymod.exe" need to be in the main game directory (i.e. the one with chitin.key in it) for the installation to work.
If you have code like in your tp2 file, then the resulting item will go directly to override.
Then with that file placed in my root directory for /Baldur's Gate II Enhanced Edition, I copy and paste weidu.exe there, and rename it setup-monky.exe and run it.
What am I doing wrong?
Try with something like Also replace "prefix#" above with your actual prefix or, if you don't have one yet, at least something short (2-3 characters max) otherwise it will not work.
Finally, be sure to be in the right folder. In the Enhanced Edition this may not be the root folder. It must be the folder with chitin.key in it.
THANK YOU that's everything I needed to know to get started!
I have few questions:
1. If I use tra-file for description and names of my items, what command should I include in (for example) this code? So, I want not ==SAY NAME1 ~Soft Mail~== but ==SAY NAME1 @100== and my tra is named mytra.tra and located somwhere in mod directrory.
2. What the hell is ==THIS BAND BNOT BIT29== And what it tells to weidu? And for what purpose WRITE_LONG is used here, but not SAY command?
1. Place your TRA file somewhere appropriate inside your mod folder. Use the LANGUAGE statement to have it loaded. LANGUAGE looks like
LANGUAGE English english ~mymod/tra/english/somefile.tra~
and goes after any TP2 flags and before the first component.2. Without getting overly technical, THIS is the value of the field being written to. The whole thing (WRITE_LONG 0x1e THIS BAND BNOT BIT29) makes the item usable by monks, by manipulating the usability bitfield at offset 0x1e. Bit 29 is the bit controlling usability by monks (if the bit is set, can't use the item).
SAY is used for converting strings into string references and writing the value resulting from that conversion. WRITE_LONG writes an integer to a field 8 bytes long (a dword). SAY and WRITE_LONG are similar but not interchangeable.
In the mod template above where would stastical information be written?
bit-flag (very helpful explanation, by the way; I mean this without sarcasm,
the monk no-use bit explanation was very useful).
It's a bit unfortunate that all that information is spread out
all over the world wide web, including the webforum here. I looked
at the WEIDU documentation too, but this one is a bit confusing.
That spellstudio page, on the other hand, is probably one of the
best references I have found so far.
For instance it lists entries such as:
SPWI118 Chromatic Orb
So I can kind of understand that as a mapping, e. g. the filename or
identifier, to the particular spell as such.
The ideal situation would be a complete reference, such as the spellstudio
pages, but also a useful, up-to-date tutorial there. I think so far I found
only two tutorials, but they were not extremely helpful. I kind of need
more of a reference with examples of things that I see in various mods.
Once I understand the format, I think I can autogenerate tons of things.
For instance, in one quest mod the sahuagin or so are listed that way:
FILENAME NAME TYPE LEVEL STR STR+ DEX CON INT WIS CHA HP AC THAC0 APR EXP CLASS KIT APPEARANCE WEAPON1 WEAPON2 QUIVER1 QUIVER2 QUIVER3 MEMORIZATION >
sahkng01 King Ixilthetocal Overridden 20 22 0 9 9 13 9 18 90 5 1 5 4000 Sahuagin none Sahuagin Large Skull none none none none none none 8,10,9,9,11 n>
I am pretty certain I can simply autogenerate such text files, using
data from other files that I already have (from .yml files), due to
prior rpg-related projects I created or noted down. Right now it is
a bit confusing to understand all these macros in use.