Particles
In Staxel, *.particle files are used to specify a particle spawner. These particle spawners have several properties;
- Location and Size
- Speed and size of spawned particles
- Colour and gravity of particles
Along with more options.
Contents
- 1 Creating a *.particle file
- 2 Config Options
- 2.1 "code"
- 2.2 "angularVelocity"
- 2.3 "color"
- 2.4 "colorSpread"
- 2.5 "emissive"
- 2.6 "emitDuration"
- 2.7 "emitVelocity"
- 2.8 "emitVelocitySpread"
- 2.9 "gravityFactor"
- 2.10 "insideOpasity"
- 2.11 "liveDuration"
- 2.12 "particlesPerSecond"
- 2.13 "position"
- 2.14 "positionRotation"
- 2.15 "positionSpread"
- 2.16 "scale"
- 2.17 "scaleSpread"
- 2.18 "velocityStretch"
Creating a *.particle file
Creating an effect is fairly easy, though will take work in order to get the particle correct. The following is a file which implements all the options of a particle spawner.
{ "code" : "mods.yourmodname.particlefilename", "angularVelocity" : 0.0, "liveDuration" : 1.5, "particlesPerSecond" : 120.0, "scale" : 0.5, "scaleSpread" : 0.0, "emitDuration" : 0.0, "color" : "ff023CCB", "colorSpread" : {"x" : 0.05, "y" : 0.05, "z" : 0.05}, "emitVelocity" : {"x" : 0.0, "y" : 6.7, "z" : 0.0}, "emitVelocitySpread" : {"x" : 4.5, "y" : 2.5, "z" : 4.5}, "gravityFactor" : {"x" : 0.0, "y" : -0.25, "z" : 0.0}, "position" : {"x" : 0.0, "y" : -0.125, "z" : 0.0}, "positionSpread" : {"x" : 0.5, "y" : 0.05, "z" : 0.5} }
Once you have created a file like that, you can then specify the code for other files which can play particles, such as Effect files. For info on what each option actually does, look below at #Config Options.
Config Options
"code"
Valid options (String): A unique string which Particle System this object is.
Default Value: No default value is specified. Always need to provide your own.
A string containing the code of the Particles the blob will be referring to.
"angularVelocity"
Valid options (Float): A positive decimal number.
Default Value: No default value is specified. Always need to provide your own.
This number affects the amount of angular velocity, or the spin, of each particle that is spawned.
"color"
Valid options (Colour): A string of 6 (RRGGBB) or 8 (AARRGGBB) characters represent the hex code of a colour e.g. ABC123 or AABBCCDD.
Default Value: No default value is specified. Always need to provide your own.
This is the colour of which all particles are spawned with. This takes affect before colour spread.
"colorSpread"
Valid options (Vector 3 - Float): {"x": 0.0, "y": 0.0, "z": 0.0}
Default Value: No default value is specified. Always need to provide your own.
This specifies how much the colour should vary. In this case "x" represents the change in Red, "y" Green and "z" Blue. These values are between 0 and 1, 0 being no change in colour, and 1 being able to change to any value.
"emissive"
Valid options (Float): A positive decimal number.
Default Value: If not specified, will default to 0.0.
This specifies how much light each particle will give off.
"emitDuration"
Valid options (Float): A positive decimal number.
Default Value: If not specified, will default to 0.0.
This specifies how long a particle source will continue to spawn particles. After the amount of seconds has passed, no new particles can spawn. If left as 0, then the particles will continue on infinitely, as long as the thing causing the particles stays in the world.
"emitVelocity"
Valid options (Vector 3 - Float): {"x": 0.0, "y": 0.0, "z": 0.0}
Default Value: No default value is specified. Always need to provide your own.
This specifies the initial speed of the velocity along the three axis. Applied before "emitVelocitySpread".
"emitVelocitySpread"
Valid options (Vector 3 - Float): {"x": 0.0, "y": 0.0, "z": 0.0}
Default Value: No default value is specified. Always need to provide your own.
This specifies the maximum amount of speed that can be randomly subtracted or added to the initial velocity of the particle when spawned.
"gravityFactor"
Valid options (Vector 3 - Float): {"x": 0.0, "y": 0.0, "z": 0.0}
Default Value: No default value is specified. Always need to provide your own.
This specifies the speed at which the particle will change during the time it is alive. For example, a value of "y": 1.0 will make the particle fall downwards.
"insideOpasity"
Valid options (Float): A positive decimal number.
Default Value: If not specified, will default to 1.0.
This specifies how opaque a particle will be, with 0 being invisible and 1 being fully visible.
"liveDuration"
Valid options (Float): A positive decimal number.
Default Value: No default value is specified. Always need to provide your own.
This specifies how long a particle will stay "alive". After the amount of seconds specified, the particle will be destroyed. Should be set to a low value in order to avoid players having too many particles to render.
"particlesPerSecond"
Valid options (Float): A positive decimal number.
Default Value: No default value is specified. Always need to provide your own.
This specifies how many separate particles will be spawned per second. It can be though of spawning a particle every 1/xth of a second.
"position"
Valid options (Vector3): {"x": 0.0, "y": 0.0, "z": 0.0}
Default Value: No default value is specified. Always need to provide your own.
This specifies the initial offset of the particle to the tile. Often placing all values to 0.5 will place in the centre of a tile. Though this will change depending on use.
"positionRotation"
Valid options (Float): A positive decimal number.
Default Value: If not specified, will default to 0.0.
This specifies how much a particle will be rotated around when spawned.
"positionSpread"
Valid options (Vector 3 - Float): {"x": 0.0, "y": 0.0, "z": 0.0}
Default Value: No default value is specified. Always need to provide your own.
This specifies the maximum distance away from the offset the the particle can spawn. For example have a value of "y" : 1 means that a particle can spawn up to 1 tile higher or lower than the actual offset.
"scale"
Valid options (Float): A positive decimal number.
Default Value: No default value is specified. Always need to provide your own.
This specifies scaled size of the spawned particle.
"scaleSpread"
Valid options (Float): A positive decimal number.
Default Value: No default value is specified. Always need to provide your own.
An additional multiplier that specifies scaled the maximum amount of variance in size. Particles can grow or shrink up to this value.
"velocityStretch"
Valid options (Float): A positive decimal number.
Default Value: If not specified, will default to 0.0.
This specifies how much a particle will stretch because of it's speed.