Page 1 of 1

on_entity_damaged triggered for unit groups moving

Posted: Thu Jan 02, 2020 11:05 pm
by randomdude
While looking for other things in biter battles, i found that on_entity_damaged event would be triggered a lot on the script from what seems to me its just big unit groups moving around, but always with 0 damage.

Obviously the script can ignore those events, but the fact is that it will be triggering a lot of times, specially in a map sooo full of moving biters as is biter battles.

For what is worth, biters are assigned to a different force than the default enemy one (north_biters/south_biters) in case that means anything.

Thanks

Re: on_entity_damaged triggered for unit groups moving

Posted: Fri Jan 03, 2020 12:36 am
by Klonan
Can you provide some steps to reproduce what you are seeing?

A script snippet, save game, etc., would be useful

Re: on_entity_damaged triggered for unit groups moving

Posted: Fri Jan 03, 2020 1:30 am
by randomdude
I attached a save that its a bit previous to that effect happening. It will show on the game chat, just speed it up for a min or so.

As I said, the biters you will see are not from the "enemy" force but from the "south_biter" force, in case it helps.

Anything else I can provide, just ask, and thanks again

The related code is from https://github.com/M3wM3w/ComfyFactorio ... er.lua#L71, a modified version adding a couple log lines

Re: on_entity_damaged triggered for unit groups moving

Posted: Tue Jan 07, 2020 7:03 pm
by Rseding91
Thanks for the save. It's now fixed for the next version of 0.17. It was the acid slowdown stickers would trigger 0 damage on the biter as part of how they work to apply the slowdown effect. I changed it so if something tries to do 0 damage it just skips the entire damage system.

If something tries to do some damage which ends up as 0 after resistances it will still trigger the event(s).

Re: on_entity_damaged triggered for unit groups moving

Posted: Wed Jan 08, 2020 6:04 am
by randomdude
Cool, thank you!