[Mod] Death Messages [0.1.2] [death_messages]

User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

[Mod] Death Messages [0.1.2] [death_messages]

by Evergreen » Post

Image

This mod sends a message in chat to everyone when a player dies. (note: there is no reliable way of detecting when a player has died from fall damage in the current api)
For instance:

Code: Select all

Foobar melted into a ball of fire.
Depends:
Nothing

License:
GPL v3
Go here for full legal text.

Download
Download as a .zip, or a .tar.gz archive.
Check out the source code at https://github.com/4Evergreen4/death_messages
Last edited by Evergreen on Sat Nov 25, 2017 14:54, edited 2 times in total.
Back from the dead!

User avatar
Krock
Developer
Posts: 4650
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

by Krock » Post

Nice mod, unil now there were only random messages.
Last edited by Krock on Mon Mar 17, 2014 19:10, edited 1 time in total.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

by Evergreen » Post

Krock wrote:Nice mod, unil now there were only random messages.
Thanks! I am adding more stuff in the future, like support for other mods. Also, adding a separate message for falling isn't possible atm. It will be added when it is possible.
Back from the dead!

deivan
Member
Posts: 452
Joined: Fri Feb 15, 2013 10:16
Location: Brazil. :D

by deivan » Post

Nice. :D

User avatar
CraigyDavi
Member
Posts: 582
Joined: Sat Aug 10, 2013 13:08
GitHub: davisonio
IRC: davisonio
In-game: CraigyDavi
Location: Hampshire, UK
Contact:

by CraigyDavi » Post

Cool mod. I now use this mod on my server rather than my terrible death messages mod :)

Also does anyone know if this would be possible?
When someone kills someone else it would show as a message:

Code: Select all

player1 killed player2
Last edited by CraigyDavi on Mon Mar 17, 2014 20:38, edited 1 time in total.

User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

by Evergreen » Post

CraigyDavi wrote:Cool mod. I now use this mod on my server rather than my terrible death messages mod :)

Also does anyone know if this would be possible?
When someone kills someone else it would show as a message:

Code: Select all

player1 killed player2
I might try and see if I can do that. It depends on if there is a way of detecting who killed who, and if it is reliable.
Back from the dead!

User avatar
stu
Member
Posts: 923
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11
Location: United Kingdom

by stu » Post

Evergreen wrote:
CraigyDavi wrote:Cool mod. I now use this mod on my server rather than my terrible death messages mod :)

Also does anyone know if this would be possible?
When someone kills someone else it would show as a message:

Code: Select all

player1 killed player2
I might try and see if I can do that. It depends on if there is a way of detecting who killed who, and if it is reliable.
Something I have wanted for a while is a callback when a player is punched, this should provide a reference to player/entity responsible. It would be useful for other things besides this, like better armor wear-out for example.

Another more hacky solution might be to parse the server logs to determine the identity of the culprit. (if there was one)
no lava. no water and no player or entity means you must have fallen (I think)

Nice idea, btw
Last edited by stu on Mon Mar 17, 2014 23:53, edited 1 time in total.

User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

by Evergreen » Post

stu wrote:
Evergreen wrote:
CraigyDavi wrote:Cool mod. I now use this mod on my server rather than my terrible death messages mod :)

Also does anyone know if this would be possible?
When someone kills someone else it would show as a message:

Code: Select all

player1 killed player2
I might try and see if I can do that. It depends on if there is a way of detecting who killed who, and if it is reliable.
Something I have wanted for a while is a callback when a player is punched, this should provide a reference to player/entity responsible. It would be useful for other things besides this, like better armor wear-out for example.

Another more hacky solution might be to parse the server logs to determine the identity of the culprit. (if there was one)
no lava. no water and no player or entity means you must have fallen (I think)

Nice idea, btw
Thanks. While doing this mod, I have run into lots of limitations to the modding api. I was thinking of making an api for this in the future so that mods which kill players can register their own deaths. Also, I was thinking of having a text file full of quips which are randomly selected when the player dies. :P
Back from the dead!

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Post

Nice work :)

It would be even nicer to add random messages functionality here, so instead of the same one message there would be lots of commentaries why someone decided to swim in a lava :)

