Page 1 of 1

[2.0.71] accessing the user set description of items throws errors most of the time

Posted: Tue Oct 21, 2025 10:37 pm
by SunBlade
Issue
the user can "freely" set the label and description of items of prototype 'item-with-label' and its child prototypes.
i suspect a typo in the lua binding for description and the derived documentation, since description should be a copy/paste of label with minor changes.


How to reproduce/test
  1. put a blueprint book, blueprint, deconstruction planner and upgrade planner in your main inventory.

    Code: Select all

    /c local inv = game.player.get_main_inventory()
    inv.clear()
    for k,v in pairs{"blueprint-book","blueprint","deconstruction-planner","upgrade-planner"} do
    	inv.insert(v)
    end
  2. reading/writing the custom label works:

    Code: Select all

    /c for k,v in pairs{"blueprint-book","blueprint","deconstruction-planner","upgrade-planner"} do
    	local itm = game.player.get_main_inventory().find_item_stack{name=v}
    	log(serpent.line(itm.label))
    	itm.label = itm.name
    	log(serpent.line(itm.label))
    end
  3. reading/writing the custom description does not work:

    Code: Select all

    /c for k,v in pairs{"blueprint-book","blueprint","deconstruction-planner","upgrade-planner"} do
    	local itm = game.player.get_main_inventory().find_item_stack{name=v}
    	log(serpent.line(itm.custom_description))
    	itm.custom_description = itm.type
    	log(serpent.line(itm.custom_description))
    end

Addendum
if i am mistaken and custom_description is really something entirely else that only 'item-with-tags' provides additionally to the user set description,
then this post is a scripting feature request.

Re: [2.0.71] accessing the user set description of items throws errors most of the time

Posted: Tue Oct 21, 2025 10:48 pm
by Rseding91
"custom_description" is unique to item-with-tags, what you're referring to with blueprints and blueprint books is blueprint_description https://lua-api.factorio.com/stable/cla ... escription

Re: [2.0.71] accessing the user set description of items throws errors most of the time

Posted: Tue Oct 21, 2025 11:03 pm
by SunBlade
ok, i missed that. that works for BPs and books.
i assumed since label is a common property of all 'item-with-label' including subtypes, description would be the same.
so, how do i access the description of deconstruction planner and upgrade planner?

Re: [2.0.71] accessing the user set description of items throws errors most of the time

Posted: Tue Oct 21, 2025 11:23 pm
by Rseding91
It looks like there is currently no way to do that.

Re: [2.0.71] accessing the user set description of items throws errors most of the time

Posted: Wed Oct 22, 2025 2:19 am
by SunBlade
tests
i did some tests on:
blueprint
blueprint-book
copy-paste-tool
deconstruction-item
item-with-inventory
item-with-label
item-with-tags
selection-tool
spidertron-remote
upgrade-item
as LuaItem, LuaItemStack and where possible also LuaRecord.

as i suspected, label is a runtime overwrite for localised_name and works on the whole 'item-with-label' tree unconditionally. but is completely missing on LuaRecord.
the user can manually change the label for only 'blueprint', 'blueprint-book', 'deconstruction-item', 'item-with-inventory' and 'upgrade-item'.

the user customisable description for 'blueprint', 'blueprint-book', 'deconstruction-item' and 'upgrade-item' is displayed additionally to localised_description.
blueprint_description gives access to the user customisable description for only 'blueprint' and 'blueprint-book'.

custom_description gives access to the runtime overwrite for localised_description for only 'item-with-tags'.
my requests
use case
  • my Personal Book would greatly benefit from the ability to compare and change user customisable descriptions. (the only thing missing to check BP items for equality)