Page 1 of 1

[0.18.18] entity_type_filters on deconstruction-item

Posted: Sat Apr 18, 2020 10:40 am
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?

Re: [0.18.18] entity_type_filters on deconstruction-item

Posted: Sat Apr 18, 2020 4:43 pm
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".

Re: [0.18.18] entity_type_filters on deconstruction-item

Posted: Sat Apr 18, 2020 5:52 pm
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?

Re: [0.18.18] entity_type_filters on deconstruction-item

Posted: Sat Apr 18, 2020 10:16 pm
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.

Re: [0.18.18] entity_type_filters on deconstruction-item

Posted: Sun Apr 19, 2020 12:04 pm
by moon69
Done thanks.