Lighted Electric Poles +

by Optera

Adds a copy of every electric pole, including modded ones, with integrated lamp.

Content
5 months ago
0.15 - 1.1
75.9K
Power

b problem with picker extended

6 years ago

If you move a pole with picker, I think only the pole moves, but not the light.
Even worse, if you delete the pole, the light stays and blinks, because it has no energy.
Not sure if you can even do something about it. I'll ask picker's dev too.
Otherwise this is one of my favorite mods!

6 years ago

If you change your code like below, at least it allows you to remove an invisible light by placing another pole at the same place and removing it, if you created an invisible light by accident.

function MinedEntity(event)
local entity = event.entity

if entity.type == "electric-pole" and string.find(entity.name, "lighted-") then
    local found = entity.surface.find_entities_filtered {
        name = 'hidden-small-lamp',
        position = entity.position,
    }
    --FIX---------------------------
    for _, hidden in pairs(found) do
        hidden.destroy()
    end
    --FIX---------------------------

    --if found[1] then
  --log("removing hidden lamp of "..entity.name.." at "..entity.position.x..","..entity.position.y )
        --found[1].destroy()
    --end
end

end

6 years ago
(updated 6 years ago)

Added compatibility to Picker in 1.0.0

@reset:
Picker uses entity.teleport() which doesn't fire on_destroyed nor on_mined.
Nexela however did add a remote call firing when moving entities I could register to.

This thread has been locked.