[0.18.18] entity_type_filters on deconstruction-item

Place to get help with not working mods / modding interface.
Post Reply
User avatar
moon69
Fast Inserter
Fast Inserter
Posts: 181
Joined: Sun Sep 18, 2016 6:53 pm
Contact:

[0.18.18] entity_type_filters on deconstruction-item

Post by moon69 »

I'm trying to use entity_type_filters on a custom deconstruction-item...

Code: Select all

  {
    type = "deconstruction-item",
    name = "PlannerTest-deconstruction-item",
    icon = "__base__/graphics/icons/hazard-concrete.png",
    icon_size = 64, icon_mipmaps = 4,
    subgroup = "tool",
    order = "zz",
    stack_size = 1,
    selection_color = {1, 0, 0},
    alt_selection_color = {0, 0, 1},
    selection_mode = {"deconstruct"},
    alt_selection_mode = {"cancel-deconstruct"},
    selection_cursor_box_type = "not-allowed",
    alt_selection_cursor_box_type = "not-allowed",	
    entity_type_filters = {"ammo-turret", "artillery-turret"},	
    alt_entity_type_filters = {"ammo-turret", "artillery-turret"},	
  },
but when selecting an area, the above item ignores the entity_type_filters and highlights anything & everything and then marks them all for deconstruction on release.

If I make a pretty much identical item but based on a selection-tool, it only highlights the specified turret types as expected...

Code: Select all

  {
    type = "selection-tool",
    name = "PlannerTest-selection-tool",
    icon = "__base__/graphics/icons/concrete.png",
    icon_size = 64, icon_mipmaps = 4,
    subgroup = "tool",
    order = "zz",
    stack_size = 1,
    selection_color = {1, 0, 0},
    alt_selection_color = {0, 0, 1},
    selection_mode = {"deconstruct"},
    alt_selection_mode = {"cancel-deconstruct"},
    selection_cursor_box_type = "not-allowed",
    alt_selection_cursor_box_type = "not-allowed",	
    entity_type_filters = {"ammo-turret", "artillery-turret"},	
    alt_entity_type_filters = {"ammo-turret", "artillery-turret"},	
  },
I can't figure it out! Any suggestions?

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

Re: [0.18.18] entity_type_filters on deconstruction-item

Post by Rseding91 »

You made the type "deconstruction-item" that overwrites and ignores all other settings you've defined.

You have to make it "selection-tool".
If you want to get ahold of me I'm almost always on Discord.

User avatar
moon69
Fast Inserter
Fast Inserter
Posts: 181
Joined: Sun Sep 18, 2016 6:53 pm
Contact:

Re: [0.18.18] entity_type_filters on deconstruction-item

Post by moon69 »

Thanks R.

The Prototype/DeconstructionItem page on the wiki indicates it inherits entity_type_filters from Prototype/SelectionTool?

Is this changed in 0.18?

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

Re: [0.18.18] entity_type_filters on deconstruction-item

Post by Rseding91 »

No, it's accurate. It just forces them to be empty and so doesn't use them.

Those docs are auto-generated (I think?) and so those kinds of things pop up from time to time; where yes it inherits from something but changes behavior of that thing and the auto-docs don't mention it.

You can mention it here: viewforum.php?f=50 and I think Bilka can adjust it.
If you want to get ahold of me I'm almost always on Discord.

User avatar
moon69
Fast Inserter
Fast Inserter
Posts: 181
Joined: Sun Sep 18, 2016 6:53 pm
Contact:

Re: [0.18.18] entity_type_filters on deconstruction-item

Post by moon69 »

Done thanks.

Post Reply

Return to “Modding help”