optimized-decorative entities can't be created

Place to get help with not working mods / modding interface.
sparr
Smart Inserter
Smart Inserter
Posts: 1521
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

optimized-decorative entities can't be created

Post by sparr »

I've encountered this problem in two mods now. They used "decorative" in 0.13 and I'm trying to use "optimized-decorative" now. Here's one sample entity prototype:

Code: Select all

    {
        type = "optimized-decorative",
        name = "belt-overflow-indicator-tall",
        flags = {"placeable-neutral", "not-on-map"},
        icon = "__belt-overflow__/graphics/indicator-tall.png",
        collision_mask = { "ghost-layer"},
        subgroup = "grass",
        order = "b[decorative]-b[belt-overflow-indicator-tall]",
        collision_box = {{-0.4, -0.9}, {0.4, 0.9}},
        selection_box = {{-0.5, -1}, {0.5, 1}},
        selectable_in_game = false,
        render_layer = "wires",
        pictures = {
            {
                filename = "__belt-overflow__/graphics/indicator-tall.png",
                width = 32,
                height = 64
            }
        }
    },
When I try to create an entity from this prototype get an error that there is no prototype by that name. This is while I'm working on the Belt Overflow mod. I also had the same problem with the Wreckage Pollution mod. I switched to simple-entity, and that worked, but I'd like to know what's wrong here.
posila
Former Staff
Former Staff
Posts: 5448
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: optimized-decorative entities can't be created

Post by posila »

Hi, optimized decoratives are not entities. They have their own set of functions. I.e. http://lua-api.factorio.com/0.15.5/LuaS ... ecoratives
sparr
Smart Inserter
Smart Inserter
Posts: 1521
Joined: Fri Feb 14, 2014 5:52 pm
Contact:

Re: optimized-decorative entities can't be created

Post by sparr »

I seriously misinterpreted the changelog entry about decorative/optimized-decorative.

Is there a reason I should choose to create decoratives this way rather than simple-entity that doesn't collide with anything?
posila
Former Staff
Former Staff
Posts: 5448
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: optimized-decorative entities can't be created

Post by posila »

I depends what you want to do.
Simple entity is fine for things that that are on map in thousands (so I think belt-overflow-indicator-tall is ok to be simple-entity)
Optimized decoratives should be used for things that are on map in hundreds of thousands or millions.
Post Reply

Return to “Modding help”