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
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: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)