Allow access to the entity that killed a player in the API. The game sends out announcements "PLAYER was killed by ENTITY", where ENTITY can be another player, a turret, or a biter. I was hoping to improve my PvP code by keeping a K/D ratio for each player, along with other details. However, although the information is printed in-game, there's no way to get it from the API.
Also slightly related, but can the player death messages be printed to all forces, or limit the respawn messages to only that player's force? The respawn messages show up to all forces, but the death messages only show up to the force of the player who died. It just doesn't make much sense to have those two with different behavior.
Lastly, can the player death message also have the force attribute added, like the entity death event has? This isn't as high a priority as we've been using the entity death event and checking if the entity was a player, but it'd just be nice to have a simpler way.
EDIT: This may be better in the Mod Interface Requests forum that I only just now realized existed. Could it be moved there please?
Player Death Event Improvements
-
- Inserter
- Posts: 36
- Joined: Wed May 18, 2016 8:34 pm
- Contact:
Player Death Event Improvements
Trash Landfill - viewtopic.php?f=91&t=30882
Re: Player Death Event Improvements
Moved to Modding interface requests.
Part of your request might already be implemented for 0.15:
on_entity_died - killer [Implemented mod requests]
Part of your request might already be implemented for 0.15:
on_entity_died - killer [Implemented mod requests]
I'm not sure if this also applies to on_player_died.Rseding91 wrote:Added for 0.15. It's an optional field as it's not always available.
Re: Player Death Event Improvements
Also a kill counter production screen was teased out for .15
Re: Player Death Event Improvements
I think that only counts per prototype, and part of the information is already available here:Nexela wrote:Also a kill counter production screen was teased out for .15
http://lua-api.factorio.com/latest/LuaF ... statistics
-
- Inserter
- Posts: 36
- Joined: Wed May 18, 2016 8:34 pm
- Contact:
Re: Player Death Event Improvements
That's what I believed too. What I'm going to be coding is a player by player K/D ratio, which will also include interfacing with some outside programs to store the data through different save games. I couldn't even begin without the killer field, though.
Also, AFAIK, the on_entity_death objects are not the same as the on_player_death objects. They're listed separately in the API, and the player doesn't have the force (like entity currently does). I guess if they add it to entity, I can use the same workaround as we're currently using by just checking is the entity is a player.
Also, AFAIK, the on_entity_death objects are not the same as the on_player_death objects. They're listed separately in the API, and the player doesn't have the force (like entity currently does). I guess if they add it to entity, I can use the same workaround as we're currently using by just checking is the entity is a player.
Trash Landfill - viewtopic.php?f=91&t=30882
Re: Player Death Event Improvements
The "cause" field is on both the player died and the entity died event for 0.15.zackman0010 wrote:That's what I believed too. What I'm going to be coding is a player by player K/D ratio, which will also include interfacing with some outside programs to store the data through different save games. I couldn't even begin without the killer field, though.
Also, AFAIK, the on_entity_death objects are not the same as the on_player_death objects. They're listed separately in the API, and the player doesn't have the force (like entity currently does). I guess if they add it to entity, I can use the same workaround as we're currently using by just checking is the entity is a player.
If you want to get ahold of me I'm almost always on Discord.
-
- Inserter
- Posts: 36
- Joined: Wed May 18, 2016 8:34 pm
- Contact:
Re: Player Death Event Improvements
Yay! Thank you. Do you have any comment on the second thing I asked? About player death messages not appearing to all forces/respawn messages appearing to all forces?Rseding91 wrote:The "cause" field is on both the player died and the entity died event for 0.15.zackman0010 wrote:That's what I believed too. What I'm going to be coding is a player by player K/D ratio, which will also include interfacing with some outside programs to store the data through different save games. I couldn't even begin without the killer field, though.
Also, AFAIK, the on_entity_death objects are not the same as the on_player_death objects. They're listed separately in the API, and the player doesn't have the force (like entity currently does). I guess if they add it to entity, I can use the same workaround as we're currently using by just checking is the entity is a player.
Trash Landfill - viewtopic.php?f=91&t=30882
Re: Player Death Event Improvements
Death messages are sent to the player force that died and the force that killed him and respawn messages are only sent to the player force that respawned (for 0.15).
If you want to get ahold of me I'm almost always on Discord.
-
- Inserter
- Posts: 36
- Joined: Wed May 18, 2016 8:34 pm
- Contact:
Re: Player Death Event Improvements
Thank you! I'm looking forward to 0.15 more and more
Trash Landfill - viewtopic.php?f=91&t=30882