Garry's Mod Wiki

CEffectData

List of all possible functions available for effect data. This is the object returned by the EffectData function and is required for util.Effect function.

Methods

Angle CEffectData:GetAngles()
Returns the angles of the effect.
number CEffectData:GetAttachment()
Returns the attachment ID for the effect.
number CEffectData:GetColor()
Returns byte which represents the color of the effect.
number CEffectData:GetDamageType()
Returns the damage type of the effect
number CEffectData:GetEntIndex()
Returns the entity index of the entity set for the effect.
Entity CEffectData:GetEntity()
Returns the entity assigned to the effect.
number CEffectData:GetFlags()
Returns the flags of the effect.
number CEffectData:GetHitBox()
Returns the hit box ID of the effect.
number CEffectData:GetMagnitude()
Returns the magnitude of the effect.
number CEffectData:GetMaterialIndex()
Returns the material ID of the effect.
Vector CEffectData:GetNormal()
Returns the normalized direction vector of the effect.
Vector CEffectData:GetOrigin()
Returns the origin position of the effect.
number CEffectData:GetRadius()
Returns the radius of the effect.
number CEffectData:GetScale()
Returns the scale of the effect.
Vector CEffectData:GetStart()
Returns the start position of the effect.
number CEffectData:GetSurfaceProp()
Returns the surface property index of the effect.
CEffectData:SetAngles( Angle ang )
Sets the angles of the effect.
CEffectData:SetAttachment( number attachment )
Sets the attachment id of the effect to be created with this effect data. This is internally stored as an integer, but only the first 5 bits will be networked, effectively limiting this function to 0-31 range.
CEffectData:SetColor( number color )
Sets the "color" of the effect. All this does is provide an addition 8 bits of data for the effect to use. What this will actually do will vary from effect to effect, depending on how a specific effect uses this given data, if at all. Internally stored as an integer, but only first 8 bits are networked, effectively limiting this function to 0-255 range.
CEffectData:SetDamageType( number damageType )
Sets the damage type of the effect to be created with this effect data.
CEffectData:SetEntIndex( number entIndex )
Sets the entity of the effect via its index.
CEffectData:SetEntity( Entity entity )
Sets the entity of the effect to be created with this effect data.
CEffectData:SetFlags( number flags )
Sets the flags of the effect. Can be used to change the appearance of a MuzzleFlash effect. Example values for MuzzleFlash effect Flags Description 1 Regular muzzleflash 5 Combine muzzleflash 7 Regular muzzle but bigger Internally stored as an integer, but only first 8 bits are networked, effectively limiting this function to 0-255 range.
CEffectData:SetHitBox( number hitBoxIndex )
Sets the hit box index of the effect. Internally stored as an integer, but only first 11 bits are networked, effectively limiting this function to 0-2047 range.
CEffectData:SetMagnitude( number magnitude )
Sets the magnitude of the effect. Internally stored as a float with 12 bit precision for networking purposes, limited to range of 0-1023.
CEffectData:SetMaterialIndex( number materialIndex )
Sets the material index of the effect. Internally stored as an integer, but only first 12 bits are networked, effectively limiting this function to 0-4095 range.
CEffectData:SetNormal( Vector normal )
Sets the normalized (length=1) direction vector of the effect to be created with this effect data. This must be a normalized vector for networking purposes.
CEffectData:SetOrigin( Vector origin )
Sets the origin of the effect to be created with this effect data. Limited to world bounds (+-16386 on every axis) and has horrible networking precision. (17 bit float per component)
CEffectData:SetRadius( number radius )
Sets the radius of the effect to be created with this effect data. Internally stored as a float, but networked as a 10bit float, and is clamped to 0-1023 range.
CEffectData:SetScale( number scale )
Sets the scale of the effect to be created with this effect data.
CEffectData:SetStart( Vector start )
Sets the start of the effect to be created with this effect data. Limited to world bounds (+-16386 on every axis) and has horrible networking precision. (17 bit float per component)
CEffectData:SetSurfaceProp( number surfaceProperties )
Sets the surface property index of the effect. Internally stored as an integer, but only first 8 bits are networked, effectively limiting this function to -1-254 range. (yes, that's not a mistake)