[Mod] Death Messages [0.1.2] [death_messages]

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

by 4aiman » Post

get_breath is good :)
Better API is good too. (Have never said it's not, actually ;)

User avatar
SaKeL
Member
Posts: 743
Joined: Tue Apr 14, 2015 18:39
GitHub: JurajVajda
IRC: SaKeL
In-game: SaKeL

Re: [Mod]Death Messages[0.1.2 beta][death_messages]

by SaKeL » Post

would be nice to check if is player already dead.... now when player dies from hunger and afk, death messages will loop and spam the chat :)

bark
Member
Posts: 35
Joined: Thu Sep 24, 2015 13:25
In-game: bark

Re: [Mod]Death Messages[0.1.2 beta][death_messages]

by bark » Post

I love this mod! Adds a lot of fun to dying.

Deathmessages spamming the chat when player is taking damage would be nice to see fixed, as SaKeL mentions. The spam loop also occurs when dying in lava.

Also, I wrote some more death messages (most of the original ones are included in this list) that can be implemented in the mod if you like

Code: Select all


-- Other death messages
messages.other = {
        " died.",
        " died trying.",
        " didn't survive that final blow.",
        " did not survive.",
        " failed at staying alive.",
        " had a meeting with destiny.",
        " died and resurrected.",
        " made a deadly decision.",
        " is no more.",
        " was being reckless.",
        " did something fatal.",
        " gave up on life.",
        " is somewhat dead now.",
        " flatlined.",
        " took a fatal beating.",
        " is a pile of bones.",
        " is in need of a funeral service.",
        " passed out permanently.",
        " is knocking at the gates.",
        " tried to survive, but didn't.",
        " had an appointment with fate." 
}

-- Lava death messages
messages.lava = {
        " melted into a ball of fire.",
        " thought lava was cool.",
        " melted into a ball of fire.",
        " dug straight down and landed in lava.",
        " didn't know lava was hot.",
        " tried swimming in lava and failed at it.",
        " got stuck in lava and stayed there.",
        " can't swim in lava."
}

-- Drowning death messages
messages.water = {
        " drowned.",
        " ran out of air.",
        " failed at swimming lessons.",
        " tried to impersonate an anchor.",
        " forgot he wasn't a fish.",
        " blew one too many bubbles.",
        " couldn't reach the surface in time.",
        " was lost at sea."
}


wilkgr76
Member
Posts: 832
Joined: Wed Feb 18, 2015 02:44
GitHub: wilkgr76

Re: [Mod]Death Messages[0.1.2 beta][death_messages]

by wilkgr76 » Post

[player] became a pancake (Fall)
[player] is now medium to well-roasted. (Lava/fire)
A [mob] finds [player] delicious. (Mob)
[killer] won't be bothered by [player] for some time... (PvP)
[killer] sent [player] as a tribute to Hades (PvP)
[player] popped in to visit Hades. (Anything really)
<[player]> THE FALL WAS OVER 9000!!! (i.e. looks like a chat message xD) (Fall)
[player] was walking and texting (Lava/fire/fall)
[killer]'s [weapon] wasn't very polite to [player] (PvP)
[player] breathed his last.

More coming in another post ;)
N/A

User avatar
bigfoot
Member
Posts: 203
Joined: Fri Sep 02, 2016 23:31
GitHub: bigfoot547
IRC: bigfoot547 or bigfoot
In-game: bigfoot547 or bigfoot
Location: Somewhere between polar bears and penguins.

Re: [Mod]Death Messages[0.1.2 beta][death_messages]

by bigfoot » Post

So, I whipped up some code that you can use for detecting if a player was killed by another player or a mob. I which case, it will say the mobname (e.g. "mobs:dungeon_master").
Death messages:
[player] was killed by [player].
[player] was killed by [mobname]
Spoiler

Code: Select all

-- bigfoot547's death messages
minetest.register_on_punchplayer(function(player, hitter)
	if not (player or hitter) then
		return false
	end
	if not hitter:get_player_name() == "" then
		return false
	end
	minetest.after(0, function()
		if player:get_hp() == 0 and hitter:get_player_name() ~= "" then
			minetest.chat_send_all(player:get_player_name().." was killed by "..hitter:get_player_name()..".")
			return true
		elseif hitter:get_player_name() == "" and player:get_hp() == 0 then
			minetest.chat_send_all(player:get_player_name().." was killed by "..hitter:get_luaentity().name..".")
		else
			return false
		end
	end)
end)
Rev. 2

