on_entity_died - killer

Post Reply
henke37
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Mon Jul 18, 2016 5:43 pm
Contact:

on_entity_died - killer

Post by henke37 »

There seems to be no way to get the actual entity responsible for killing another entity. Only the force they belong to.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: on_entity_died - killer

Post by Rseding91 »

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.

User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 711
Joined: Sun Nov 23, 2014 11:57 am
Contact:

Re: on_entity_died - killer

Post 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.

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: on_entity_died - killer

Post 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.
quick links: log file | graphical issues | wiki

Chocolatetthunder
Long Handed Inserter
Long Handed Inserter
Posts: 74
Joined: Sat Sep 03, 2016 12:00 am
Contact:

Re: on_entity_died - killer

Post 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)
3Ra Gaming Owner
join us on discord @ http://www.3RaGaming.com/discord

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: on_entity_died - killer

Post 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
If you want to get ahold of me I'm almost always on Discord.

Articulating
Long Handed Inserter
Long Handed Inserter
Posts: 71
Joined: Mon Oct 17, 2016 10:33 am
Contact:

Re: on_entity_died - killer

Post 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?

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: on_entity_died - killer

Post by DaveMcW »

That's what you get for posting in the wrong topic - no one understands what you want. :P

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: on_entity_died - killer

Post by Rseding91 »

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.

Post Reply

Return to “Implemented mod requests”