Hiding flags from splitters.

Place to get help with not working mods / modding interface.
Post Reply
Doctor_Willis
Burner Inserter
Burner Inserter
Posts: 16
Joined: Tue Sep 26, 2023 11:45 am
Contact:

Hiding flags from splitters.

Post by Doctor_Willis »

Hi everyone.
I'm trying to hide certain items from the splitter's filter menu.
I've been successful with most of them, but I've got ten that won't hide, even with the flags set to hidden.
My code (in data-updates.lua) is below, with the problem items being the ones at the bottom.

None of the items are needed in the mod (except maybe the automation-science-pack).

Has anyone got an idea on how to fix this?

Code: Select all

if data.raw["furnace"]["stone-furnace"] then
    data.raw["furnace"]["stone-furnace"].next_upgrade = nil
end

local item_flags_to_hide = {
    "wood",
    "coal",
    "stone",
    "iron-ore",
    "copper-ore",
    "uranium-ore",
    "iron-plate",
    "copper-plate",
    "copper-cable",
    "iron-stick",
    "iron-gear-wheel",
    "electronic-circuit",
    "wooden-chest",
    "iron-chest",
    "burner-inserter",
    "small-electric-pole",
    "stone-brick",
    "boiler",
    "steam-engine",
    "burner-mining-drill",
    "electric-mining-drill",
    "offshore-pump",
    "lab",
    "radar",
    "stone-furnace",

    -- These ten are the problem
    "repair-pack",
    "blueprint",
    "deconstruction-planner",
    "upgrade-planner",
    "blueprint-book",
    "raw-fish",
    "automation-science-pack",
    "pistol",
    "firearm-magazine",
    "light-armor"
}
for _, item_name in pairs(item_flags_to_hide) do
    if data.raw.item[item_name] then
        data.raw.item[item_name].flags = {"hidden"}
    end
end

User avatar
picklock
Fast Inserter
Fast Inserter
Posts: 141
Joined: Sat Nov 09, 2019 6:49 am
Contact:

Re: Hiding flags from splitters.

Post by picklock »

The problems may be due to the fact that the "items" causing the problems are not of the type "item". I haven't tested it myself, but that is at least one difference to the items with which it works.
My Mods: Picklocks Fusion Power | Picklocks Inserter | Picklocks Lithium Polymer Accumulator | Picklocks rocket silo stats | Picklocks Set Inventory Filters

Doctor_Willis
Burner Inserter
Burner Inserter
Posts: 16
Joined: Tue Sep 26, 2023 11:45 am
Contact:

Re: Hiding flags from splitters.

Post by Doctor_Willis »

I think you're right. I can't believe I missed this!
I'm not at my PC right now, so can't test it, but I've just looked at data.raw and none of the problem items are actually "items"

Post Reply

Return to “Modding help”