Allow LightningAttractorPrototype to support negative efficiency

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Arcus
Inserter
Inserter
Posts: 30
Joined: Thu Dec 14, 2023 12:07 pm
Contact:

Allow LightningAttractorPrototype to support negative efficiency

Post by Arcus »

Would it be possible to add support for negative values to the efficiency of lightning rods? The idea is to allow you to have lightning strikes that require excess power to protect against instead of generating power, as a modded environmental hazard.
User avatar
MrSmoothieHuman
Fast Inserter
Fast Inserter
Posts: 152
Joined: Sat Aug 05, 2023 1:20 am
Contact:

Re: Allow LightningAttractorPrototype to support negative efficiency

Post by MrSmoothieHuman »

+1, seems like a cool idea - even if it was a separate parameter and not directly “negative efficiency”
coder? i hardly know her!
protocol_1903
Filter Inserter
Filter Inserter
Posts: 321
Joined: Fri Sep 09, 2022 4:33 pm
Contact:

Re: Allow LightningAttractorPrototype to support negative efficiency

Post by protocol_1903 »

+1
If you need to reach me, message me on discord.

I make qol mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
If you have a mod idea, I can look into it.
Bilka
Factorio Staff
Factorio Staff
Posts: 3597
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Allow LightningAttractorPrototype to support negative efficiency

Post by Bilka »

What happens if there is no more energy left in the energy source?
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
User avatar
MrSmoothieHuman
Fast Inserter
Fast Inserter
Posts: 152
Joined: Sat Aug 05, 2023 1:20 am
Contact:

Re: Allow LightningAttractorPrototype to support negative efficiency

Post by MrSmoothieHuman »

Bilka wrote: Thu Sep 04, 2025 3:00 pm What happens if there is no more energy left in the energy source?
Presumably it'd just stop working? thats the only way I can see it working personally (presuming you mean "the electric network" in this context :lol: )
coder? i hardly know her!
Bilka
Factorio Staff
Factorio Staff
Posts: 3597
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Allow LightningAttractorPrototype to support negative efficiency

Post by Bilka »

no, I mean when lightning strikes an empty collector. should it damage the collector or do nothing? should the collector stop protecting the area?
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Quorken
Burner Inserter
Burner Inserter
Posts: 16
Joined: Mon Aug 18, 2025 3:53 pm
Contact:

Re: Allow LightningAttractorPrototype to support negative efficiency

Post by Quorken »

+1

Damaging/destroying the collector seems reasonable - if the collector is destroyed, it would then stop protecting the area it's supposed, as a natural consequence. So protecting the area would consume energy, or entity health if there is no energy.

Damage could just be whatever the lightning would normally do to an entity.

To protect against people spamming unpowered collectors (if this is a problem), modders could use a dying_trigger_effect to zap nearby collectors, or a (damaging) explosion upon destruction.
Bilka
Factorio Staff
Factorio Staff
Posts: 3597
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Allow LightningAttractorPrototype to support negative efficiency

Post by Bilka »

To make sure my reply doesn't give a wrong impression: I am not working on this currently, it seems like too risky of a change with not clearly specified behaviour.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
pastelstoic
Burner Inserter
Burner Inserter
Posts: 8
Joined: Tue Feb 04, 2025 7:34 pm
Contact:

Re: Allow LightningAttractorPrototype to support negative efficiency

Post by pastelstoic »

Throwing my two cents in for a more concrete implementation idea:

If efficiency is negative, strikes will drain from the buffer instead of filling it.

A new field, minimum_buffer_content (value: float), is mandatory if efficiency is < 0. At runtime, if the current buffer energy is below this percentage, the attractor does not function. Value must be > 0 (a value of zero would act the same as efficiency == 0) and <= 1.

energy_source is now mandatory if efficiency ~= 0.
protocol_1903
Filter Inserter
Filter Inserter
Posts: 321
Joined: Fri Sep 09, 2022 4:33 pm
Contact:

Re: Allow LightningAttractorPrototype to support negative efficiency

Post by protocol_1903 »

I'd say if it doesn't have enough energy available in the buffer, then the entity should explode. That, or some trigger event should be triggered, so that any number of effects can be defined (like how nuclear reactors explode, but burners dont).
If you need to reach me, message me on discord.

I make qol mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
If you have a mod idea, I can look into it.
Post Reply

Return to “Modding interface requests”