# Tremulous Particle System Files matching the pattern `scripts/*.particle` are loaded as particle system description files. Each `.particle` file can contain an arbitrary number of discrete particle systems, much like a `.shader` file can house many shaders. A particle system is declared by a name followed by curly braces within which the functionality of the particle system is defined. For example: ``` aShinyNewParticleSystem { } ``` Inside the particle system declaration are placed UP TO *four* particle ejectors. Ejectors are identified by the keyword ejector and curly braces: ``` aShinyNewParticleSystem { ejector { } ejector { } thirdPersonOnly } ``` The `thirdPersonOnly` keyword may be used to specify that the particle system is not visible from the first person if it relates to that client. The role of the particle ejector is to create some number of new particles at a defined rate. These attributes are controlled by the following parameters: - count `|infinite` - the number of particles this ejector will spawn. - delay `` - the delay in msec before the ejector starts spawning. - period ` ` - the period between particle ejections. It is perfectly acceptable to have an initial period of zero. In this case the number of particles specified by the count keyword will be ejected at once. It is not permissible to have count infinite and a period of zero for obvious reasons. At ejection time each ejector creates up to four new particles based on templates. These are specified in the ejector section using the particle keyword: ``` aShinyNewParticleSystem { ejector { particle { } particle { } count 50 delay 0 period 0 - 0 } } ``` Each particle template has a number of attributes: - `shader |sync ... ` - this specifies the shaders to use for the particle. The frame rate can be set to a static rate or the sync parameter can be used in which case the frame rate will be synchronised to the lifetime of the particle such that the first frame is displayed on birth and the last frame is displayed immediately before death. - `model ... ` - use one of the specified models as the particle. This cannot be used in conjunction with the shader keyword. - `modelAnmation |sync` - animation parameters to use when model particles are employed. - `displacement ` - a static displacement about the attachment point. The variance parameter specifies a random displacement in all axes. - `normalDisplacement ` - for particle systems that have their normal set (impact particle systems for example) this specifies the magnitude of a displacement along the normal. - `velocityType static|static_transform|tag|cent|normal` - this specifies how the particle will compute its initial velocity. `static` means it is specified statically in the `.particle` file, `static_transform` means the same, except that it is transformed by the orientation matrix of what it is attached to, `tag` means the velocity is in the direction of the tag it is attached to, `cent` means the velocity is in the direction of the cent it is attached to and `normal` means the velocity is in the direction of the particle system normal. - `velocityDir linear|point` - this specifies whether the initial velocity is computed as a simple direction or as the direction towards a secondary point (defined by `velocityPoint` or dynamically through `velocityType cent`). - `velocity ` - for when `velocityType static` is present this specifies the direction. The variance here is specified in degrees e.g. `~5` - up to 5 degrees deviation. - `velocityMagnitude ` - the magnitude of the velocity. - `velocityPoint ` - for when `velocityType static` and `velocityDir point` are present this specifies the point to move towards. - `parentVelocityFraction ` - for when the particle system is attached to a cent this specifies the fraction of the cent’s velocity that is added to the particle’s velocity. - `accelerationType static|static_transform|tag|cent|normal` - this specifies how the particle will compute its acceleration. `static` means it is specified statically in the `.particle` file, `static_transform` means the same, except that it is transformed by the orientation matrix of what it is attached to, `tag` means the acceleration is in the direction of the tag it is attached to, `cent` means the acceleration is in the direction of the cent it is attached to and `normal` means the acceleration is in the direction of the particle system normal. - `accelerationDir linear|point` - this specifies whether the acceleration is computed as a simple direction or as the direction towards a secondary point (defined by `accelerationPoint` or dynamically through `accelerationType cent`). - `acceleration ` - for when accelerationType static is present this specifies the direction. The variance here is specified in degrees e.g. `~5` - up to 5 degrees deviation. - `accelerationMagnitude ` - the magnitude of the acceleration. - `accelerationPoint ` - for when accelerationType static and accelerationDir point are present this specifies the point to move towards. - `bounce |cull` - the fraction of velocity that is refiected when a particle collides. If this is set to `0.0` the particle won't collide. When cull is used particles are culled as soon as they collide with objects. - `bounceMark ` - make a mark at each bounce point for up to `` bounces. - `bounceSound ` - make a sound at each bounce point for up to `` bounces. - `dynamicLight { }` - attach a dynamic light to this particle. - `color { } { }` - color the particle where `` refers to the initial color component and `` refers to the final color component. - `overdrawProtection` - cull particles that occupy a large amount of screen space. - `realLight` - light particles using the lightgrid instead of fullbright. - `cullOnStartSolid` - cull particles that are spawned inside brushes. - `radius ` - the radius of the particle throughout its lifetime. The delay parameter specifies the time in msec before radius scaling begins. The initial and final parameters specify the radii of the particle in quake units. - `alpha ` - the alpha of the particle throughout its lifetime. The delay parameter specifies the time in msec before alpha scaling begins. The initial and final parameters specify the alpha of the particle where `1.0` is totally opaque and `0.0` is totally transparent. - `rotation ` - the rotation of the particle throughout its lifetime. The delay parameter specifies the time in msec before the rotation begins. The initial and final parameters specify the rotation of the particle in degrees. - `lifeTime