Add possibility to filter on force in LuaEntityDamagedEventFilter

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Masamune00
Inserter
Inserter
Posts: 27
Joined: Sat Nov 26, 2016 11:48 am
Contact:

Add possibility to filter on force in LuaEntityDamagedEventFilter

Post by Masamune00 »

Hello,

Idea suggestion
Would it be possible please to add an option to filter on force in "LuaEntityDamagedEventFilter" ?

Reason
In our scenario we can sometimes result in having a lot of attacks at same time by lot of biters at different location to big defenses (a long line of flamers with like 3 row or more of lasers), resulting in a lot "on_entity_damaged" being fired, which is bad performance wise.

We got 2 forces for biters, one that needs to trigger on_entity_damaged (but very small amount of biters), one that doesn't (a lot and a lot more of biters compared to the other force).

I think it would be better performance wise if this event "on_entity_damaged" is not even triggered if it's not the force we wanted in the code by using "LuaEntityDamagedEventFilter" with a new force filter option.

Sure we have a check at the beginning on "entity_damaged" but it doesn't prevent the event being triggered for nothing (there is no need for event to be triggered when it's the wrong force).


Thanks in advance,
Regards,
Masamune00
Masamune00
Inserter
Inserter
Posts: 27
Joined: Sat Nov 26, 2016 11:48 am
Contact:

Re: Add possibility to filter on force in LuaEntityDamagedEventFilter

Post by Masamune00 »

Hello, I hope it's fine to bump it just one time.

It would be very nice to have this new possibility.
Post Reply

Return to “Modding interface requests”