Weird Particles

So I’m working on a Vortigaunt Beam swep and when I initially use the swep an explosion of X’s come off of me and I have no idea as to why. If anyone can help I would be grateful.

Here’s what it looks like:

http://imageshack.us/a/img841/3441/33179519.png

http://imageshack.us/a/img843/3355/69849797.png

Here’s the code (take note of the ParticleEffectAttach’s in the SWEP:PrimaryAttack() function:
[lua]if (SERVER) then
AddCSLuaFile(“shared.lua”);
end;

if (CLIENT) then
SWEP.Slot = 0;
SWEP.SlotPos = 5;
SWEP.DrawAmmo = false;
SWEP.PrintName = “Vortibeam”;
SWEP.DrawCrosshair = true;

game.AddParticles("particles/Vortigaunt_FX.pcf")

PrecacheParticleSystem("vortigaunt_beam")
PrecacheParticleSystem("vortigaunt_beam_b")

end

SWEP.Instructions = “Primary Fire: Fire your laz0r.”;
SWEP.Purpose = “For death.”;
SWEP.Contact = “”;
SWEP.Author = “RJ”;

SWEP.WorldModel = “models/weapons/w_fists_t.mdl”;
SWEP.ViewModel = “models/weapons/v_punch.mdl”;
SWEP.HoldType = “fist”;

SWEP.AdminSpawnable = true;
SWEP.Spawnable = true;

SWEP.Primary.NeverRaised = true;
SWEP.Primary.DefaultClip = 0;
SWEP.Primary.Automatic = false;
SWEP.Primary.ClipSize = -1;
SWEP.Primary.Damage = 90;
SWEP.Primary.Delay = 3;
SWEP.Primary.Ammo = “”;

SWEP.Secondary.DefaultClip = 0;
SWEP.Secondary.Automatic = false;
SWEP.Secondary.ClipSize = -1;
SWEP.Secondary.Delay = 0;
SWEP.Secondary.Ammo = “”;

SWEP.NoIronSightFovChange = true;
SWEP.NoIronSightAttack = true;
SWEP.IronSightPos = Vector(0, 0, 0);
SWEP.IronSightAng = Vector(0, 0, 0);

– Called when the SWEP is deployed.
function SWEP:Deploy()
self:SendWeaponAnim(ACT_VM_DRAW);
end;

– Called when the SWEP is holstered.
function SWEP:Holster(switchingTo)
self:SendWeaponAnim(ACT_VM_HOLSTER);

return true;

end;

– Called when the SWEP is initialized.
function SWEP:Initialize()
self:SetWeaponHoldType(self.HoldType);
end;

– Called when the player attempts to primary fire.
function SWEP:PrimaryAttack()
self:SetNextPrimaryFire(CurTime() + self.Primary.Delay);

if (self.Owner:OnGround()) then
	if (SERVER) then
		self.Owner:SetForcedAnimation("zapattack1", 1.5)
	end;
	
	local chargeSound = CreateSound(self.Owner, "npc/vort/attack_charge.wav")
	chargeSound:Play()
	
            --When I remove the two lines below this comment it no longer does what the images above show.
	ParticleEffectAttach("vortigaunt_charge_token", PATTACH_POINT_FOLLOW, self.Owner, self.Owner:LookupAttachment("leftclaw"))
	ParticleEffectAttach("vortigaunt_charge_token", PATTACH_POINT_FOLLOW, self.Owner, self.Owner:LookupAttachment("rightclaw"))
	
	timer.Simple(1.5, function()
		chargeSound:Stop()
		self.Owner:EmitSound("npc/vort/attack_shoot.wav")
		
		local tr = util.QuickTrace(self.Owner:EyePos(), self.Owner:EyeAngles():Forward()*5000, self.Owner)
		
		self.Owner:StopParticles()
		util.ParticleTracerEx("vortigaunt_beam", self.Owner:GetAttachment(self.Owner:LookupAttachment("leftclaw")).Pos,tr.HitPos, true, self.Owner:EntIndex(), self.Owner:LookupAttachment("leftclaw"))
		
		util.BlastDamage(self.Owner, self.Owner, tr.HitPos, 10, 400)
	end)
end;

end;[/lua]

It’s probably because the texture for the particle can’t be found.

Ah, that would make sense. It’s my first time working with particles and I wouldn’t have recognized the error.

It is because the particle cannot be loaded.

How would I got about loading the particle correctly?

As I understand these particles are from EP2, do you have it converted to SteamPipe? Does any other content from EP2 work?

Try changing the variables inside of the troubled code and see if it does anything different.
For example:
[lua]
ParticleEffectAttach(“vortigaunt_charge_token”, PATTACH_POINT_FOLLOW, self.Owner, self.Owner:LookupAttachment(“eyes”))
[/lua]

See if that won’t work out of the players eyes, if not then start with one of the other variables. Maybe try changing the particle and see if another one will work.

The thing is that it only shows the X’s when I initially fire the weapon, after that it works fine.

http://img832.imageshack.us/img832/151/34227369.png

Try moving these:


PrecacheParticleSystem("vortigaunt_beam")
PrecacheParticleSystem("vortigaunt_beam_b")

Outside of CLIENT or SERVER.

Here’s your problem I believe:
[lua]

if (CLIENT) then
PrecacheParticleSystem(“vortigaunt_beam”)
PrecacheParticleSystem(“vortigaunt_beam_b”)
end
[/lua]

-snip-

Awesome! It works! Thanks a bunch everyone for the help!

I also had to precache vortigaunt_charge_token. So it looks like this now:

[lua]if (CLIENT) then
SWEP.Slot = 0;
SWEP.SlotPos = 5;
SWEP.DrawAmmo = false;
SWEP.PrintName = “Vortibeam”;
SWEP.DrawCrosshair = true;

game.AddParticles("particles/Vortigaunt_FX.pcf")

end

PrecacheParticleSystem(“vortigaunt_beam”)
PrecacheParticleSystem(“vortigaunt_beam_b”)
PrecacheParticleSystem(“vortigaunt_charge_token”)[/lua]