Difference between revisions of "Particles"
DeamonHunter (Talk | contribs) (Initial commit.) |
DeamonHunter (Talk | contribs) (Add in missing Modding Key Term) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 9: | Line 9: | ||
− | = Creating a *. | + | = 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. | 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. | ||
Line 36: | Line 36: | ||
= Config Options = | = Config Options = | ||
== "code" == | == "code" == | ||
− | '''Valid options (String): <code> | + | '''Valid options ([[Modding_Key_Terms#String|String]]): <code>A unique string which Particle System this object is.</code>''' |
'''Default Value:''' No default value is specified. Always need to provide your own. | '''Default Value:''' No default value is specified. Always need to provide your own. | ||
− | A string containing the code of the | + | A string containing the code of the Particles the blob will be referring to. |
== "angularVelocity" == | == "angularVelocity" == | ||
− | '''Valid options ( | + | '''Valid options ([[Modding_Key_Terms#Float|Float]]): <code>A positive decimal number.</code>''' |
'''Default Value:''' No default value is specified. Always need to provide your own. | '''Default Value:''' No default value is specified. Always need to provide your own. | ||
Line 51: | Line 51: | ||
This number affects the amount of angular velocity, or the spin, of each particle that is spawned. | This number affects the amount of angular velocity, or the spin, of each particle that is spawned. | ||
+ | |||
== "color" == | == "color" == | ||
− | '''Valid options ( | + | '''Valid options ([[Modding_Key_Terms#Colour|Colour]]): <code>A string of 6 (RRGGBB) or 8 (AARRGGBB) characters represent the hex code of a colour e.g. ABC123 or AABBCCDD.</code>''' |
'''Default Value:''' No default value is specified. Always need to provide your own. | '''Default Value:''' No default value is specified. Always need to provide your own. | ||
Line 62: | Line 63: | ||
== "colorSpread" == | == "colorSpread" == | ||
− | '''Valid options ( | + | '''Valid options ([[Modding_Key_Terms#Vector 3|Vector 3]] - [[Modding_Key_Terms#Float|Float]]): <code>{"x": 0.0, "y": 0.0, "z": 0.0}</code>''' |
'''Default Value:''' No default value is specified. Always need to provide your own. | '''Default Value:''' No default value is specified. Always need to provide your own. | ||
Line 68: | Line 69: | ||
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. | 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 ([[Modding_Key_Terms#Float|Float]]): <code>A positive decimal number.</code>''' | ||
+ | |||
+ | '''Default Value:''' If not specified, will default to 0.0. | ||
+ | |||
+ | |||
+ | This specifies how much light each particle will give off. | ||
+ | |||
+ | |||
+ | == "emitDuration" == | ||
+ | '''Valid options ([[Modding_Key_Terms#Float|Float]]): <code>A positive decimal number.</code>''' | ||
+ | |||
+ | '''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" == | == "emitVelocity" == | ||
− | '''Valid options ( | + | '''Valid options ([[Modding_Key_Terms#Vector 3|Vector 3]] - [[Modding_Key_Terms#Float|Float]]): <code>{"x": 0.0, "y": 0.0, "z": 0.0}</code>''' |
'''Default Value:''' No default value is specified. Always need to provide your own. | '''Default Value:''' No default value is specified. Always need to provide your own. | ||
Line 79: | Line 99: | ||
== "emitVelocitySpread" == | == "emitVelocitySpread" == | ||
− | '''Valid options ( | + | '''Valid options ([[Modding_Key_Terms#Vector 3|Vector 3]] - [[Modding_Key_Terms#Float|Float]]): <code>{"x": 0.0, "y": 0.0, "z": 0.0}</code>''' |
'''Default Value:''' No default value is specified. Always need to provide your own. | '''Default Value:''' No default value is specified. Always need to provide your own. | ||
Line 88: | Line 108: | ||
== "gravityFactor" == | == "gravityFactor" == | ||
− | '''Valid options ( | + | '''Valid options ([[Modding_Key_Terms#Vector 3|Vector 3]] - [[Modding_Key_Terms#Float|Float]]): <code>{"x": 0.0, "y": 0.0, "z": 0.0}</code>''' |
'''Default Value:''' No default value is specified. Always need to provide your own. | '''Default Value:''' No default value is specified. Always need to provide your own. | ||
Line 94: | Line 114: | ||
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. | 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 ([[Modding_Key_Terms#Float|Float]]): <code>A positive decimal number.</code>''' | ||
+ | |||
+ | '''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" == | == "liveDuration" == | ||
− | '''Valid options (Float): <code>A decimal number | + | '''Valid options ([[Modding_Key_Terms#Float|Float]]): <code>A positive decimal number.</code>''' |
'''Default Value:''' No default value is specified. Always need to provide your own. | '''Default Value:''' No default value is specified. Always need to provide your own. | ||
Line 106: | Line 135: | ||
== "particlesPerSecond" == | == "particlesPerSecond" == | ||
− | '''Valid options (Float): <code>A decimal number | + | '''Valid options ([[Modding_Key_Terms#Float|Float]]): <code>A positive decimal number.</code>''' |
'''Default Value:''' No default value is specified. Always need to provide your own. | '''Default Value:''' No default value is specified. Always need to provide your own. | ||
Line 115: | Line 144: | ||
== "position" == | == "position" == | ||
− | '''Valid options ( | + | '''Valid options ([[Modding_Key_Terms#Vector 3|Vector 3]] - [[Modding_Key_Terms#Float|Float]]): <code>{"x": 0.0, "y": 0.0, "z": 0.0}</code>''' |
'''Default Value:''' No default value is specified. Always need to provide your own. | '''Default Value:''' No default value is specified. Always need to provide your own. | ||
Line 121: | Line 150: | ||
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. | 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 ([[Modding_Key_Terms#Float|Float]]): <code>A positive decimal number.</code>''' | ||
+ | |||
+ | '''Default Value:''' If not specified, will default to 0.0. | ||
+ | |||
+ | |||
+ | This specifies how much a particle will be rotated around when spawned. | ||
== "positionSpread" == | == "positionSpread" == | ||
− | '''Valid options ( | + | '''Valid options ([[Modding_Key_Terms#Vector 3|Vector 3]] - [[Modding_Key_Terms#Float|Float]]): <code>{"x": 0.0, "y": 0.0, "z": 0.0}</code>''' |
'''Default Value:''' No default value is specified. Always need to provide your own. | '''Default Value:''' No default value is specified. Always need to provide your own. | ||
Line 133: | Line 171: | ||
== "scale" == | == "scale" == | ||
− | '''Valid options ( | + | '''Valid options ([[Modding_Key_Terms#Float|Float]]): <code>A positive decimal number.</code>''' |
'''Default Value:''' No default value is specified. Always need to provide your own. | '''Default Value:''' No default value is specified. Always need to provide your own. | ||
Line 142: | Line 180: | ||
== "scaleSpread" == | == "scaleSpread" == | ||
− | '''Valid options ( | + | '''Valid options ([[Modding_Key_Terms#Float|Float]]): <code>A positive decimal number.</code>''' |
'''Default Value:''' No default value is specified. Always need to provide your own. | '''Default Value:''' No default value is specified. Always need to provide your own. | ||
Line 148: | Line 186: | ||
An additional multiplier that specifies scaled the maximum amount of variance in size. Particles can grow or shrink up to this value. | An additional multiplier that specifies scaled the maximum amount of variance in size. Particles can grow or shrink up to this value. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== "velocityStretch" == | == "velocityStretch" == | ||
− | '''Valid options (Float): <code>A decimal number</code>''' | + | '''Valid options ([[Modding_Key_Terms#Float|Float]]): <code>A positive decimal number.</code>''' |
− | '''Default Value:''' 0.0 | + | '''Default Value:''' If not specified, will default to 0.0. |
This specifies how much a particle will stretch because of it's speed. | This specifies how much a particle will stretch because of it's speed. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 06:45, 7 February 2018
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 (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 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.