Particles on models: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Robot: fixing template case.)
m (added note about prop statics, not tested myself, but apparently it's so.)
Line 1: Line 1:
Particle Effects can be attached to models by adding a "particles" section the model's [[.qc]] file. Particles specified in this manner will be created whenever an entity [[SetModel()|switches to using the model]]. This usually occurs when an entity is spawned for the first time, but can also happen when an entity dynamically switches models.
Particle Effects can be attached to models by adding a "particles" section the model's [[.qc]] file. Particles specified in this manner will be created whenever an entity [[SetModel()|switches to using the model]]. This usually occurs when an entity is spawned for the first time, but can also happen when an entity dynamically switches models.
{{note|does not with with prop_static's.}}


Within the .qc's [[$keyvalues]] section, the format is as follows:
Within the .qc's [[$keyvalues]] section, the format is as follows:

Revision as of 15:15, 15 May 2009

Particle Effects can be attached to models by adding a "particles" section the model's .qc file. Particles specified in this manner will be created whenever an entity switches to using the model. This usually occurs when an entity is spawned for the first time, but can also happen when an entity dynamically switches models.

Note.pngNote:does not with with prop_static's.

Within the .qc's $keyvalues section, the format is as follows:

particles
{
	effect
	{
		name			"<particle effect name>"
		attachment_type		<attachment type>
		attachment_point	<name of attachment point>
	}

	<further effects>
}
name
Must match the name of one of the .pcf files in the particles/ directory.
attachment_type
Must match one of the valid attachment types. These are:
start_at_origin
The particle effect is created at the origin of the entity it's attached to. The effect doesn't move.
start_at_attachment
The particle effect is created on an attachment point on the entity it's attached to. The effect doesn't move.
follow_origin
The particle effect is created at the origin of the entity it's attached to. The effect is updated to move with the entity's origin.
follow_attachment
The particle effect is created on an attachment point on the entity it's attached to. The effect is updated to move with the attachment point.
attachment_point
Must match the name of an attachment point in the model. This field is only needed if the attachment_type is one that uses an attachment point.
Todo: How are already-emitted particles affected by start/follow?