How do you spray custom decals?
I have been looking at these methods but I can't get anything to work:
[code]
util.Decal("decal1", Pos1, Pos2)
[/code]
[code]
local decal = ents.Create("infodecal")
decal:SetKeyValue ("texture", "decals/outside")
decal:SetPos(Pos1)
decal:Spawn()
decal:Activate()
[/code]
This way crashes my game.
[code]
util.DecalMaterial("cross", Pos1, Pos2)
[/code]
Can you give a better example of what you're doing? It's not just pos1, pos2. You need one position and use the normal of the trace to create a decal using util.Decal.
These would be the args ( Player is automated; part of my net system ): trace.HitPos, trace.HitNormal, { "BloodImpact" }, true, 232
Example function, part of my networking ProcessEffect system.
[lua]function( Player, _pos, _normal, _effect, _decal, _ent )
if ( _decal ) then
util.Decal( _decal, _pos + _normal, _pos - _normal );
end
[/lua]
[QUOTE=Acecool;42929069]Can you give a better example of what you're doing? It's not just pos1, pos2. You need one position and use the normal of the trace to create a decal using util.Decal.
These would be the args ( Player is automated; part of my net system ): trace.HitPos, trace.HitNormal, { "BloodImpact" }, true, 232
Example function, part of my networking ProcessEffect system.
[lua]function( Player, _pos, _normal, _effect, _decal, _ent )
if ( _decal ) then
util.Decal( _decal, _pos + _normal, _pos - _normal );
end
[/lua][/QUOTE]
I am trying to spray my own texture I made on a wall. I have already gotten the position. pos1 and pos2 are just the variables used to store it.
[QUOTE=bran92don;42929306]I am trying to spray my own texture I made on a wall. I have already gotten the position. pos1 and pos2 are just the variables used to store it.[/QUOTE]
Does it work if you use default textures instead of custom ones?
I ask because I ran into a bug with custom decals and I don't know if it was ever resolved (haven't touched the code in a few months). My issue was [URL="http://facepunch.com/showthread.php?t=1252586"]custom decals would not work on first join[/URL], you had to rejoin to make them show.
Sorry, you need to Log In to post a reply to this thread.