on_entity_died author ?

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1525
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

on_entity_died author ?

Post by binbinhfr »

Hi,

I red this post "on_entity_damaged event"
viewtopic.php?f=28&t=25542
and I understand it's too cpu demanding.

But, in the same order of idea, but easier, it would be nice in the on_entity_died event to have the identity of the entity who killed the other (infact gave the last fatal wound) : an "event.author" field would be nice (could be a player, an alien, a turret or a robot) : it would be great for PvP mods, in order to detect which force destroys which building (to win the game) or which player killed who (to make reports about killings), or count aliens death per forces, etc... It would be less cpu demanding because only trigger on death. You have to find who is belonging the ammo which killed the entity.
My mods on the Factorio Mod Portal :geek:
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1525
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: on_entity_died author ?

Post by binbinhfr »

I just noticeed that there is a kill_counts on LuaForce, so I guess that factorio is already tracking this kind of event. So it wouldn't be hard to add a "author" or "killer" entity field to the on_entity_died event... Please, it would help me so much in my PvP mod :)
My mods on the Factorio Mod Portal :geek:
Rseding91
Factorio Staff
Factorio Staff
Posts: 14913
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: on_entity_died author ?

Post by Rseding91 »

The force that did the killing is known, the "what" that actually killed it not known since it can be anything or nothing.
If you want to get ahold of me I'm almost always on Discord.
User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1525
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: on_entity_died author ?

Post by binbinhfr »

Rseding91 wrote:The force that did the killing is known, the "what" that actually killed it not known since it can be anything or nothing.
is it known from the event of the on_entity_died ? because it is not explicit in the doc :
https://wiki.factorio.com/index.php?tit ... ntity_died

And even if I parse regularly the kill_counts from all forces, and try to compute differences, it will be a big work to find out which force kill a specific entity (let say a specific building for example).
My mods on the Factorio Mod Portal :geek:
Post Reply

Return to “Implemented mod requests”