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
number CEffectData:GetAttachment()
Returns the attachment ID for 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.
number CEffectData:GetMagnitude()
Returns the magnitude of the effect.
number CEffectData:GetMaterialIndex()
Returns the material ID of the effect.
number CEffectData:GetSurfaceProp()
Returns the surface property index 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.
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.
Sets the entity of the effect to be created with this effect data.
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.
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.
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.
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)
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.
Sets the scale of the effect to be created with this effect data.
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)