[Mod] Better Nametags [better_nametags]

Post Reply
User avatar
Piezo_
Member
Posts: 219
Joined: Fri Jul 20, 2018 21:36
GitHub: is proprietary I use NotABug
Location: (x,y,z)

[Mod] Better Nametags [better_nametags]

by Piezo_ » Post

Hey, you!
(Yes, you! I can see your nametag from all the way across the server!)

Are you, a server admin, tired of players being given essentially endless-range Player-ESP by default?

Are you looking for a mod that also Hides players' names when sneaking?

Then you need the Better Nametags Mod!

Image

This mod simply sets the player transfer distance to always be equal to the entity transfer distance. That way, no one sees a player's nametag unless their client has loaded that player, but you still get all the features included with a default nametag, such as toggling visibility with F1, easy color-configuration, and the ability to see names through blocks!

"But wait," you ask, "how am I supposed to know who's online if I can't look around and see their name?!"

Never fear! Download now, and you'll also get our latest cutting edge technology: The "/players" command! "/players" not only lists the name of every player online, it also tells you how many players are online, so you don't have to count!

Better Nametags also features fully customizable nametag text and colors, so you can have players' nametag be based on any condition you can imagine, whether that be privilege-based, health-based, or even based on whether or not the player is standing on top of a block of cheese!

What are you waiting for?!

Put the Better Nametags mod on your server today!

(Read in really fast voice) The better nametags mod is licensed under the GNU General Public License, either Version 3 of the license, or, at your option, any later version. See LICENSE.txt for details.
Last edited by Piezo_ on Fri Feb 22, 2019 09:48, edited 7 times in total.
while (true) { suffer(); }

User avatar
StarNinjas
Member
Posts: 411
Joined: Wed Mar 14, 2018 00:32
GitHub: starninjas
IRC: StarNinjas
In-game: J1
Location: Terrarca
Contact:

Re: [Mod] Better Nametags [better_nametags]

by StarNinjas » Post

Nice
Don't go to bed tonight, without knowing what would happen if you died. https://thegospelfilm.org/

Ruggila
New member
Posts: 6
Joined: Fri Aug 31, 2018 09:29
In-game: Ruggila

Re: [Mod] Better Nametags [better_nametags]

by Ruggila » Post

/status also shows who's online. But you have to count :-)

User avatar
Piezo_
Member
Posts: 219
Joined: Fri Jul 20, 2018 21:36
GitHub: is proprietary I use NotABug
Location: (x,y,z)

Re: [Mod] Better Nametags [better_nametags]

by Piezo_ » Post

Ruggila wrote:/status also shows who's online. But you have to count :-)
But /players could technically have something like "/vanish" implimented, or even listing ranks/prefixes.
Also, who the hell is gonna know what "/status" does from a glance, honestly?
while (true) { suffer(); }

User avatar
ChimneySwift
Member
Posts: 320
Joined: Fri Sep 22, 2017 06:46
GitHub: ChimneySwift
IRC: ChimneySwift
In-game: ChimneySwift
Location: 127.0.0.1

Re: [Mod] Better Nametags [better_nametags]

by ChimneySwift » Post

You can achieve not showing the nametags of unloaded players with the player_tranfer_distance configuration setting IIRC.

Colors are cool tho, although could be achieved without separate entities.
A spoon is basically a tiny bowl with a stick on it

User avatar
Piezo_
Member
Posts: 219
Joined: Fri Jul 20, 2018 21:36
GitHub: is proprietary I use NotABug
Location: (x,y,z)

Re: [Mod] Better Nametags [better_nametags]

by Piezo_ » Post

ChimneySwift wrote:You can achieve not showing the nametags of unloaded players with the player_tranfer_distance configuration setting IIRC.
Well, there goes most of my reason for making this mod. Why wasn't this anywhere on the wiki?
Last edited by Piezo_ on Tue Sep 04, 2018 02:18, edited 1 time in total.
while (true) { suffer(); }

User avatar
acidzebra
Member
Posts: 75
Joined: Sun Sep 10, 2017 09:11

Re: [Mod] Better Nametags [better_nametags]

by acidzebra » Post

in my minetest.conf I have

Code: Select all

