Skip to content

e2 docs custom effects

DerelictDrone edited this page May 28, 2025 · 4 revisions

Jump to table of contents

Custom/effects

Effect = effect()

Creates and returns new effect (1 ops)

Effect = Effect:setOrigin(Vector Pos)

Sets the origin of the effect (1 ops)

Effect = Effect:setStart(Vector Pos)

Sets the start of the effect (1 ops)

Effect = Effect:setMagnitude(Number Mag)

Sets the magnitude of the effect, Magnitude is the amount of particles you will be emitting. (1 ops)

Effect = Effect:setAngles(Angle Ang)

Sets the angle of the effect (1 ops)

Effect = Effect:setScale(Number Scale)

Sets the scale of the effect, scale is the thickness of your effect. (1 ops)

Effect = Effect:setEntity(Entity Ent)

Sets the entity of the effect (1 ops)

Effect = Effect:setNormal(Vector Norm)

Sets the normalized direction vector of the effect, aka direction. (1 ops)

Effect = Effect:setSurfaceProp(Number Prop)

Sets the surface property index of the effect (1 ops)

Effect = Effect:setRadius(Number Radius)

Sets the radius aka size of the effect (1 ops)

Effect = Effect:setMaterialIndex(Number Index)

Sets the material index of the effect (1 ops)

Effect = Effect:setHitBox(Number Index)

Sets the hit box index of the effect (1 ops)

Effect = Effect:setFlags(Number Flags)

Sets the flags of the effect (1 ops)

Effect = Effect:setEntIndex(Number Index)

Sets the entity of the effect via its index (1 ops)

Effect = Effect:setDamageType(Number Index)

Sets the damage type of the effect. See DMG_ Enums on GMod Wiki (1 ops)

Effect = Effect:setColor(Number Index)

Sets the color of the effect. Color is represented by a byte (1 ops)

Effect = Effect:setAttachment(Number Index)

Creates new attachment ID for the effect (1 ops)

Effect:play(String Name)

Plays the effect with given name (eg. watersplash) (1 ops)

Number = effectCanPlay()

Returns whether you can play an effect (or 0 if you've hit the burst limit) (1 ops)

Number = effectCanPlay(String Name)

Same as effectCanPlay(), but also checks if the specific effect is not allowed (1 ops)

Expression 2 ⚙️

Getting Started 🕊

Guides (In learning order) 🎓

Tools 🛠️

Click To Expand

Advanced

Beacon 💡

Control 🎛️

Data 💿

Detection 👀

Display 💻

Render 🖌

I/O 🔌

Physics 🚀

Utilities 🛠️

RFID 💳

Wireless 🛜

Gates 🚥

Click To Expand

TBD

Extras 🔭

Clone this wiki locally