Ulysses

General => Developers Corner => Topic started by: Mr582 on August 17, 2013, 05:55:51 PM

Title: Disable Decals
Post by: Mr582 on August 17, 2013, 05:55:51 PM
Hello There. I am making a Hidden Gamemode in Gmod and when i was testing the main problem was that you could see the decals on the hiddens body, making it easy to see him. Is there a way to disable decals. If not can someone help me.
Title: Re: Disable Decals
Post by: MrPresident on August 17, 2013, 06:30:02 PM
Do you mean their name when you mouse over them?
Title: Re: Disable Decals
Post by: Mr582 on August 17, 2013, 06:39:32 PM
No the blood. The name would be nice too.
Title: Re: Disable Decals
Post by: MrPresident on August 17, 2013, 06:40:55 PM
Here is how you remove the player names

http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index6cc7.html

I'll take a look into the decals.


I couldn't find anything that jumped out at me at first glance. You could do it a pretty hacky way though if you want to.

Code: [Select]
function NoBloodHiddenPlayer( ply, atkr )
if ply:IsHiddenPlayer() then
for k, v in pairs( player.GetAll() ) do
v:ConCommand( "r_cleardecals" )
end
end
end
hook.Add( "PlayerHurt", "NoBloodHiddenPlayer", NoBloodHiddenPlayer )
The IsHiddenPlayer() boolean check would be replaced by you for whatever method you choose for tracking who is a hidden player or not.

[edit-JamminR] Placed hook.add into the code block
Title: Re: Disable Decals
Post by: JamminR on August 17, 2013, 07:04:41 PM
Mrpresident, Could he use WEAPON:DoImpactEffect() (http://wiki.garrysmod.com/page/WEAPON/DoImpactEffect) to override, if the tr table it hit was the player entity that was 'hidden'.
I've no idea if that would work, or if it would work, if one would also have to write in the fact the player got hurt/etc too, though not seen.
Title: Re: Disable Decals
Post by: MrPresident on August 17, 2013, 08:39:19 PM
Yes, but this method is a weapon hook. I don't think you can use those outside the weapon files.

IE: He'd have to only be using custom SWEPs and no default weapons and he'd have to add that to every one of them or to the base SWEP if the others are using one.
Title: Re: Disable Decals
Post by: Mr582 on August 17, 2013, 10:12:53 PM
I would be fine with no decals at all. No blood at all.
Title: Re: Disable Decals
Post by: Mr582 on August 20, 2013, 11:16:16 AM
Is there a way to check if he has the weapon weapon_hidden and then do what MrPresident did
Title: Re: Disable Decals
Post by: MrPresident on August 20, 2013, 12:19:31 PM
Code: [Select]
function NoBloodHiddenPlayer( ply, atkr )
if ply:GetActiveWeapon():GetClass() == "weapon_hidden" then
for k, v in pairs( player.GetAll() ) do
v:ConCommand( "r_cleardecals" )
end
end
end
hook.Add( "PlayerHurt", "NoBloodHiddenPlayer", NoBloodHiddenPlayer )