Could be easily done by picking random messages from tables with those messages.
Several tables - one per death cause should do the trick :)

User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

by Evergreen » Post

4aiman wrote:Nice work :)

It would be even nicer to add random messages functionality here, so instead of the same one message there would be lots of commentaries why someone decided to swim in a lava :)

Could be easily done by picking random messages from tables with those messages.
Several tables - one per death cause should do the trick :)
That's what I was thinking of doing. Also, thank you. :-)
Back from the dead!

Sokomine
Member
Posts: 4289
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

by Sokomine » Post

With regard to that other thread which asked for most common cause of death (in my case it would be suicide through falling - in order to prevent death through falling at a less convenient time :-)), multiple messages for that most common cause of death might indeed be helpful.

Intresting way how you solved the shortcommings of the api. At least that does take care of some situations. For other ones, it would really be great if the lua api could be extended. That's something still missing in the game. Especially when it comes to entities trying to kill each other. Playerkills, amount of monsters killed, amount of death by each type of monster - that'd all be very intresting for a variety of mods.
A list of my mods can be found here.

User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

by Evergreen » Post

Sokomine wrote:With regard to that other thread which asked for most common cause of death (in my case it would be suicide through falling - in order to prevent death through falling at a less convenient time :-)), multiple messages for that most common cause of death might indeed be helpful.

Intresting way how you solved the shortcommings of the api. At least that does take care of some situations. For other ones, it would really be great if the lua api could be extended. That's something still missing in the game. Especially when it comes to entities trying to kill each other. Playerkills, amount of monsters killed, amount of death by each type of monster - that'd all be very intresting for a variety of mods.
I could make the message after "else" in the code say "broke his/her legs." However, that is assuming there is no other way of dying.
Last edited by Evergreen on Tue Mar 18, 2014 12:17, edited 1 time in total.
Back from the dead!

User avatar
rubenwardy
Moderator
Posts: 6978
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

by rubenwardy » Post

I ran across this limitation when making the achievements mod.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Post

1st things 1st:
pll =player:get_player_name()

Death caused by a fall is one when

Code: Select all