player_transfer_distance = 5
unlimited_player_transfer_distance = false
which more or less limits nametag to LOS (with my settings etc, YMMV)

I use it together with a modified version of this chat transfer distance mod (I don't bother with the payment, just the location/distance restriction on chat and "hearing range"):
viewtopic.php?t=12560
(I would give an arm and a leg for a mod with area/local, global, and custom chat "channels" in a neat tabbed chat interface)

to give some sense of "locality" on my server. It doesn't do anything with sneaking though AFAIK, so that's still a very valid reason for your mod if you're into the whole cloak and dagger thing :)

User avatar
Piezo_
Member
Posts: 219
Joined: Fri Jul 20, 2018 21:36
GitHub: is proprietary I use NotABug
Location: (x,y,z)

Re: [Mod] Better Nametags [better_nametags]

by Piezo_ » Post

What should I do at this point? Should I turn this into a "sneaking and colors mod", or just make another separate one?
while (true) { suffer(); }

User avatar
sorcerykid
Member
Posts: 1847
Joined: Fri Aug 26, 2016 15:36
GitHub: sorcerykid
In-game: Nemo
Location: Illinois, USA

Re: [Mod] Better Nametags [better_nametags]

by sorcerykid » Post

acidzebra wrote: to give some sense of "locality" on my server. It doesn't do anything with sneaking though AFAIK, so that's still a very valid reason for your mod if you're into the whole cloak and dagger thing :)
Actually you can make a nametag invisible just by setting alpha to 0. The nametag can be revealed by restoring alpha to 255. I used this technique to dynamically hide nametags on the JT2 server depending on whether players were wearing a Halloween costume.

I still like the concept of this mod. Maybe you could adapt it for something other than just colored player names, allowing any customized data to appear above the player (including stats, vitals, etc.). That would still be in fitting with the name of the mod.

User avatar
Piezo_
Member
Posts: 219
Joined: Fri Jul 20, 2018 21:36
GitHub: is proprietary I use NotABug
Location: (x,y,z)

Re: [Mod] Better Nametags [better_nametags]

by Piezo_ » Post

sorcerykid wrote:
Actually you can make a nametag invisible just by setting alpha to 0. The nametag can be revealed by restoring alpha to 255. I used this technique to dynamically hide nametags on the JT2 server depending on whether players were wearing a Halloween costume.

I still like the concept of this mod. Maybe you could adapt it for something other than just colored player names, allowing any customized data to appear above the player (including stats, vitals, etc.). That would still be in fitting with the name of the mod.
What I was thinking I might do (if I took it further) would be to switch it back to the default nametag, but keep the sneak feature (which would basically just be setting the player's nametag to an empty string), and possibly rely on player_transfer_distance to handle the endless range issue.
while (true) { suffer(); }

User avatar
Pyrollo
Developer
Posts: 385
Joined: Mon Jan 08, 2018 15:14
GitHub: pyrollo
In-game: Naj
Location: Paris

Re: [Mod] Better Nametags [better_nametags]

by Pyrollo » Post

Hi Piezo_, your mod reminds me this one :

Entity based nametags
[ Display Modpack ] - [ Digiterms ] - [ Crater MG ] - [ LATE ]

User avatar
Piezo_
Member
Posts: 219
Joined: Fri Jul 20, 2018 21:36
GitHub: is proprietary I use NotABug
Location: (x,y,z)

Re: [Mod] Better Nametags [better_nametags]

by Piezo_ » Post

Pyrollo wrote:Hi Piezo_, your mod reminds me this one :

Entity based nametags
From a glance, it seems like that mod throws the good of the default nametags (lightweight, visible through blocks, colorable) out with the bad (visible from all over the map)
while (true) { suffer(); }

User avatar
Stix
Member
Posts: 1385
Joined: Fri Aug 04, 2017 14:19
IRC: nil
In-game: Stix [+alts]
Location: USA

Re: [Mod] Better Nametags [better_nametags]

by Stix » Post

Piezo_ wrote:
Pyrollo wrote:Hi Piezo_, your mod reminds me this one :

Entity based nametags
From a glance, it seems like that mod throws the good of the default nametags (lightweight, visible through blocks, colorable) out with the bad (visible from all over the map)
Nope, the nametags in that mod are only visible if the player is visible.
Hey, what can i say? I'm the bad guy.

User avatar
Piezo_
Member
Posts: 219
Joined: Fri Jul 20, 2018 21:36
GitHub: is proprietary I use NotABug
Location: (x,y,z)

Re: [Mod] Better Nametags [better_nametags]

by Piezo_ » Post

Stix wrote:Nope, the nametags in that mod are only visible if the player is visible.
That's... what I said.

They solved the problem of names being visible everywhere, but created the problem of names not being visible through blocks
while (true) { suffer(); }

User avatar
Stix
Member
Posts: 1385
Joined: Fri Aug 04, 2017 14:19
IRC: nil
In-game: Stix [+alts]
Location: USA

Re: [Mod] Better Nametags [better_nametags]

by Stix » Post

Piezo_ wrote:
Stix wrote:Nope, the nametags in that mod are only visible if the player is visible.
That's... what I said.

They solved the problem of names being visible everywhere, but created the problem of names not being visible through blocks
Ah, sorry, i see i misunderstood you.
Hey, what can i say? I'm the bad guy.

User avatar
Piezo_
Member
Posts: 219
Joined: Fri Jul 20, 2018 21:36
GitHub: is proprietary I use NotABug
Location: (x,y,z)

Re: [Mod] Better Nametags [better_nametags]

by Piezo_ » Post

For those of you who are wondering, I have done some experimentation with unlimited_player_transfer_distance and player_transfer_distance on my server, and found them to be very unreliable (Often failing to limit the player's nametag view distance for no clear reason).

Whether or not this is a bug in all Minetest clients, I am not sure, but I will continue to keep this mod as a solution for people in my situation.
while (true) { suffer(); }

User avatar
Desour
Member
Posts: 1472
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: Desour
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: [Mod] Better Nametags [better_nametags]

by Desour » Post

Piezo_ wrote:Are you looking for a mod that also Hides players' names when sneaking?
Piezo_ wrote:This mod replaces the default nametag with an entity that has a nametag of its own. That way, no one sees a player's nametag unless their client has loaded that player, but you still get all the features included with a default nametag, such as toggling visibility with F1, easy color-configuration, and the ability to see names through blocks!
Piezo_ wrote:Better Nametags also features fully customizable nametag colors, so you can have players' nametag colors be based on any condition you can imagine, whether that be privilege-based, health-based, or even based on whether or not the player is standing on top of a block of cheese!
You can see it through nodes? So, you attach an entity to the player object and give this entity a nametag?
Why don't you set the nametag directly of the player? (https://github.com/minetest/minetest/bl ... .txt#L5047)
You could even set alpha. (https://github.com/minetest/minetest/bl ... .txt#L2286)
What do you think about making a PR to minetest_game? You could add alpha to the nametag color when sneaking here.
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

User avatar
Piezo_
Member
Posts: 219
Joined: Fri Jul 20, 2018 21:36
GitHub: is proprietary I use NotABug
Location: (x,y,z)

Re: [Mod] Better Nametags [better_nametags]

by Piezo_ » Post

DS-minetest wrote:You can see it through nodes?
Yep. Sometimes, that's a good thing.
DS-minetest wrote:So, you attach an entity to the player object and give this entity a nametag?
Why don't you set the nametag directly of the player?
Literally my previous reply in this thread.
DS-minetest wrote:You could even set alpha. You could add alpha to the nametag color when sneaking
Some clients don't support nametag alpha. Also, if you looked at the source code, you'd see that this mod both sets the alpha of the player's actual default nametag to 0, AND sets its text to a single whitespace character, meaning that unless something very stupid happens, the default nametag is GONE when we need it to be.

EDIT: Empty string = not good. Changed that
Last edited by Piezo_ on Sat Sep 08, 2018 05:20, edited 2 times in total.
while (true) { suffer(); }

User avatar
Desour
Member
Posts: 1472
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: Desour
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: [Mod] Better Nametags [better_nametags]

by Desour » Post

Piezo_ wrote:
DS-minetest wrote:So, you attach an entity to the player object and give this entity a nametag?
Why don't you set the nametag directly of the player?
Literally my previous reply in this thread.
Sorry, I haven't seen your previous post. Seems like it took me longer than 14 minutes to write mine.
Piezo_ wrote:
DS-minetest wrote:You could even set alpha. You could add alpha to the nametag color when sneaking
Some clients don't support nametag alpha. Also, if you looked at the source code, you'd see that this mod both sets the alpha of the player's actual default nametag to 0, AND sets its text to an empty string, meaning that unless something very stupid happens, the default nametag is GONE when we need it to be.
Do you refer to clients with old minetest versions? I meant nametags being half transparent when sneaking.

Btw. looking at your code, in the on_step callback self.object:get_luaentity() doesn't make much sense because self is already the luaentity. (https://github.com/minetest/minetest/bl ... .txt#L3301)
Also you don't need to set the position of your nametag object on_step, use object attachment.
This might also be of interest. (not in 0.4)
Your code could probably be more efficient, try doing less on step.
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

User avatar
Piezo_
Member
Posts: 219
Joined: Fri Jul 20, 2018 21:36
GitHub: is proprietary I use NotABug
Location: (x,y,z)

Re: [Mod] Better Nametags [better_nametags]

by Piezo_ » Post

DS-minetest wrote: self.object:get_luaentity() doesn't make much sense because self is already the luaentity.
Thanks! I'll fix that.
DS-minetest wrote:Also you don't need to set the position of your nametag object on_step, use object attachment.
I did, in fact try this. It resulted in a weird glitch, where the entity's nametag would appear disembodied to the attached player at (0,0,0), or the lowest coordinate currently loaded.
DS-minetest wrote:This might also be of interest. (not in 0.4)
Your code could probably be more efficient, try doing less on step.
Also good to know, but since set_attach doesn't work properly with nametags, and I need to keep track of the tag, but also have nametags move smoothly, the on_steps are my last and only choice.
Also, I've tested this mod on my server, I've had players die, leave and join the game, and use an in-development portal mod to travel over 10000 blocks, and their nametag entity still manages itself properly.
while (true) { suffer(); }

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

Re: [Mod] Better Nametags [better_nametags]

by ManElevation » Post

looks goods
My Public Mods! Discord: Rottweiler Games#3368

User avatar
Piezo_
Member
Posts: 219
Joined: Fri Jul 20, 2018 21:36
GitHub: is proprietary I use NotABug
Location: (x,y,z)

Re: [Mod] Better Nametags [better_nametags]

by Piezo_ » Post

Update:
Several improvements, including
  • Sneak-hiding is no longer hard-coded into the nametag system, and can be disabled.
  • better_nametags now agressively hides the player's actual nametag, in case some other mod messes with it.
  • Nametag updating is now handled by the nametag itself, instead of global step, eliminating the old, clunky system that had trouble keeping track of itself.
  • The game can now tell if your nametag has "died" (left the world with static_save off), and will make a new one for you.
  • I tried using set_attach(), but I'm sorry, it just doesn't work right. I think it's because the parent bone is missing in first person view, but it could be something even weirder. What I have now works just fine, and I'm sticking with that until minetest's devs fix their crap.
while (true) { suffer(); }

User avatar
Piezo_
Member
Posts: 219
Joined: Fri Jul 20, 2018 21:36
GitHub: is proprietary I use NotABug
Location: (x,y,z)

Re: [Mod] Better Nametags [better_nametags]

by Piezo_ » Post

A small update to support the Witchcraft mod's invisibility potion.
while (true) { suffer(); }

User avatar
Piezo_
Member
Posts: 219
Joined: Fri Jul 20, 2018 21:36
GitHub: is proprietary I use NotABug
Location: (x,y,z)

Re: [Mod] Better Nametags [better_nametags]

by Piezo_ » Post

Update
A not-so-small update to the first mod I ever made, the mod no longer uses the clunky entity hack, fixing a whole heap of bugs.
There's finally a reason for /players to exist now: It shows players' nametags instead of just their names.
Also, the screenshot has been updated, and you can find the nametags I use on my server commented out at the top of tag_types.lua.
Oh, by the way, minetest_systemd support has been added.
while (true) { suffer(); }

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 14 guests