on_entity_damaged triggered for unit groups moving

This subforum contains all the issues which we already resolved.
randomdude
Inserter
Inserter
Posts: 43
Joined: Mon Mar 12, 2018 9:01 am
Contact:

on_entity_damaged triggered for unit groups moving

Post 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
Attachments
Screenshot (3).png
Screenshot (3).png (2.24 MiB) Viewed 3908 times
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5290
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: on_entity_damaged triggered for unit groups moving

Post by Klonan »

Can you provide some steps to reproduce what you are seeing?

A script snippet, save game, etc., would be useful
randomdude
Inserter
Inserter
Posts: 43
Joined: Mon Mar 12, 2018 9:01 am
Contact:

Re: on_entity_damaged triggered for unit groups moving

Post 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
Attachments
test67.zip
(2.69 MiB) Downloaded 172 times
Rseding91
Factorio Staff
Factorio Staff
Posts: 14408
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: on_entity_damaged triggered for unit groups moving

Post 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).
If you want to get ahold of me I'm almost always on Discord.
randomdude
Inserter
Inserter
Posts: 43
Joined: Mon Mar 12, 2018 9:01 am
Contact:

Re: on_entity_damaged triggered for unit groups moving

Post by randomdude »

Cool, thank you!
Post Reply

Return to “Resolved Problems and Bugs”