minetest.get_node(player:getpos()).name == air
for greater than several seconds.
So we can check for distance a player has walked since last check (lagproof) and a node at the pos I mentioned above (this however isn't lag proof).

But if a player is dead (player.get_hp()==0) and he was in air for too long, I guess it's normal to send smth like "pll hits the ground too hard!" (e.g. avoid the word "fall").

------------------------------------------------------------------------------------------------------

As for monsters - we can use check for health (actually we need track it on every tick) and if a player dies we can get his pos and find the nearest mob. Distance should be checked, a mob has to be in 0..1 meters away.

Fireballs of DM, arrows and any entities thrown at the player can bear inside them the name of the one who has released them.

Also if there are several mobs in a distance (0..1) we can send smth like "pll was killed by the anonymous group of sandmen". (Well, you know... alcoholics... anonymity... groups... sand monsters should be very thirsty... ... sorry, my imagination is on it's top these days )

------------------------------------------------------------------------------------------------------

What else?
Death, caused by another player?
We can't do it yet, but what if we send_all only potential killers?

Example:
Someone killed someone.
In such circumstances the killer wouldn't be able to teleport momentarily after the kill.
So: our killer should be nearby.

If there's NO other things to die of - we can send all that "killer might have seen or heard who just killed pll". So we don't blame anyone, but make people suspicious. Later the killed one can clear possible killer's name. On PVP servers that may be treated like a joke - everyone would know what does it mean "might have seen". Yeah... ;) "I might have seen... and might not" ;)

Note:
If there's lava or fire or the killed one was falling while fighting - I assume it's "ok" to show the message that smth natural has killed him/her.

But if there's a player nearby we also can add that he/she just might have seen how did pll die.

Also, imagine that someone want to kill someone but wants to do it unnoticed. The killer may lure pll to a group of monsters and kill pll with a distance.

We have 2 options: to add possible killer's name or not.
First option will approve some skilled assassination.
The 2nd one will tell everyone who might've been responsible (arrows are entities that are nearby the player when he dies and if they contain someone's name...)

----------------------------------------------------------------------------------

Do we have suffocation yet? Drowning is for water. Suffocation is for sending smth like "pll has tried to pretend he's a worm" or "pll failed to prove he can do better than regular worms".

----------------------------------------------------------------------------------

'pll was blasted with TNT!' - this may be done likewise the arrows. TNT's particles of smoke should fill the entire radius of a blast. On_collision with a player we can check his HP.

----------------------------------------------------------------------------------
Regards!

Sokomine
Member
Posts: 4289
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

by Sokomine » Post

I'd really prefer this to be solved by the lua api rather than guesswork about who might have been close enough. That might be a workaround for now, but if players are concerned, we need to know who did it - to avoid accidently blaming and banning the wrong player.
A list of my mods can be found here.

User avatar
Krock
Developer
Posts: 4650
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

by Krock » Post

Sokomine wrote:I'd really prefer this to be solved by the lua api rather than guesswork about who might have been close enough. That might be a workaround for now, but if players are concerned, we need to know who did it - to avoid accidently blaming and banning the wrong player.
Yes, myself I ran into this problem too. Sometimes it wasn't clear who killed who, therefore should it be possible to get the name of the player who killed "dummy".
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

by Evergreen » Post

4aiman wrote:1st things 1st:
pll =player:get_player_name()

Death caused by a fall is one when

Code: Select all

minetest.get_node(player:getpos()).name == air
for greater than several seconds.
So we can check for distance a player has walked since last check (lagproof) and a node at the pos I mentioned above (this however isn't lag proof).

But if a player is dead (player.get_hp()==0) and he was in air for too long, I guess it's normal to send smth like "pll hits the ground too hard!" (e.g. avoid the word "fall").

------------------------------------------------------------------------------------------------------

As for monsters - we can use check for health (actually we need track it on every tick) and if a player dies we can get his pos and find the nearest mob. Distance should be checked, a mob has to be in 0..1 meters away.

Fireballs of DM, arrows and any entities thrown at the player can bear inside them the name of the one who has released them.

Also if there are several mobs in a distance (0..1) we can send smth like "pll was killed by the anonymous group of sandmen". (Well, you know... alcoholics... anonymity... groups... sand monsters should be very thirsty... ... sorry, my imagination is on it's top these days )

------------------------------------------------------------------------------------------------------

What else?
Death, caused by another player?
We can't do it yet, but what if we send_all only potential killers?

Example:
Someone killed someone.
In such circumstances the killer wouldn't be able to teleport momentarily after the kill.
So: our killer should be nearby.

If there's NO other things to die of - we can send all that "killer might have seen or heard who just killed pll". So we don't blame anyone, but make people suspicious. Later the killed one can clear possible killer's name. On PVP servers that may be treated like a joke - everyone would know what does it mean "might have seen". Yeah... ;) "I might have seen... and might not" ;)

Note:
If there's lava or fire or the killed one was falling while fighting - I assume it's "ok" to show the message that smth natural has killed him/her.

But if there's a player nearby we also can add that he/she just might have seen how did pll die.

Also, imagine that someone want to kill someone but wants to do it unnoticed. The killer may lure pll to a group of monsters and kill pll with a distance.

We have 2 options: to add possible killer's name or not.
First option will approve some skilled assassination.
The 2nd one will tell everyone who might've been responsible (arrows are entities that are nearby the player when he dies and if they contain someone's name...)

----------------------------------------------------------------------------------

Do we have suffocation yet? Drowning is for water. Suffocation is for sending smth like "pll has tried to pretend he's a worm" or "pll failed to prove he can do better than regular worms".

----------------------------------------------------------------------------------

'pll was blasted with TNT!' - this may be done likewise the arrows. TNT's particles of smoke should fill the entire radius of a blast. On_collision with a player we can check his HP.

----------------------------------------------------------------------------------
Regards!
I prefer to do stuff within the api, it is much more stable. Those are some good ideas though.
EDIT: Sokomine answered perfectly, that would be my response.
Back from the dead!

User avatar
stu
Member
Posts: 923
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11
Location: United Kingdom

by stu » Post

Evergreen wrote: Also, I was thinking of having a text file full of quips which are randomly selected when the player dies. :P
That reminds me of a mmorpg I once played called eternal lands, they had daft death messages like that, some were quite funny iirc.
Perhaps you could add a 'random' setting as an option.

User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

by Evergreen » Post

New version
Spoiler
Feel free to leave your quips in this topic. (I might make it a setting to have random death messages)
Last edited by Evergreen on Wed Mar 19, 2014 01:05, edited 1 time in total.
Back from the dead!

User avatar
John1
Member
Posts: 36
Joined: Mon Mar 10, 2014 01:21
Location: USA

by John1 » Post

Evergreen wrote: Feel free to leave your quips in this topic. (I might make it a setting to have random death messages)
Lava deaths:
[player] went for a closer look at lava.
[player] dug straight down too long.
[player] didn't know lava was hot.

Drowning:
[player] forgot he wasn't a fish.
[player] blew one too many bubbles.

Burning:
[player] roasted himself - hotdog style.
[player] set himself aflame. More light that way.

Falling:

[player] took a tumble.
[player]'s superman cape didn't work.
[player] thought he could fly.
[player]'s parachute didn't open.
[player] jumped off a cliff.

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Post

It would be great if there were API callbacks, but there aren't ATM.
So, basically, I agree that it's a workaround that isn't even 80% precise.

But c'mon... banning pll just because some stupid mod has blamed someone?
Even if there was a player who kicked another player by accident/on purpose, how can we distinguish whether his punch was the final one? After the death player is not teleported momentarily and there's a chance for a nearby mob/another player to punch the corpse by accident/on purpose. And who we are to blame now? Are we going to ban both?

Further, because of lags the victim could be punched but lua wouldn't know about this for some time. During that time anything can harm/kill/punch the corpse and change the name of a killer.

Image

Moreover: if you've a mod that heals a player over time, then even dead players can be revived after they've died on the same spot.

Situation:
- pll has died;
- death screen appeared;
- pll didn't touch the "proceed" button but waits till his HP refills;
- pll presses the "proceed" button and don't get teleported anywhere.

This all was possible due to a single bug in a mod, but that's what we are talking about here - the problem of a mod being precise.

I don't think that in a situation like this the killer should be banned.

This also maybe a feature (KO instead of death+respawn)

User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

by Evergreen » Post

John1 wrote:
Evergreen wrote: Feel free to leave your quips in this topic. (I might make it a setting to have random death messages)
Lava deaths:
[player] went for a closer look at lava.
[player] dug straight down too long.
[player] didn't know lava was hot.

Drowning:
[player] forgot he wasn't a fish.
[player] blew one too many bubbles.

Burning:
[player] roasted himself - hotdog style.
[player] set himself aflame. More light that way.

Falling:

[player] took a tumble.
[player]'s superman cape didn't work.
[player] thought he could fly.
[player]'s parachute didn't open.
[player] jumped off a cliff.
Thanks! I paste those in a text file so I remember them.
Back from the dead!

User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

by Evergreen » Post

New version
Spoiler
Back from the dead!

Sokomine
Member
Posts: 4289
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

by Sokomine » Post

4aiman wrote: I don't think that in a situation like this the killer should be banned.
Based on that limited amount of information, a ban does not seem justified, that's right. And even if it is certain that that particular player was the culprit, it might still be an accident. Yet if the player repeats the killing, a ban might be necessary in order to allow the rest of the players on the server to play undisturbed. We really need a better API for that.
A list of my mods can be found here.

User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

by Evergreen » Post

Sokomine wrote:
4aiman wrote: I don't think that in a situation like this the killer should be banned.
Based on that limited amount of information, a ban does not seem justified, that's right. And even if it is certain that that particular player was the culprit, it might still be an accident. Yet if the player repeats the killing, a ban might be necessary in order to allow the rest of the players on the server to play undisturbed. We really need a better API for that.
I agree. Also, minor change in detecting drowning. Instead of looking for the node the player is in, it now uses player:get_breath.
Back from the dead!

Post Reply

Who is online

Users browsing this forum: No registered users and 29 guests