[Mod] Better Nametags [better_nametags]

User avatar
Piezo_
Member
 
Posts: 115
Joined: Fri Jul 20, 2018 21:36
Location: purgatory
GitHub: is proprietary I use NotABug
In-game: Piezo_ or TheRealPiezo_

[Mod] Better Nametags [better_nametags]

by Piezo_ » Sun Sep 02, 2018 19:38

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 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!

"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 Sep 07, 2018 02:36, edited 6 times in total.
while (true) { suffer(); }
 

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

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

Re: [Mod] Better Nametags [better_nametags]

by Ruggila » Mon Sep 03, 2018 06:12

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

User avatar
Piezo_
Member
 
Posts: 115
Joined: Fri Jul 20, 2018 21:36
Location: purgatory
GitHub: is proprietary I use NotABug
In-game: Piezo_ or TheRealPiezo_

Re: [Mod] Better Nametags [better_nametags]

by Piezo_ » Mon Sep 03, 2018 06:21

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: 319
Joined: Fri Sep 22, 2017 06:46
Location: 127.0.0.1
GitHub: ChimneySwift
IRC: ChimneySwift
In-game: ChimneySwift

Re: [Mod] Better Nametags [better_nametags]

by ChimneySwift » Mon Sep 03, 2018 10:09

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: 115
Joined: Fri Jul 20, 2018 21:36
Location: purgatory
GitHub: is proprietary I use NotABug
In-game: Piezo_ or TheRealPiezo_

Re: [Mod] Better Nametags [better_nametags]

by Piezo_ » Mon Sep 03, 2018 18:00

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: 34
Joined: Sun Sep 10, 2017 09:11

Re: [Mod] Better Nametags [better_nametags]

by acidzebra » Mon Sep 03, 2018 20:03

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: 115
Joined: Fri Jul 20, 2018 21:36
Location: purgatory
GitHub: is proprietary I use NotABug
In-game: Piezo_ or TheRealPiezo_

Re: [Mod] Better Nametags [better_nametags]

by Piezo_ » Tue Sep 04, 2018 02:17

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: 863
Joined: Fri Aug 26, 2016 15:36
Location: Illinois, USA
GitHub: sorcerykid
In-game: Nemo

Re: [Mod] Better Nametags [better_nametags]

by sorcerykid » Tue Sep 04, 2018 02:42

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: 115
Joined: Fri Jul 20, 2018 21:36
Location: purgatory
GitHub: is proprietary I use NotABug
In-game: Piezo_ or TheRealPiezo_

Re: [Mod] Better Nametags [better_nametags]

by Piezo_ » Tue Sep 04, 2018 03:52

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
Member
 
Posts: 200
Joined: Mon Jan 08, 2018 15:14
Location: Paris
GitHub: pyrollo
In-game: Naj
 

User avatar
Piezo_
Member
 
Posts: 115
Joined: Fri Jul 20, 2018 21:36
Location: purgatory
GitHub: is proprietary I use NotABug
In-game: Piezo_ or TheRealPiezo_

Re: [Mod] Better Nametags [better_nametags]

by Piezo_ » Tue Sep 04, 2018 19:26

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: 1305
Joined: Fri Aug 04, 2017 14:19
Location: USA
IRC: nil
In-game: Stix [+alts]

Re: [Mod] Better Nametags [better_nametags]

by Stix » Tue Sep 04, 2018 20:17

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.
Next release of your favorite game? "Bugfixes" --Wuzzy
[OLD]The new Minetest-offtopic can be found here: https://minetestoftopic.createaforum.com/index.php
 

User avatar
Piezo_
Member
 
Posts: 115
Joined: Fri Jul 20, 2018 21:36
Location: purgatory
GitHub: is proprietary I use NotABug
In-game: Piezo_ or TheRealPiezo_

Re: [Mod] Better Nametags [better_nametags]

by Piezo_ » Wed Sep 05, 2018 02:21

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: 1305
Joined: Fri Aug 04, 2017 14:19
Location: USA
IRC: nil
In-game: Stix [+alts]

Re: [Mod] Better Nametags [better_nametags]

by Stix » Wed Sep 05, 2018 04:23

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.
Next release of your favorite game? "Bugfixes" --Wuzzy
[OLD]The new Minetest-offtopic can be found here: https://minetestoftopic.createaforum.com/index.php
 

User avatar
Piezo_
Member
 
Posts: 115
Joined: Fri Jul 20, 2018 21:36
Location: purgatory
GitHub: is proprietary I use NotABug
In-game: Piezo_ or TheRealPiezo_

Re: [Mod] Better Nametags [better_nametags]

by Piezo_ » Fri Sep 07, 2018 00:01

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
DS-minetest
Member
 
Posts: 1026
Joined: Thu Jun 19, 2014 19:49
Location: in front of my pc (which is at home)
GitHub: DS-Minetest
In-game: DS

Re: [Mod] Better Nametags [better_nametags]

by DS-minetest » Fri Sep 07, 2018 00:15

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.
Do not call me -minetest.
Call me DS or DS-minetest.
I am German, so you don't have to pm me English if you are also German.
The background is a lie.
 

User avatar
Piezo_
Member
 
Posts: 115
Joined: Fri Jul 20, 2018 21:36
Location: purgatory
GitHub: is proprietary I use NotABug
In-game: Piezo_ or TheRealPiezo_

Re: [Mod] Better Nametags [better_nametags]

by Piezo_ » Fri Sep 07, 2018 02:32

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
DS-minetest
Member
 
Posts: 1026
Joined: Thu Jun 19, 2014 19:49
Location: in front of my pc (which is at home)
GitHub: DS-Minetest
In-game: DS

Re: [Mod] Better Nametags [better_nametags]

by DS-minetest » Fri Sep 07, 2018 12:24

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/blob/6ed9c6fb3a80bf18b3f9f74e39704558371e8b41/doc/lua_api.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.
Do not call me -minetest.
Call me DS or DS-minetest.
I am German, so you don't have to pm me English if you are also German.
The background is a lie.
 

User avatar
Piezo_
Member
 
Posts: 115
Joined: Fri Jul 20, 2018 21:36
Location: purgatory
GitHub: is proprietary I use NotABug
In-game: Piezo_ or TheRealPiezo_

Re: [Mod] Better Nametags [better_nametags]

by Piezo_ » Fri Sep 07, 2018 22:53

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: 895
Joined: Tue Aug 02, 2016 22:04
Location: Madrid,Spain
GitHub: ManElevation
IRC: ManElevation
In-game: ManElevation
 

User avatar
Piezo_
Member
 
Posts: 115
Joined: Fri Jul 20, 2018 21:36
Location: purgatory
GitHub: is proprietary I use NotABug
In-game: Piezo_ or TheRealPiezo_

Re: [Mod] Better Nametags [better_nametags]

by Piezo_ » Mon Oct 01, 2018 05:39

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: 115
Joined: Fri Jul 20, 2018 21:36
Location: purgatory
GitHub: is proprietary I use NotABug
In-game: Piezo_ or TheRealPiezo_

Re: [Mod] Better Nametags [better_nametags]

by Piezo_ » Wed Nov 14, 2018 23:02

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


Return to WIP Mods



Who is online

Users browsing this forum: GreenDimond, KCoombes and 4 guests