Does anyone know if there are any lua events related to shooting? or being shot?
I am trying to modify friendly-fire damage values. The initial word on IRC was this was not possible, but wanted to confirm.
shooting events
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: shooting events
You'd have to check specific entities during on_tick handler which would be very show.
However, there's perhaps another way to do it - when things are shot, does it create remnants? If so, does their creation trigger the entity creation events?
You could look at the Fire Extinguisher mod in mod portal - that works in similar way.
However, there's perhaps another way to do it - when things are shot, does it create remnants? If so, does their creation trigger the entity creation events?
You could look at the Fire Extinguisher mod in mod portal - that works in similar way.
Last edited by aubergine18 on Sat Sep 17, 2016 6:13 pm, edited 1 time in total.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: shooting events
from extinguisher mod:
Code: Select all
local function extinguish_fire(event)
if event.entity.name == 'extinguisher-remnants' then
-- you at least know where shots landed
end
end
script.on_event(defines.events.on_trigger_created_entity, extinguish_fire)
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.