ULX

Author Topic: Player Title II - Name and Title Display  (Read 55368 times)

0 Members and 3 Guests are viewing this topic.

Offline LuaTenshi

  • Hero Member
  • *****
  • Posts: 545
  • Karma: 47
  • Just your ordinary moon angel!
    • Mirai.Red
Re: Player Title II - Name and Title Display
« Reply #30 on: May 26, 2012, 10:46:52 PM »
Sorry for bumping this old? thread but, for some reason I don't get any tag.
I can use the commands (!title, mytitle, settitle...) but the tag/title doesn't appear.

Thanks in advance,
Tom

What do you mean? Right there in the picture it says that you set your title to Help, and then when you checked your title it returned Help.
I cry every time I see that I am not a respected member of this community.

Offline thegtz

  • Newbie
  • *
  • Posts: 25
  • Karma: 0
Re: Player Title II - Name and Title Display
« Reply #31 on: June 20, 2012, 10:03:00 PM »
How do I remove the default name display? Currently i have two names that show above someones head. I would like only one to show up.

Offline lavacano201014

  • Jr. Member
  • **
  • Posts: 83
  • Karma: 9
  • Archbishop of Cristina Scabbia worship
Re: Player Title II - Name and Title Display
« Reply #32 on: September 08, 2012, 01:47:49 AM »
First of all, I have added this text to the OP:

Regarding Developer Support
I don't come onto the Ulysses forums as much as I used to. However, if you add me on Steam (and leave a comment with your problem) I'll gladly try to help you out (though be warned I honestly haven't looked at the code in quite some time). This does not mean Player Title II development is halted. Merely paused.

Regarding GMod 13
The proper response to the question "Does it work in GMod 13" is "I have no idea." I've been meaning to bug the Ulysses team for access to their GM13 codebase but a combination of Megiddo never being on Steam and me having bad memory means I still haven't done it.

Now to answer questions.

Sorry for bumping this old? thread but, for some reason I don't get any tag.
I can use the commands (!title, mytitle, settitle...) but the tag/title doesn't appear.


Thanks in advance,
Tom

I'm not sure what you're after here, are you wanting the title to appear in the chatbox? Because that's not the intent of this addon. It's supposed to hover over your head when another player looks at you.

How do I remove the default name display? Currently i have two names that show above someones head. I would like only one to show up.

Open lua/autorun/client/cl_playertitle.lua and change the variable enablenames to false.
Circle reasoning works because circle reasoning works because...

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Player Title II - Name and Title Display
« Reply #33 on: September 08, 2012, 06:50:36 PM »
Lavacano, no need to bug Megiddo for the codebase, see mention here - http://forums.ulyssesmod.net/index.php/topic,5484.msg26481.html#msg26481
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline lavacano201014

  • Jr. Member
  • **
  • Posts: 83
  • Karma: 9
  • Archbishop of Cristina Scabbia worship
Re: Player Title II - Name and Title Display
« Reply #34 on: September 20, 2012, 02:57:00 PM »
Lavacano, no need to bug Megiddo for the codebase, see mention here - http://forums.ulyssesmod.net/index.php/topic,5484.msg26481.html#msg26481

huh. maybe it was another addon I was thinking of that did that.
Circle reasoning works because circle reasoning works because...

Offline LuaTenshi

  • Hero Member
  • *****
  • Posts: 545
  • Karma: 47
  • Just your ordinary moon angel!
    • Mirai.Red
Re: Player Title II - Name and Title Display
« Reply #35 on: September 20, 2012, 11:17:58 PM »
I'm not sure what you're after here, are you wanting the title to appear in the chatbox? Because that's not the intent of this addon. It's supposed to hover over your head when another player looks at you.

I think you should add that as an option and allow it to be custom, set by an admin, or just the persons rank. In addition this should also have some settings like changing if people can see the name through a wall or the ability to change at what distance the names fade away. You know server side vars and may be more client side vars?
I cry every time I see that I am not a respected member of this community.

Offline nexbr

  • Jr. Member
  • **
  • Posts: 55
  • Karma: 5
Re: Player Title II - Name and Title Display
« Reply #36 on: November 26, 2012, 03:21:58 AM »
Can you create two cvars?

1. Server Side like sv_playertitle_enable 1/0
2. Client Side like cl_playertitle_enable 1/0

Then we can disable the player title to all players or just for me.

Because sometime you want spy some players but the flying title are not stealthy !  ;)

Offline datgregofag

  • Newbie
  • *
  • Posts: 25
  • Karma: 0
Re: Player Title II - Name and Title Display
« Reply #37 on: February 12, 2013, 03:49:28 PM »
Hi, how can i change it so that when a person dies it doesn't show the title, i have a ttt server and when someone dies their title still floats around.

Offline krooks

  • Sr. Member
  • ****
  • Posts: 382
  • Karma: 32
  • I don't like video games.
    • Diamond Krooks
Re: Player Title II - Name and Title Display
« Reply #38 on: February 17, 2013, 09:42:54 AM »
Hi, how can i change it so that when a person dies it doesn't show the title, i have a ttt server and when someone dies their title still floats around.

