Particle effect tutorial?

Does anyone have guides or a shove in the right direction of creating particle effects

Is there any pre-made particle effects?

so i am wondering if anyone would be kind enough to show me how i make particle effects

Many thanks!

How do you want to create particle effects? Lua-wise or using source particle editor?

It would be lua

I was just fixing up some old particle effect code and going over the wiki, and theres a particle emitter example on the Effect page of the wiki, the main thing i have to add to it is this; the directory defines the effect name, say you want your effect to be called “CoolSparks”, you make this directory:


lua/effects/CoolSparks/

Inside of that directory make a init.lua file and toss in one of the example codes from the wiki link above, depending on what you wanna do you will have to go for the approach of example 1 or 2, personally im using something close to example 2 on a moving sent. These links will tell you a little more about the ParticleEmitter; ParticleEmitter & Category:CLuaEmitter (what functions you can call on the ParticleEmitter)

Now that you have a particle effect, you will want to use it, for that we have util.Effect, which needs some EffectData love. An example of using the “CoolSparks” effect:


local effectdata = EffectData()
effectdata:SetOrigin(self.Entity:GetPos())
effectdata:SetEntity(self.Entity)
effectdata:SetAttachment(1)
effectdata:SetMagnitude(.5)
effectdata:SetScale(200)
util.Effect("CoolSparks", effectdata)

These are the functions you can use on effect data: Category:CEffectData.

Thats pretty much it, the examples from the wiki and the little snippet above should get you going, the other links should get you further, and if you have more questions, ask.

http://forum.facepunch.com/showthread.php?t=883304

Not sure how accurate it remains, but there you go.

EDIT: That’s orange box particles spawned via lua.
More power, but works poorly in multiplayer.