[0.15.34] LuaItemPrototype.localised_description no fallback

Bugs that we were not able to reproduce, and/or are waiting for more detailed info.
Post Reply
User avatar
BluePsyduck
Burner Inserter
Burner Inserter
Posts: 13
Joined: Thu Jun 08, 2017 4:52 pm
Contact:

[0.15.34] LuaItemPrototype.localised_description no fallback

Post by BluePsyduck »

I encountered some odd behavior when accessing the localised values of the item_prototypes within a mod, but I am not sure if this is actually a bug.

The localised_name of the items seem to fall back to the entity names, if the item is placeable as entity. But the localised_description does not fall back to the entity description.

Example using the rocket silo:

Code: Select all

# control.lua
script.on_init(function()
    for _, item in pairs(game.item_prototypes) do
        if (item.name == 'rocket-silo') then
            print('NAME: ' .. item.localised_name[1])
            print('DESCRIPTION: ' .. item.localised_description[1])
            assert(false)
        end
    end
    assert(false)
end)
log wrote:NAME: entity-name.rocket-silo
DESCRIPTION: item-description.rocket-silo
Here you see that the rocket-silo tiem has the localised name "entity-name.rocket-silo" (i.e. it fell back to the entity), but it still holds on to "item-description.rocket-silo" (which does not exist) rather than also falling back to "entity-description.rocket-silo" (which actually exists).

Intended behavior or actual bug?
Image

Rseding91
Factorio Staff
Factorio Staff
Posts: 13175
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.15.34] LuaItemPrototype.localised_description no fallback

Post by Rseding91 »

That's currently intended although there's no reason for it to work one way or the other. If someone has a good reason to make it work one way or the other I can change it but I've never seen anyone complain before.
If you want to get ahold of me I'm almost always on Discord.

User avatar
BluePsyduck
Burner Inserter
Burner Inserter
Posts: 13
Joined: Thu Jun 08, 2017 4:52 pm
Contact:

Re: [0.15.34] LuaItemPrototype.localised_description no fallback

Post by BluePsyduck »

The only reason I can give to change it is consistency: Why is the name of the entity used, but not the description? For me it would be more logical if either both values are taken from the entity, or none.
Image

Post Reply

Return to “Pending”