I need my workshop NPC (Tripod) to fire 2 different weapons.
4 replies, posted
Hello! I'm currently working on the Jeff Wayne Tripod NPC, and have completed a majority of my desired changes to Orion's original, with one exception. I want to have my NPC fire the Heat Ray, and the Black smoke, I thought about having two different forces, and even uploaded both, but only one will stay in-game, so if possible, I want to have the Tripods fire the heat ray at some points, and black smoke at another. Maybe even randomly, or just both at once, anything works.
Here's the init weapons section.
Black Smoke
local lpos = x:GetPos()
if x:IsValid() then
timer.Create("LaserInitiateDelay", 0.5, 1, function()
local effectdata = EffectData()
effectdata:SetScale( 70 )
effectdata:SetOrigin(lpos)
util.Effect("ThumperDust", effectdata)
util.ParticleTracerEx( "Weapon_Combine_Ion_Cannon_Black", self:GetPos(), lpos, false, self:EntIndex(), 10)
ParticleEffect( "dust_bombdrop", lpos, Angle(0,0,0), nil)
ParticleEffect( "choreo_launch_camjet_3", lpos, Angle(0,0,0), nil)
self:EmitSound("beams/beamstart1.wav", 100, 100)
self:EmitSound(self.Attack, 100, 100 )
local indmgsphere = ents.FindInSphere(lpos, self.HeatRayDamageRadius)
for _, i in pairs (indmgsphere) do
if i:IsValid() then
local dmg = DamageInfo()
dmg:SetDamage(self.HeatRayDamage)
dmg:SetInflictor(self)
dmg:SetDamageType(DMG_AIRBOAT)
dmg:SetDamagePosition(lpos)
dmg:SetAttacker(self)
i:TakeDamageInfo(dmg, self)
end
end
end)
end
end
end
end
end
Heat Ray
local lpos = x:GetPos()
if x:IsValid() then
timer.Create("LaserInitiateDelay", 0.5, 1, function()
local effectdata = EffectData()
effectdata:SetScale( 70 )
effectdata:SetOrigin(lpos)
util.Effect("ThumperDust", effectdata)
util.ParticleTracerEx( "tripod_beam", self:GetPos(), lpos, false, self:EntIndex(), 10)
ParticleEffect( "env_fire", lpos, Angle(0,0,0), nil)
ParticleEffect( "Weapon_Combine_Ion_Cannon_Explosion", lpos, Angle(0,0,0), nil)
self:EmitSound("beams/beamstart5.wav", 100, 100)
self:EmitSound(self.Attack, 100, 100 )
local indmgsphere = ents.FindInSphere(lpos, self.HeatRayDamageRadius)
for _, i in pairs (indmgsphere) do
if i:IsValid() then
if (i:Health() - self.HeatRayDamage < 0) and (i:IsPlayer() or i:IsNPC()) then
i:SetModel("models/humans/charple0"..math.random(1,4)..".mdl")
local dmg = DamageInfo()
dmg:SetDamage(self.HeatRayDamage)
dmg:SetInflictor(self)
dmg:SetDamageType(DMG_DISSOLVE)
dmg:SetDamagePosition(lpos)
dmg:SetAttacker(self)
i:TakeDamageInfo(dmg, self)
i:Ignite(60)
end
end
end
end)
end
end
end
end
end
Who gave you permission to use Orion's SNPC base?
@vrej Orion. He's helped me with a lot of my own modifications as well. Feel free to ask him. Big fan of your work by the way. :)
[QUOTE=S1ru5;46856888]@vrej Orion. He's helped me with a lot of my own modifications as well. Feel free to ask him. Big fan of your work by the way. :)[/QUOTE]
Ya I asked him, I was just making sure.
No problem. I would have done the same.
Also, bump. I still need a fix for this if its possible.
Sorry, you need to Log In to post a reply to this thread.