I think when I get some time, I will be adding this to my server. So I'll fix it and give the code when I do (unless someone beats me to it). I would give instructions on how to do it, but I'm not good enough at lua for that, so it will take tinkering :P
My TTT server. Join the fun!

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Player Title II - Name and Title Display
« Reply #39 on: February 18, 2013, 01:45:02 AM »
cl_playertitle.lua

Replace the code in this file with this

Code: [Select]
//Config

// Names enabled?
local enablenames = true

// Titles enabled?
local enabletitles = true

// How to align the text?
// 0 = left
// 1 = center
// 2 = right
local textalign = 1

// Distance multiplier. The higher this number, the further away you'll see names and titles.
local distancemulti = 2

////////////////////////////////////////////////////////////////////
// Don't edit below this point unless you know what you're doing. //
////////////////////////////////////////////////////////////////////

function DrawNameTitle()

local vStart = LocalPlayer():GetPos()
local vEnd

for k, v in pairs(player.GetAll()) do

if not v:Alive() then continue end

local vStart = LocalPlayer():GetPos()
local vEnd = v:GetPos() + Vector(0,0,40)
local trace = {}

trace.start = vStart
trace.endpos = vEnd
local trace = util.TraceLine( trace )

if trace.HitWorld then
--Do nothing!
else
local mepos = LocalPlayer():GetPos()
local tpos = v:GetPos()
local tdist = mepos:Distance(tpos)

if tdist <= 3000 then
local zadj = 0.03334 * tdist
local pos = v:GetPos() + Vector(0,0,v:OBBMaxs().z + 5 + zadj)
pos = pos:ToScreen()

local alphavalue = (600 * distancemulti) - (tdist/1.5)
alphavalue = math.Clamp(alphavalue, 0, 255)

local outlinealpha = (450 * distancemulti) - (tdist/2)
outlinealpha = math.Clamp(outlinealpha, 0, 255)

local playercolour = team.GetColor(v:Team())
local playertitle = v:GetNetworkedString("title")

if ( (v != LocalPlayer()) and (v:GetNWBool("exclusivestatus") == false) ) then
if (enablenames == true) then
draw.SimpleTextOutlined(v:Name(), "TargetID", pos.x, pos.y - 10, Color(playercolour.r, playercolour.g, playercolour.b, alphavalue),textalign,1,2,Color(0,0,0,outlinealpha))
end
if (not (playertitle == "")) and (enabletitles == true) then
draw.SimpleTextOutlined(playertitle, "Trebuchet18", pos.x, pos.y + 6, Color(255,255,255,alphavalue),textalign,1,1,Color(0,0,0,outlinealpha))
end
end
end
end
end
end

hook.Add("HUDPaint", "DrawNameTitle", DrawNameTitle)

All I did was add an alive check to the player to decide if the title should be drawn above their head. 1 line of code.


if not v:Alive() the continue end

Offline PAL-18

  • Full Member
  • ***
  • Posts: 142
  • Karma: 1
Re: Player Title II - Name and Title Display
« Reply #40 on: February 18, 2013, 04:46:59 PM »
Screenshot link in first post returns a 403 error ...

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Player Title II - Name and Title Display
« Reply #41 on: February 18, 2013, 07:36:55 PM »
Screenshot link in first post returns a 403 error ...

See the date?
Hence, why I wish most folks would attach their small-ish images and files here, and not link them.
Though majority of the time the code/whatever they posted here won't work in Gmod 2 years after release, it would at least give someone chance to review, perhaps pick back up.
Add in links to other sites, and, well, I've seen those change more often than we keep up with Gmod's code changes. :D
(Lavacano doesn't visit these parts too often...last was Nov 1 2012)
« Last Edit: February 18, 2013, 07:38:53 PM by JamminR »
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline krooks

  • Sr. Member
  • ****
  • Posts: 382
  • Karma: 32
  • I don't like video games.
    • Diamond Krooks
Re: Player Title II - Name and Title Display
« Reply #42 on: February 19, 2013, 03:01:55 PM »
I haven't tried your code Mr. President, but while messing with this last night I noticed it needs a lot more work than just that to be use on TTT.
As it is, it displays all names in your view, which is really different from TTT, which only displays them within a certain radius of the middle, the names fade in and out depending on distance.
To have them always on would be game changing, as it would be much easier to see the names to call a KOS.

I'll be tinkering with this when I have time, and hopefully release a TTT version of it, unless someone beats me.
My TTT server. Join the fun!

Offline pazda

  • Newbie
  • *
  • Posts: 10
  • Karma: 1
Re: Player Title II - Name and Title Display
« Reply #43 on: March 05, 2013, 03:19:08 PM »
This breaks my DarkRP server. The new names show up, but the commands don't work, the HUD shows nothing, default class is Connecting/Joining, and the default weapons from classes are gone.. Any ideas?

Offline SatoshiAaron

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: Player Title II - Name and Title Display
« Reply #44 on: June 26, 2013, 08:29:31 PM »
How would I stop PRISONER_DEAD and GUARD_DEAD and SPECTATOR Teams tags from being visible. Because we can see them when they are spectating people or when they join the server in the middle of the map.