Code: Select all

-- bigfoot547's death messages
minetest.register_on_punchplayer(function(player, hitter)
	if not (player or hitter) then
		return false
	end
	if not hitter:get_player_name() == "" then
		return false
	end
	minetest.after(0, function()
		if player:get_hp() == 0 and hitter:get_player_name() ~= "" and hitter:get_wielded_item() and hitter:get_wielded_item():get_name() and minetest.registered_tools[hitter:get_wielded_item():get_name()] then
			minetest.chat_send_all(player:get_player_name().." was killed by "..hitter:get_player_name().." with "..minetest.registered_tools[hitter:get_wielded_item():get_name()].description..".")
			return true
		elseif player:get_hp() == 0 and hitter:get_player_name() ~= "" and hitter:get_wielded_item() then
			minetest.chat_send_all(player:get_player_name().." was killed by "..hitter:get_player_name().." with fists of fury.")
		elseif hitter:get_player_name() == "" and player:get_hp() == 0 then
			minetest.chat_send_all(player:get_player_name().." was killed by "..hitter:get_luaentity().name..".")
		else
			return false
		end
	end)
end)
Oh! By the way, you can use this freely. You have my permission.
Last edited by bigfoot on Wed Nov 22, 2017 23:02, edited 2 times in total.

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [Mod]Death Messages[0.1.2 beta][death_messages]

by azekill_DIABLO » Post

+1
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
Wuzzy
Member
Posts: 4786
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: [Mod]Death Messages[0.1.2 beta][death_messages]

by Wuzzy » Post

Some messages have poor grammar:
You forgot he wasn't a fish.
You is somewhat dead now.

User avatar
Beerholder
Member
Posts: 199
Joined: Wed Aug 03, 2016 20:23
GitHub: evrooije
In-game: Beerholder

Re: [Mod]Death Messages[0.1.2 beta][death_messages]

by Beerholder » Post

Wuzzy wrote:Some messages have poor grammar:
You forgot he wasn't a fish.
You is somewhat dead now.
Somebody set us up the bomb ;)

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [Mod]Death Messages[0.1.2 beta][death_messages]

by azekill_DIABLO » Post

it should be "player"
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
ManElevation
Member
Posts: 896
Joined: Tue Aug 02, 2016 22:04
GitHub: ManElevation
IRC: ManElevation
In-game: ManElevation
Location: Madrid,Spain

Re:

by ManElevation » 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
hum... city_block mod has this

Code: Select all

minetest.chat_send_all("Player "..name.." sent to jail for killing " .. pname .." without reason in town")
you could modified it to do it what u want.
https://github.com/minetest-mods/city_b ... r/init.lua
My Public Mods! Discord: Rottweiler Games#3368

User avatar
ManElevation
Member
Posts: 896
Joined: Tue Aug 02, 2016 22:04
GitHub: ManElevation
IRC: ManElevation
In-game: ManElevation
Location: Madrid,Spain

Re:

by ManElevation » 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
here

Code: Select all

minetest.register_on_punchplayer(function(player, hitter, _, _, _, damage)
   if not (hitter and hitter:is_player()) then
      return 
   end

   local hp = player:get_hp()
   if hp - damage > 0 or hp <= 0 then
      return 
   end


   local hitter_name = hitter:get_player_name()
   local player_name = player:get_player_name()
   
	minetest.chat_send_player(hitter_name, ""..hitter_name.." killed " .. player_name .."")
end)
My Public Mods! Discord: Rottweiler Games#3368

User avatar
bigfoot
Member
Posts: 203
Joined: Fri Sep 02, 2016 23:31
GitHub: bigfoot547
IRC: bigfoot547 or bigfoot
In-game: bigfoot547 or bigfoot
Location: Somewhere between polar bears and penguins.

Re:

by bigfoot » 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
Been there, done that ;)
Here's the link to the post...

EDIT: Fixed link, also my code is more elaborate and informative than ManElevation's code
Last edited by bigfoot on Sat Nov 25, 2017 16:29, edited 1 time in total.

User avatar
ManElevation
Member
Posts: 896
Joined: Tue Aug 02, 2016 22:04
GitHub: ManElevation
IRC: ManElevation
In-game: ManElevation
Location: Madrid,Spain

Re: Re:

by ManElevation » Post

bigfoot547 wrote:EDIT: Fixed link, also my code is more elaborate and informative than ManElivation's code
ah dint see that :P nice!
My Public Mods! Discord: Rottweiler Games#3368

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: Re:

