Editing Particle Systems
On January 23, 2011 at 10:21:37 AMAll particle systems are found in data/particlesystems/ and have a file extension of .psys.
Like a lot of the data in SLT, they are XML files, so you're going to need a text editor.
Code:
<?xml version="1.0" encoding="UTF-8" ?>
<System>
<Emitter Texture = "Particle.png" MaxParticles = "100" Rate = "0.1" Size = "1" EmitFrom = "Sphere" MinParticleColour = "1,0.2,0,1" MaxParticleColour = "1,0.2,0,1" MinDecay = "0.4" MaxDecay = "0.9f" MinSpeed = "-0.04,0.006,-0.04" MaxSpeed = "0.04,0.011,0.04" MinAcceleration = "-0.1,0,-0.1" MaxAcceleration = "0.1,6,0.1" MinParticleSize = "0.5f" MaxParticleSize = "1.0f"/>
<Emitter Type = "Pathed" Texture = "Particle.png" MaxParticles = "200" Rate = "0.05" Size = "0.1" EmitFrom = "Sphere" MinParticleColour = "0.2,0.8,0,1" MaxParticleColour = "0.4,1,0,1" MinParticleSize = "0.1f" MaxParticleSize = "0.2f">
<Path MaxSpeed = "7" MinSpeed="4">
<Point Position="0,0,0" Type="Relative" Time="0"/>
<Point Position="-2,0,0" Type="Relative" Time="0.5"/>
<Point Position="0,0,0" Type="Relative" Time="1"/>
</Path>
</Emitter>
</System>
(pointless example)
XML declaration
Code:
<?xml version="1.0" encoding="UTF-8" ?>
Required far a valid XML file.
System element
Code:
<System>
</System>
All emitters go in one of these.
Emitter element
Code:
<Emitter Texture = "Particle.png" MaxParticles = "100" Rate = "0.1" Size = "1" EmitFrom = "Sphere" MinParticleColour = "1,0.2,0,1" MaxParticleColour = "1,0.2,0,1" MinDecay = "0.4" MaxDecay = "0.9f" MinSpeed = "-0.04,0.006,-0.04" MaxSpeed = "0.04,0.011,0.04" MinAcceleration = "-0.1,0,-0.1" MaxAcceleration = "0.1,6,0.1" MinParticleSize = "0.5f" MaxParticleSize = "1.0f"/>
An emitter - there are two types, a regular one that just emits particles from an area and a pathed one which emits particles that follow a path.
Available properties are:
(anything highlighted in blue does not apply for pathed emitters)
- Type - "Pathed" for a pathed emitter.
- Texture - The texture of the particles.
- MaxParticles - The maximum amount of particles that can exist at any one time.
- Rate - The time between emitting particles.
- EmitFrom - The shape to emit particles from. (Cube, sphere, circle, square)
- Size - The size of the shape. (For cube and square it's the side length, for circle and sphere it's the radius)
- MinParticleColour/MaxParticleColour - Defines the range of colours that the particles can be.
- MinDecay - The minimum decay.
- MaxDecay - The maximum decay.
- MinSpeed - The minimum speed.
- MaxSpeed - The maximum speed.
- MinAcceleration - The minimum acceleration.
- MaxAcceleration - The maximum acceleration.
- MinParticleSize - The smallest a particle can be.
- MaxParticleSize - The largest a particle can be.
So, if i wanted an emitter that emitted blue particles from a circle upwards at a constant speed...
Code:
<Emitter Texture = "Particle.png" MaxParticles = "100" Rate = "0.1" Size = "1" EmitFrom = "Circle" MinParticleColour = "0,0,1,1" MaxParticleColour = "0,0,1,1" MinDecay = "0.4" MaxDecay = "0.9" MinSpeed = "0.0,1.0,0.0" MaxSpeed = "0.0,2.0,0.0" MinParticleSize = "1.0f" MaxParticleSize = "1.0f"/>
These are for path emitters.
Path element
Code:
<Path MaxSpeed = "7" MinSpeed="4">
</Path>
Defines a path for a pathed emitter.
Available properties are:
- MinSpeed - The minimum speed.
- MaxSpeed - The maximum speed.
Point element
Code:
<Point Position="0,0,0" Type="Relative" Time="0"/>
Defines a point along a path.
Available properties are:
- Position - The position of this point.
- Type - The type of the point - only "relative" currently.
- Time - The time of this point (0 = start, 1 = end;).
(Coming soon - spell editing tutorial!)