Add event for lightning striking a building

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
kotrenn
Manual Inserter
Manual Inserter
Posts: 2
Joined: Mon Jan 27, 2025 6:06 am
Contact:

Add event for lightning striking a building

Post by kotrenn »

I was wanting to try out a mod where a crafting building activated based on lightning striking it. From what I can understand, this would require adding an event to the API, which Lightning Collectors or other similar structures could respond to.
Genhis
Factorio Staff
Factorio Staff
Posts: 817
Joined: Wed Dec 24, 2014 8:19 am
Contact:

Re: Add event for lightning striking a building

Post by Genhis »

You should be able to use LightningPrototype::strike_effect together with ScriptTriggerEffectItem.
Bilka
Factorio Staff
Factorio Staff
Posts: 3380
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Add event for lightning striking a building

Post by Bilka »

It would be nice to have a dedicated event with more information than a script trigger.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Post Reply

Return to “Modding interface requests”