Use plumbobs for gamemodes that use color changing models?

Was wondering if there would be an easy way to use these:

Instead of using just “colorable” models.

Reason:
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 :stuck_out_tongue:

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.

http://puu.sh/bY6RZ/2bbe32354d.gif


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( )
end

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
		return
	end
	
	if not LocalPlayer( ):IsValid( ) then
		return
	end
	
	if not pl:Alive( ) then
		return
	end
	
	if plumbobs:GetInt( ) == P_TEAM and pl:Team( ) ~= LocalPlayer( ):Team( ) then
		return
	end
	
	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 ) )
	m:SetupBones( )
	
	color = pl:GetPlayerColor( )
	
	r, g, b = render.GetColorModulation( )
	
	render.SetColorModulation( color.r, color.g, color.b )
	
	m:DrawModel( )
	
	render.SetColorModulation( r, g, b )
end

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.