Skip to content

Item Mod Database?

shevy123456shevy123456 Member Posts: 203
edited December 2023 in BGII:EE Mods
So recently I re-installed everything, dropping various mods in the process.
I have fewer issues now, so something seems to be messed up in regards to
some mods containing errors, in regards to some other mods (e. g. each individual
mod being find, but install two mods and suddenly you have one overwrite or
mess up things in the other) . Anyway, this is just an introduction there.

A few items have this messed up string description again where apparently
another mod overwrite the content. But that got me thinking, actually ...

a) do we have a global items database?
b) can we re-shuffle in the original item and effect?

Today I actually ran into a bug with this. The keyring installed by
one mod (SoD-to-BG2EE-Item-Upgrade mod) actually had that bug where
when I would open it, it would show a wrong string - and it would
also NOT show ANY content. Aka no key was there.

I paid the 15.000 gp for going into chapter 3 or so, and I put the
key (I think) which you need to access the shadowthief backdoor
into the keyring. When I then went to the location, I could not
open it; and I saw that nothing was in the keyring (or, rather,
I could not see it there).

That actually got me thinking about an item mod database, or rather
a database for ALL items.

So here is my thinking: the item description, including the functionality
of an item (container content) must be somewhere.

This may perhaps be turned into some binary and inserted into the game
data files (wherever these are).

So, IF a mod inserts a wrong entry somewhere, in THEORY we should be able
to catch it, right? At the least for mods, we have this information
already, because if you download the .zip file for a mod, and extract
it, all the information inside of the mod is there still, right? So we
know how the item SHOULD be in a pristine condition, aka before it is
installed.

Now what could be done here:

For instance, weidu could check before doing an insert operation, aka
appending the item as-is, to check if it is at the right place, if
it has the correct description and so forth.

Since we know ALL the original files AND the new files and data from
the installed mods, we could then, in THEORY, have a database that can
act as "sanitizer", that is, a database that can be used to check
whether a mod installs into the right place or whether it installed
into the wrong place.

We could then have an per-item fixer, like "item in shop xyz is messed
up, please auto-correct this"; so that should then work. Right?

It may be that I have not understood how data is updated for the game,
but that's my thinking right now. Perhaps some tool already helps here,
but the tools I saw are not so great, so I may have missed that.
Ideally I'd also need to do so from a commandline variant, as I can
actually automate all such things via the commandline (I use Linux
most of the time, but I also use ruby and a custom shell for all
actions on windows, so patching and modifying things on windows
is also easy for me, but I first need to know how to do so, and what
has to be changed; right now I am still rather early in my quest
to understand things. I did read up quite a lot, in particular
on https://gibberlings3.github.io/iesdp/ which seems to be by far
the best resource, but I still don't fully understand how weidu
updates content into the data files, so my assumptions may be
incorrect.)

Any information as to how weidu - or even non-weidu - updates
item content and handles items in general is appreciated. I had
a look at some item mods (I want to build a mega-item mod one
day), but the individual mods seem to handle things differently,
and I don't fully understand how to create or change .itm files
really. It seems people use a specialized tool, but I haven't found
that many guides in this regard.)

Comments

  • jmerryjmerry Member Posts: 3,853
    On how mods in general handle adding items? OK, I can do that.

    The game has a multitude of little binary files, normally packed up in archives. But then there's the "override" folder; anything you put there gets used instead of whatever's in the archives.* So you package a copy of the item file with your mod, and copy it to the override. Which in WeiDU is the COPY command.

    But that's not the end of things. Because, as it happens, the game's text is not stored in those little binary files, but instead in one big master list (dialog.tlk). When the game needs a string, it references that list with a number. For example, the string "Key Ring" is #69413 in (English) BGEE. If you're copying an item to a new game ... well, the strings for stuff like the item name and description aren't going to be in that master list, and the old number references are going to be wrong. Continuing that example, string #69413 in (English) BG2EE is "Speak if you must, but make it quick". That brings us to WeiDU's SAY command - add a string to the master list, put its reference number here in this file. And other variants for when you need to do something else with that number.

    Anything else? Well, yes. Containers add an extra wrinkle; there's also a "store" file for the contents of the container, which must have exactly the same resource name as the item. So bdkeyr.ITM is paired with bdkeyr.STO, and you need both of those for the container to be functional. That "store" has its own strings which also need to be updated, of course.
    And then there's stuff like icons - need to copy those resources over if they might not be present.

    All of this ... a mod may start by just copying an item over, but any mod worth its salt is then going to modify that item in code, if only to get the strings right. And those new strings are going to be numbered differently for everyone. And that doesn't take into the account tweak mods and the like, which may go over those items and make changes - for example, my tweak mod has a component that modifies any poison-curing ability to also cure the Green Slime effect. Or mods that create new stuff by cloning an existing item and modifying it. I can't see your idea being feasible, because it's fundamentally based on a false premise.
Sign In or Register to comment.