Page 1 of 1

on_entity_died - killer

Posted: Tue Oct 18, 2016 9:22 pm
by henke37
There seems to be no way to get the actual entity responsible for killing another entity. Only the force they belong to.

Re: on_entity_died - killer

Posted: Tue Oct 18, 2016 9:52 pm
by Rseding91
Correct. Because that's not known and in a lot of cases doesn't exist.

Re: on_entity_died - killer

Posted: Tue Oct 18, 2016 10:47 pm
by Earendel
It would be useful information to have. If turrets track kill counts then presumably there is some kill information in there somewhere. If it would need to be triggered at a different point in the code to work then maybe an on_entity_killed event could return the killed and the killer? From that perspective an on_entity_deal_damage would also be useful.

Re: on_entity_died - killer

Posted: Tue Oct 18, 2016 11:06 pm
by daniel34
Earendel wrote:From that perspective an on_entity_deal_damage would also be useful.
See also this: on_entity_damaged event and on_entity_died author [Modding interface requests]
and as Rseding91 said there:
Such an event is unlikely to be added due to performance reasons.

Such an event would be fired hundreds/thousands of times per second during normal combat while not adding a lot of value for the few times it was used.

Re: on_entity_died - killer

Posted: Tue Nov 15, 2016 12:40 am
by Chocolatetthunder
Instead of posting my on topic, what about on_player_died adding who or what killed the player? especially now that PVP is going to be officially part of the game (if you already haven't added this)

Re: on_entity_died - killer

Posted: Tue Nov 15, 2016 9:31 am
by Rseding91
Chocolatetthunder wrote:Instead of posting my on topic, what about on_player_died adding who or what killed the player? especially now that PVP is going to be officially part of the game (if you already haven't added this)
http://lua-api.factorio.com/latest/even ... layer_died

Re: on_entity_died - killer

Posted: Tue Nov 15, 2016 10:30 am
by Articulating
Rseding91 wrote:
Chocolatetthunder wrote:Instead of posting my on topic, what about on_player_died adding who or what killed the player? especially now that PVP is going to be officially part of the game (if you already haven't added this)
http://lua-api.factorio.com/latest/even ... layer_died
What was the point of that link except to show that what he requested is in fact not in the on_player_died event?

Re: on_entity_died - killer

Posted: Tue Nov 15, 2016 10:42 am
by DaveMcW
That's what you get for posting in the wrong topic - no one understands what you want. :P

Re: on_entity_died - killer

Posted: Tue Nov 29, 2016 11:34 pm
by Rseding91
Added for 0.15. It's an optional field as it's not always available.