Pole Lamps

by Viidi

All poles placed with lamps. You can safely remove this mod.

9 months ago
1.1 - 2.0
1.91K

i Possible optimaztion

9 months ago
(updated 9 months ago)

Would it be possible to use this reference so that runtime changes are not required?

I will do some quick testing and if this is the case your more then welcome to use my code.

9 months ago

Got it to work

data.lua

local poleLamp = data.raw["lamp"]["small-lamp"]

---@type table<string, boolean>
local excluded = {}
for name in string.gmatch(settings.startup["polelamps_expluded"].value, '([^ ]+)') do
excluded[name] = true
end

for _, pole in pairs(data.raw["electric-pole"]) do
if not excluded[pole.name] then
pole.light = table.deepcopy(poleLamp.light)
pole.light.minimum_darkness = 0.5
end
end

settings.lua

data:extend({
{
type = "string-setting",
name = "polelamps_expluded",
order = "aa",
setting_type = "startup",
default_value = "bi-power-to-rail-pole bi-rail-hidden-power-pole ee-super-electric-pole ee-super-substation",
},
})

9 months ago

One notable point is the lack of power consumption. I'm unsure if this can be achieved using only the Prototype Stage.

9 months ago

Hi. Thanks for the advice.

Try to achieve a power shortage in the network. In the current implementation, this leads to the entire base starting to blink. And it looks epic and cool - I don't want to give it up. Will this behavior be the same if I use pole.light?

9 months ago

It would not, its kind of unfortunate that there is no way to add power draw :{
WUBE get on it XD

New response