on_entity_died - killer
on_entity_died - killer
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
Correct. Because that's not known and in a lot of cases doesn't exist.
If you want to get ahold of me I'm almost always on Discord.
Re: on_entity_died - killer
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
See also this: on_entity_damaged event and on_entity_died author [Modding interface requests]Earendel wrote:From that perspective an on_entity_deal_damage would also be useful.
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.
-
- Long Handed Inserter
- Posts: 74
- Joined: Sat Sep 03, 2016 12:00 am
- Contact:
Re: on_entity_died - killer
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)
3Ra Gaming Owner
join us on discord @ http://www.3RaGaming.com/discord
join us on discord @ http://www.3RaGaming.com/discord
Re: on_entity_died - killer
http://lua-api.factorio.com/latest/even ... layer_diedChocolatetthunder 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)
If you want to get ahold of me I'm almost always on Discord.
-
- Long Handed Inserter
- Posts: 71
- Joined: Mon Oct 17, 2016 10:33 am
- Contact:
Re: on_entity_died - killer
What was the point of that link except to show that what he requested is in fact not in the on_player_died event?Rseding91 wrote:http://lua-api.factorio.com/latest/even ... layer_diedChocolatetthunder 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)
Re: on_entity_died - killer
That's what you get for posting in the wrong topic - no one understands what you want. ![Razz :P](./images/smilies/icon_razz.gif)
![Razz :P](./images/smilies/icon_razz.gif)
Re: on_entity_died - killer
Added for 0.15. It's an optional field as it's not always available.
If you want to get ahold of me I'm almost always on Discord.