From my digging around, this seems related to the changes to entity uris’, since they’re now attached with a #number. Here’s a screenshot where I have 16 total fenses, 2 deployed, and 14 in stockpile.
This also brings up a question about the exact changes that were made to entities now in multiplayer, is there somewhere that documents these changes yet?
Is this the bug with items that disappear? Or for plants? There’s an issue that in some cases the same plant can appear both deployed and undeployed in the town inventory.
I think the “merge iconic and root entities” might not be what you think it is (but I could be wrong)
This code seems to count (“merge”) the number of iconics (undeployed) and the number of roots (deployed) separately, so that there’s only 1 icon in the UI for each form, with the final count (and not one icon per each individual item).
So if you inspect the UI, one icon corresponds to the iconic uri (a path) and the other one to the root uri (an alias). And the “undeployed” message is only added/updated in the tooltip for the iconics.
Perhaps they were merged at some point in the past, but I’ve checked as far as A19 and they always appear separatedly in the UI
This might have 2 possible causes:
Tooltips are not updated in real time. If you close and reopen the inventory UI, the count should update.
If it wasn’t the above, save and load that savefile. Open the console and execute “dump_inaccessible_items”, and check if 2 items were dumped near the banner.
Yes, the reloading does fix the tooltip, but the entries are still separated:
In this case I have 48 regular comfy beds and two are deployed. I’m still thinking the town inventory panel should be showing one entry for all these beds…
It would be logical for them to be combined. Like this, it says you have 46 beds and hovering over the picture tells you that 46 out of these 46 beds are undeployed. Then you have two more beds that have no specific state written in the tooltip. Or it would even make more sense if there was a symbol in the corner of the thumbnail or if the undeployed beds were discolored or something.
var rootUri = uri;
if (uri_entry.canonical_uri) {
rootUri = uri_entry.canonical_uri;
}
That would indeed merge the entries, and I’m not sure why they’re not doing it given the “undeployed” tooltip. It seems like two different people were working on the code (or one person at two different times) with different ideas about how fully the items should be merged. And it’s not like clicking on the items in that view gives you any sort of interactive capability with that item (in which case there would be a reason to keep them separate).
If it’s less confusing for you that way, I’ll make a ticket for it.
You can indeed see how many undeployed items you have by opening the placement menu directly, in the inventory UI you can’t really tell at first glance unless they had different icons.
I think the initial code was simply to clear iconics and root entities and show the count of each, since both exist at the same time for the same item in the inventory, but you can only see one of them (see the list of all entities in the object browser). The same root will always have assigned the same iconic, unlike ghosts, that are created / destroyed every time.
Ahh, I see. I have anoter question (sorry to bother):
is there a way to convert or figure out what the root uri should be (the one with “#number;json” at the end)? Does this number denote your player_id?
So say I have “/stonehearth/entities/furniture/comfy_bed/comfy_bed_iconic.json” but I need “”/stonehearth/entities/furniture/comfy_bed/comfy_bed_iconic.json;"
I’m pretty sure that’s just to get around Javascript not wanting object properties that have a period in them. The uri variable in that code is the property of the container object that indexes the item, but the item itself also has a uri property and that contains the actual uri with the period in it.