I've spent a lot of hours over the last five days adding a feature that I've had on my list for a long time: recognizing items and effects that are not in the internal database and figuring out what they do by parsing the description text. Obviously, full support for many items requires more than that: we can't tell what will grow from a familiar hatchling, many item enchantments have hidden formulas, rather than hardcoded constants, "usable" items might or might not be multi-usable (we assume unknown "potions" are multiusable and others are not), and so on. But, this should allow you to use previously unknown equipment in the Gear Changer, autosell new things, get an idea what modifiers they are giving you at the moment, and so on, without the devs having to scramble to enter new things in the database. In fact, all those KoLmafia users who stick with major releases rather than using daily builds will feel even less pressure to upgrade to the latest, possibly buggy, release.
In order to enter an item or effect into KoLmafia's internal database, we need two things: the item or effect id, and the corresponding description id.
There are many places where we are presented with both an item id and the corresponding description id:
- Finding a new item while adventuring
- Searching the mall
- Refreshing your closet
- Looking at inventory (with the exception of equipped items: we can see the description id, but not the item id for such items).
- Looking at storage
- Looking at your clan stash
For all of the above, upon seeing an unknown item, we will look at the description and parse it and enter the item into our internal tables. With the exception of the first - items found adventuring - we will then write override files: tradeitems, itemdescs, and possibly equipment and modifiers.
There are a few places where we can see item ids but no description ids:
- Managing your own store
- Managing your display case
- Perhaps, although I have not tested, inventory with inventory images turned off. I should test this; KoL might still let you click on the item name, say, to get the description.
With the exception of the last one, you will have to have inserted the item into the store or display case outside of KoLmafia for us to have not noticed it in inventory. So, big deal.
There are various places where you can click on items and look at them (using the description id) without having access to the item id. Other people's equipment and display cases, for example.
Effects are a little trickier. About the only place which shows you effect IDs is when you try to "use" a soft green echo eyedrop antidote and are presented with a list of effects it can remove. Unfortunately, although that has little effect pictures, they are not clickable to get the description. We have to look at the charpane to get description ids.
The other half of this change is, as I mentioned, automatically writing override files in your data directory. I went to a lot of effort to ensure that we can write full replacements for the built-in data files; that we can read the files into internal data structures and write files from the internal data structures that are complete functional equivalents to those that were read.
However, you don't want to be stuck using a stale override file if you upgrade to a new build which has more recent data. To cut down on the possibility of that happening, we do the following:
- When we load a data file from the data directory, log it in the gCLI
- If the file in the data directory is stale - older than the one built-in to KoLmafia - don't load it, and log that fact in the gCLI
- When we write an override file to the data directory, log it in the gCLI
This was a big project. It is possible that bugs remain (no!) - beyond the ones that you-all have reported within minutes of one of my submits going in. Please continue to report them.
Comments and suggestions are welcome as well. Thanks.
In order to enter an item or effect into KoLmafia's internal database, we need two things: the item or effect id, and the corresponding description id.
There are many places where we are presented with both an item id and the corresponding description id:
- Finding a new item while adventuring
- Searching the mall
- Refreshing your closet
- Looking at inventory (with the exception of equipped items: we can see the description id, but not the item id for such items).
- Looking at storage
- Looking at your clan stash
For all of the above, upon seeing an unknown item, we will look at the description and parse it and enter the item into our internal tables. With the exception of the first - items found adventuring - we will then write override files: tradeitems, itemdescs, and possibly equipment and modifiers.
There are a few places where we can see item ids but no description ids:
- Managing your own store
- Managing your display case
- Perhaps, although I have not tested, inventory with inventory images turned off. I should test this; KoL might still let you click on the item name, say, to get the description.
With the exception of the last one, you will have to have inserted the item into the store or display case outside of KoLmafia for us to have not noticed it in inventory. So, big deal.
There are various places where you can click on items and look at them (using the description id) without having access to the item id. Other people's equipment and display cases, for example.
Effects are a little trickier. About the only place which shows you effect IDs is when you try to "use" a soft green echo eyedrop antidote and are presented with a list of effects it can remove. Unfortunately, although that has little effect pictures, they are not clickable to get the description. We have to look at the charpane to get description ids.
The other half of this change is, as I mentioned, automatically writing override files in your data directory. I went to a lot of effort to ensure that we can write full replacements for the built-in data files; that we can read the files into internal data structures and write files from the internal data structures that are complete functional equivalents to those that were read.
However, you don't want to be stuck using a stale override file if you upgrade to a new build which has more recent data. To cut down on the possibility of that happening, we do the following:
- When we load a data file from the data directory, log it in the gCLI
- If the file in the data directory is stale - older than the one built-in to KoLmafia - don't load it, and log that fact in the gCLI
- When we write an override file to the data directory, log it in the gCLI
This was a big project. It is possible that bugs remain (no!) - beyond the ones that you-all have reported within minutes of one of my submits going in. Please continue to report them.
Comments and suggestions are welcome as well. Thanks.