How to view the code of Half Life 2 NPC's? (Trying to create a beam weapon FX)
3 replies, posted
Sorry if this seems like a dumb question, I'm still very much an amateur. To give some context, I have an NPC who uses a beam weapon against enemy NPC's. The problem is that this Beam weapon just spawns the "ToolTracer" effect very rapidly to give the effect that it looks like a laser, but it also causes quite a bit of lag.
I was looking through some of the NPC's, and I noticed the Stalker (Half Life 2 NPC) creates a very smooth and stable beam, and wasn't sure how to accomplish this. I can't seem to figure out how to see it's code to give a feel of how to accomplish what i'm looking for.
HL2 NPCs are not scripted in Lua my man.
Aw well rip. In that case, I suppose my remaining question would be: How should I replicate a laser effect similar to the Stalkers between an NPC and an enemy.
Nevermind, managed to accomplish it using networked variables.
render.SetMaterial( Laser )
if (self:GetNWBool("firing",false)==true) then
render.DrawBeam( self:GetPos() + Vector(0, 0,-20), self:GetNWVector("testvector",Vector( 0, 0, 0 )), 35, 1, 1, Color( 255, 150, 255, 255) )
end
Sorry, you need to Log In to post a reply to this thread.