Demolisher territory colors

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
jurgy
Burner Inserter
Burner Inserter
Posts: 15
Joined: Wed Feb 27, 2019 5:55 pm
Contact:

Demolisher territory colors

Post by jurgy »

Hi, I've released a mod people on Reddit asked for that hides the Demolishers' territory. But when implementing it, I was surprised to see there is no clean way to change the color of just the territory on Vulcanus. I had to modify to default values, namely default_enemy_territory_color for the diagonal strikes and default_enemy_color for the borders. Especially that last one has many side effects in changing the color of all the enemies since (almost?) none of them have a color defined in their prototype.

So my only solution is to set it on all the prototypes (see bellow)

The simplest form of my request is to get a different (new) default for the color of territory borders as to not mess with all the unit types. And secondly a way to define the colors for just the Demolisher's territory or just the territory on Vulcanus. Is it possible to include it in TerritorySettings?

Thanks!

Code: Select all

local default_enemy_color = data.raw["utility-constants"]["default"]["chart"]["default_enemy_color"]
local unit_types = {"unit-spawner", "segment", "segmented-unit", "spider-unit", "unit"}
for _, unit_type in pairs(unit_types) do
    for _, prototype in pairs(data.raw[unit_type]) do
        if not prototype.enemy_map_color then
            prototype.enemy_map_color = default_enemy_color
        end
    end
end

data.raw["utility-constants"]["default"]["chart"]["default_enemy_territory_color"] = {0, 0, 0, 0}
data.raw["utility-constants"]["default"]["chart"]["default_enemy_color"] = {0, 0, 0, 0}
MrSmoothieHuman
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Sat Aug 05, 2023 1:20 am
Contact:

Re: Demolisher territory colors

Post by MrSmoothieHuman »

+1
coder? i hardly know her!
Post Reply

Return to “Modding interface requests”