by azekill_DIABLO » Post

bigfoot547 wrote:ManElivation
What? Who is this guy? :P
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

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:

Re: Re:

by Evergreen » Post

bigfoot547 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
Been there, done that ;)
Here's the link to the post...

EDIT: Fixed link, also my code is more elaborate and informative than ManElivation's code
Thanks for the contribution! If you want to be credited in the commit log than you can create a pull request, though it's fine with me if you want me to commit your changes and credit you in a code comment.
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:

Re: [Mod]Death Messages[0.1.2 beta][death_messages]

by Evergreen » Post

I think I will make it so the random messages are customizable in the settings.txt file (keeping the current set of defaults). That way if people want to use their own set of messages they can change it for themselves instead of having to create a pull request.
Back from the dead!

User avatar
bigfoot
Member
Posts: 203
Joined: Fri Sep 02, 2016 23:31
GitHub: bigfoot547
IRC: bigfoot547 or bigfoot
In-game: bigfoot547 or bigfoot
Location: Somewhere between polar bears and penguins.

Re: [Mod] Death Messages [0.1.2] [death_messages]

by bigfoot » Post

Ok, I'll create a pull request later today :)

User avatar
bigfoot
Member
Posts: 203
Joined: Fri Sep 02, 2016 23:31
GitHub: bigfoot547
IRC: bigfoot547 or bigfoot
In-game: bigfoot547 or bigfoot
Location: Somewhere between polar bears and penguins.

Re: Re:

by bigfoot » Post

azekill_DIABLO wrote:
bigfoot547 wrote:ManElivation
What? Who is this guy? :P
lol where'd u git that from ;)

User avatar
Hamlet
Member
Posts: 766
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [Mod] Death Messages [0.2.0] [death_messages]

by Hamlet » Post

EDIT
my fork no longer exists
Last edited by Hamlet on Sun Sep 09, 2018 11:34, edited 1 time in total.
My repositories: Codeberg.org | My ContentDB's page

User avatar
scottwolff
Member
Posts: 129
Joined: Sat Apr 30, 2016 06:15
In-game: scottwolff or some variant of iasiney
Location: Central Illinois

Re: [Mod] Death Messages [0.1.2] [death_messages]

by scottwolff » Post

Oh the shame. Now everyone knows your pain or can laugh at you.
Seriously though, good mod.

ademant
New member
Posts: 4
Joined: Sun Sep 09, 2018 07:11
GitHub: ademant
In-game: ademant
Location: Euskirchen, Duitsland

Re: [Mod] Death Messages [0.1.2] [death_messages]

by ademant » Post

As a beginner for modding minetest I forked this mod and tried to add german.
The language is checked and then a random message of the language is printed.

Also it tries to identify death by starving, sunburn and thirst if mod is installed.

The code can be found at: https://notabug.org/ademant/death_messages.git

User avatar
Hamlet
Member
Posts: 766
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [Mod] Death Messages [0.1.2] [death_messages]

by Hamlet » Post

ademant wrote:As a beginner for modding minetest I forked this mod and tried to add german.
The language is checked and then a random message of the language is printed. [...]
Hello and welcome!
If you wish to add multilanguage support to a mod then I suggest you to use the Internationalization Library ("Intllib") mod: it allows to use external localization files instead of hardcoding the translation strings in the source code.
My repositories: Codeberg.org | My ContentDB's page

ademant
New member
Posts: 4
Joined: Sun Sep 09, 2018 07:11
GitHub: ademant
In-game: ademant
Location: Euskirchen, Duitsland

Re: [Mod] Death Messages [0.1.2] [death_messages]

by ademant » Post

Hamlet wrote: Hello and welcome!
If you wish to add multilanguage support to a mod then I suggest you to use the Internationalization Library ("Intllib") mod: it allows to use external localization files instead of hardcoding the translation strings in the source code.
Sure; I read the code, but it is not really for use with death messages. Most of them can't be translated to another language.

User avatar
SuperStarSonic
Member
Posts: 160
Joined: Fri Oct 14, 2022 20:30
GitHub: Python-Sargent
In-game: SuperStarSonic
Location: Earth (may be out of date)

Re:

by SuperStarSonic » Post

Evergreen wrote:
Thu Mar 20, 2014 14:54
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.
Don't you think it should be both? I know of a few mods that do 'suffocating' using breath, which will throw you off.

Post Reply

Who is online

Users browsing this forum: No registered users and 21 guests