Was wondering if there would be an easy way to use these:
Instead of using just “colorable” models.
To be able to use other player models that are not “colorable” but still be able to have players be able to tell each other apart.
Looking to be able to do this with the Hide and Seek gamemode (http://steamcommunity.com/sharedfiles/filedetails/?id=266512527)
Hopefully this made sense
Could just draw one above each players head and give them a convar to let them set its color.
After this League game I’ll take a crack at it and see what I can do!
Totally poaching, but I like this idea so I made it.
local plumbobs = CreateConVar( "sv_show_plumbobs", "1", FCVAR_REPLICATED + FCVAR_ARCHIVE, "
0 - No plumbobs
1 - Plumbobs for teammates
2 - Plumbobs for everyone" )
if SERVER then
return AddCSLuaFile( )
local m = ClientsideModel( "models/griim/sims/plumbob.mdl", RENDERGROUP_TRANSLUCENT )
m:AddFlags( EF_NODRAW + EF_NOSHADOW )
local P_TEAM, P_ALL = 1, 2
local offset, bob, rotspeed, bobspeed = 82, 5, 90, 4
local function PostPlayerDraw( pl )
local color, r, g, b
if not plumbobs:GetBool( ) then
if not LocalPlayer( ):IsValid( ) then
if not pl:Alive( ) then
if plumbobs:GetInt( ) == P_TEAM and pl:Team( ) ~= LocalPlayer( ):Team( ) then
pl.PlumAng = ( ( pl.PlumAng or 0 ) + RealFrameTime( ) * rotspeed ) % 360
pl.PlumHeight = math.sin( CurTime( ) * bobspeed ) * bob * .5
m:SetRenderAngles( Angle( 0, pl.PlumAng, 0 ) )
m:SetRenderOrigin( pl:GetPos( ) + vector_up * ( offset + pl.PlumHeight ) )
color = pl:GetPlayerColor( )
r, g, b = render.GetColorModulation( )
render.SetColorModulation( color.r, color.g, color.b )
render.SetColorModulation( r, g, b )
hook.Add( "PostPlayerDraw", "Plumbobs", PostPlayerDraw )
Goes in lua/autorun
Will require players to install the plumbob addon, of course.
I don’t use that hide and seek gamemode, so if it uses something other than teams to determine who is seeking / hiding, you’ll need to approach it in a different way, but that would give you enough of a baseline to just change how it checks.