Difference between revisions of "User:Jackoalan/Particle Script"

From Retro Modding Wiki
Jump to: navigation, search
Line 10: Line 10:
 
* [[#Vector Elements|Vector]] (3-component float)
 
* [[#Vector Elements|Vector]] (3-component float)
 
* [[#Mod Vector Elements|Mod Vector]] (3-component float)
 
* [[#Mod Vector Elements|Mod Vector]] (3-component float)
** Velocity vector in/out
+
** Local velocity vector in/out
** Position vector in/out
+
** Local position vector in/out
 
* [[#Color Elements|Color]] (4-component float, internally converted to RGBA8)
 
* [[#Color Elements|Color]] (4-component float, internally converted to RGBA8)
 
* [[#UV Elements|UV]] ([[TXTR_(File_Format)|TXTR]] reference and [[wikipedia:UV_mapping|UV coordinate]] source)
 
* [[#UV Elements|UV]] ([[TXTR_(File_Format)|TXTR]] reference and [[wikipedia:UV_mapping|UV coordinate]] source)
 
* [[#Emitter Elements|Emitter]]
 
* [[#Emitter Elements|Emitter]]
** Initial position vector (3-component float)
+
** Initial local position vector (3-component float)
** Initial velocity vector (3-component float)
+
** Initial local velocity vector (3-component float)
  
 
The system features several subclasses that output generated values through <code>GetValue</code> as a function of the current frame index.
 
The system features several subclasses that output generated values through <code>GetValue</code> as a function of the current frame index.
Line 23: Line 23:
 
== File Layout ==
 
== File Layout ==
  
All effect script file formats are read linearly to populate a ''descriptor'' tree of element nodes:  
+
All effect script file formats are read linearly to populate a ''description'' tree of element nodes, serving as a template to build an arbitrary number of ''generator'' instances:  
  
 
* Script Magic FourCC (see [[#Script Types|table below]])
 
* Script Magic FourCC (see [[#Script Types|table below]])
Line 84: Line 84:
 
! DKCR
 
! DKCR
 
! DKCTF
 
! DKCTF
{{ParticleElementRow|ADD_|IntElement a, IntElement b|Add|Returns ''a'' + ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|ADD_|IntElement&nbsp;a, IntElement&nbsp;b|Add|Returns ''a'' + ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|CHAN|IntElement a, IntElement b, IntElement thresholdFrame|Time Chain|Returns ''a'' when current frame index is less-than ''thresholdFrame'', otherwise ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|CHAN|IntElement&nbsp;a, IntElement&nbsp;b, IntElement&nbsp;thresholdFrame|Time Chain|Returns ''a'' when current frame index is less-than ''thresholdFrame'', otherwise ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|CLMP|IntElement min, IntElement max, IntElement val|Clamp|Returns ''val'' clamped between ''min'' and ''max''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|CLMP|IntElement&nbsp;min, IntElement&nbsp;max, IntElement&nbsp;val|Clamp|Returns ''val'' clamped between ''min'' and ''max''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|CNST|s32 value|Constant|Returns ''value'' on every call|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|CNST|s32&nbsp;value|Constant|Returns ''value'' on every call|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|DETH|IntElement passthrough, IntElement thresholdFrame|Death|Always returns ''passthrough'', and signals out-of-band to cease updating the system when the current frame index exceeds ''thresholdFrame''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|DETH|IntElement&nbsp;passthrough, IntElement&nbsp;thresholdFrame|Death|Always returns ''passthrough'', and signals out-of-band to cease updating the system when the current frame index exceeds ''thresholdFrame''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
{{ParticleElementRow|GAPC||{{unknown|'''Unknown'''}}||{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
{{ParticleElementRow|GAPC||{{unknown|'''Unknown'''}}||{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
{{ParticleElementRow|GEMT||{{unknown|'''Unknown'''}}||{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
{{ParticleElementRow|GEMT||{{unknown|'''Unknown'''}}||{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
{{ParticleElementRow|GTCP||{{unknown|'''Unknown'''}}||{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
{{ParticleElementRow|GTCP||{{unknown|'''Unknown'''}}||{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|ILPT|IntElement percent|Lifetime Percent|Queries the frame index at ''percent''/100.0 into the lifetime of the particle instance|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|ILPT|IntElement&nbsp;percent|Lifetime Percent|Queries the frame index at ''percent''/100.0 into the lifetime of the particle instance|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|IMPL|IntElement val|Impulse|Returns ''val'' ONLY at frame index 0, then returns 0 for subsequent frames|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|IMPL|IntElement&nbsp;val|Impulse|Returns ''val'' ONLY at frame index 0, then returns 0 for subsequent frames|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|IRND|IntElement a, IntElement b|Initial Random|Rolls a random value between ''a'' and ''b'' on frame index 0; returns that value for subsequent frames|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|IRND|IntElement&nbsp;a, IntElement&nbsp;b|Initial Random|Rolls a random value between ''a'' and ''b'' on frame index 0; returns that value for subsequent frames|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|KEYE|[[#Keyframe Emitter Template|KeyframeEmitterData]] data|Keyframe Emitter|List of synchronized animation keys|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|KEYE|[[#Keyframe Emitter Template|KeyframeEmitterData]]&nbsp;data|Keyframe Emitter|List of synchronized animation keys|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|KEYP|[[#Keyframe Emitter Template|KeyframeEmitterData]] data|Keyframe Emitter|List of percentage-tweened animation keys|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|KEYP|[[#Keyframe Emitter Template|KeyframeEmitterData]]&nbsp;data|Keyframe Emitter|List of percentage-tweened animation keys|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|MODU|IntElement a, IntElement b|Modulo|Returns ''a'' % ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|MODU|IntElement&nbsp;a, IntElement&nbsp;b|Modulo|Returns ''a'' % ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|MULT|IntElement a, IntElement b|Multiply|Returns ''a'' * ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|MULT|IntElement&nbsp;a, IntElement&nbsp;b|Multiply|Returns ''a'' * ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|PULS|IntElement aDuration, IntElement bDuration, IntElement a, IntElement b|Pulse|Returns ''a'' for ''aDuration'' frames then ''b'' for ''bDuration'' frames, then repeats this cycle|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|PULS|IntElement&nbsp;aDuration, IntElement&nbsp;bDuration, IntElement&nbsp;a, IntElement&nbsp;b|Pulse|Returns ''a'' for ''aDuration'' frames then ''b'' for ''bDuration'' frames, then repeats this cycle|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|RAND|IntElement a, IntElement b|Random|Rolls a random value between ''a'' and ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|RAND|IntElement&nbsp;a, IntElement&nbsp;b|Random|Rolls a random value between ''a'' and ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|SPAH|IntElement val, IntElement waitMin, IntElement waitMax|Sample And Hold|Stores ''val'' for a random count of frames between ''waitMin'' and ''waitMax'' and repeats this cycle|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|SPAH|IntElement&nbsp;val, IntElement&nbsp;waitMin, IntElement&nbsp;waitMax|Sample And Hold|Stores ''val'' for a random count of frames between ''waitMin'' and ''waitMax'' and repeats this cycle|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|SUB_|IntElement a, IntElement b|Subtract|Returns ''a'' - ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|SUB_|IntElement&nbsp;a, IntElement&nbsp;b|Subtract|Returns ''a'' - ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|TSCL|RealElement dv|Time Scale|Returns ''dv'' times the current frame index (rounding down to nearest integer)|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|TSCL|RealElement&nbsp;dv|Time Scale|Returns ''dv'' times the current frame index (rounding down to nearest integer)|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
|}
 
|}
  
Line 118: Line 118:
 
! DKCR
 
! DKCR
 
! DKCTF
 
! DKCTF
{{ParticleElementRow|ADD_|RealElement a, RealElement b|Add|Returns ''a'' + ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|ADD_|RealElement&nbsp;a, RealElement&nbsp;b|Add|Returns ''a'' + ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|CEQL|RealElement ca, RealElement cb, RealElement pass, RealElement fail|Compare Equals|Returns ''pass'' if ''ca'' and ''cb'' are within 0.00001 difference, otherwise ''fail''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|CEQL|RealElement&nbsp;ca, RealElement&nbsp;cb, RealElement&nbsp;pass, RealElement&nbsp;fail|Compare Equals|Returns ''pass'' if ''ca'' and ''cb'' are within 0.00001 difference, otherwise ''fail''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|CEXT|IntElement a|{{unknown|'''Unknown'''}}|Involves a global lookup table|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|CEXT|IntElement&nbsp;a|{{unknown|'''Unknown'''}}|Involves a lookup table|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|CHAN|RealElement a, RealElement b, IntElement thresholdFrame|Time Chain|Returns ''a'' when current frame index is less-than ''thresholdFrame'', otherwise ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|CHAN|RealElement&nbsp;a, RealElement&nbsp;b, IntElement&nbsp;thresholdFrame|Time Chain|Returns ''a'' when current frame index is less-than ''thresholdFrame'', otherwise ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|CLMP|RealElement min, RealElement max, RealElement val|Clamp|Returns ''val'' clamped between ''min'' and ''max''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|CLMP|RealElement&nbsp;min, RealElement&nbsp;max, RealElement&nbsp;val|Clamp|Returns ''val'' clamped between ''min'' and ''max''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|CLTN|RealElement ca, RealElement cb, RealElement pass, RealElement fail|Compare Less-Than|Returns ''pass'' if ''ca'' is less-than ''cb'', otherwise ''fail''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|CLTN|RealElement&nbsp;ca, RealElement&nbsp;cb, RealElement&nbsp;pass, RealElement&nbsp;fail|Compare Less-Than|Returns ''pass'' if ''ca'' is less-than ''cb'', otherwise ''fail''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|CNST|float value|Constant|Returns ''value'' on every call|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|CNST|float&nbsp;value|Constant|Returns ''value'' on every call|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|CRNG|RealElement val, RealElement min, RealElement max, RealElement inRange, RealElement outOfRange|Constant Range|Returns ''inRange'' if ''val'' is between ''min'' and ''max'', otherwise ''outOfRange''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|CRNG|RealElement&nbsp;val, RealElement&nbsp;min, RealElement&nbsp;max, RealElement&nbsp;inRange, RealElement&nbsp;outOfRange|Constant Range|Returns ''inRange'' if ''val'' is between ''min'' and ''max'', otherwise ''outOfRange''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|DOTP|VectorElement a, VectorElement b|[[wikipedia:Dot product|Dot Product]]|Returns ''a'' · ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|DOTP|VectorElement&nbsp;a, VectorElement&nbsp;b|[[wikipedia:Dot product|Dot Product]]|Returns ''a'' · ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
{{ParticleElementRow|GTCR|ColorElement color|Get Component Red|Extracts red component from ''color''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
{{ParticleElementRow|GTCR|ColorElement color|Get Component Red|Extracts red component from ''color''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
{{ParticleElementRow|GTCG|ColorElement color|Get Component Green|Extracts green component from ''color''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
{{ParticleElementRow|GTCG|ColorElement color|Get Component Green|Extracts green component from ''color''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
{{ParticleElementRow|GTCB|ColorElement color|Get Component Blue|Extracts blue component from ''color''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
{{ParticleElementRow|GTCB|ColorElement color|Get Component Blue|Extracts blue component from ''color''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
{{ParticleElementRow|GTCA|ColorElement color|Get Component Alpha|Extracts alpha component from ''color''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
{{ParticleElementRow|GTCA|ColorElement color|Get Component Alpha|Extracts alpha component from ''color''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|IRND|RealElement a, RealElement b|Initial Random|Rolls a random value between ''a'' and ''b'' on frame index 0; returns that value for subsequent frames|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|IRND|RealElement&nbsp;a, RealElement&nbsp;b|Initial Random|Rolls a random value between ''a'' and ''b'' on frame index 0; returns that value for subsequent frames|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|ISWT|RealElement a, RealElement b|Initial Switch|Returns ''a'' ONLY at frame index 0, then returns ''b'' for subsequent frames|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|ISWT|RealElement&nbsp;a, RealElement&nbsp;b|Initial Switch|Returns ''a'' ONLY at frame index 0, then returns ''b'' for subsequent frames|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|ITRL|IntElement a, RealElement b|Int Times Real|Returns ''a'' * ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|ITRL|IntElement&nbsp;a, RealElement&nbsp;b|Int Times Real|Returns ''a'' * ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|KEYE|[[#Keyframe Emitter Template|KeyframeEmitterData]] data|Keyframe Emitter|List of synchronized animation keys|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|KEYE|[[#Keyframe Emitter Template|KeyframeEmitterData]]&nbsp;data|Keyframe Emitter|List of synchronized animation keys|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|KEYP|[[#Keyframe Emitter Template|KeyframeEmitterData]] data|Keyframe Emitter|List of percentage-tweened animation keys|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|KEYP|[[#Keyframe Emitter Template|KeyframeEmitterData]]&nbsp;data|Keyframe Emitter|List of percentage-tweened animation keys|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|LFTW|RealElement a, RealElement b|Lifetime Tween|Linearly-interpolates ''a'' to ''b'' over the lifetime of the particle instance|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|LFTW|RealElement&nbsp;a, RealElement&nbsp;b|Lifetime Tween|Linearly-interpolates ''a'' to ''b'' over the lifetime of the particle instance|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|MULT|RealElement a, RealElement b|Multiply|Returns ''a'' * ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|MULT|RealElement&nbsp;a, RealElement&nbsp;b|Multiply|Returns ''a'' * ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
{{ParticleElementRow|PAPn||Particle System Access Parameter|Accesses the value stored into ADV[1-8] for each system update|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
{{ParticleElementRow|PAPn||Particle System Access Parameter|Accesses the value stored into ADV[1-8] for each system update|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
{{ParticleElementRow|PRLW||Particle Rotation or Line Width|Returns the rotation (in degrees) or line width for the current particle instance|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
{{ParticleElementRow|PRLW||Particle Rotation or Line Width|Returns the rotation (in degrees) or line width for the current particle instance|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
{{ParticleElementRow|PSLL||Particle Size or Line Length|Returns the size or line length for the current particle instance|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
{{ParticleElementRow|PSLL||Particle Size or Line Length|Returns the size or line length for the current particle instance|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|PULS|IntElement aDuration, IntElement bDuration, RealElement a, RealElement b|Pulse|Returns ''a'' for ''aDuration'' frames then ''b'' for ''bDuration'' frames, then repeats this cycle|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|PULS|IntElement&nbsp;aDuration, IntElement&nbsp;bDuration, RealElement&nbsp;a, RealElement&nbsp;b|Pulse|Returns ''a'' for ''aDuration'' frames then ''b'' for ''bDuration'' frames, then repeats this cycle|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|RAND|RealElement a, RealElement b|Random|Rolls a random value between ''a'' and ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|RAND|RealElement&nbsp;a, RealElement&nbsp;b|Random|Rolls a random value between ''a'' and ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|RLPT|RealElement percent|Lifetime Percent|Queries the frame index at ''percent''/100.0 into the lifetime of the particle instance|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|RLPT|RealElement&nbsp;percent|Lifetime Percent|Queries the frame index at ''percent''/100.0 into the lifetime of the particle instance|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|SCAL|RealElement dv|Time Scale|Returns ''dv'' times the current frame index|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|SCAL|RealElement&nbsp;dv|Time Scale|Returns ''dv'' times the current frame index|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|SINE|RealElement magnitude, RealElement linearAngle, RealElement constantAngle|Sine Wave|Returns sin((curFrame * ''linearAngle'' + ''constantAngle'') * π / 180.0) * ''magnitude''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|SINE|RealElement&nbsp;magnitude, RealElement&nbsp;linearAngle, RealElement&nbsp;constantAngle|Sine Wave|Returns sin((curFrame * ''linearAngle'' + ''constantAngle'') * π / 180.0) * ''magnitude''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|SUB_|RealElement a, RealElement b|Subtract|Returns ''a'' - ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|SUB_|RealElement&nbsp;a, RealElement&nbsp;b|Subtract|Returns ''a'' - ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|VMAG|VectorElement vec|Vector Magnitude|Computes magnitude (length) of ''vec''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|VMAG|VectorElement&nbsp;vec|Vector Magnitude|Computes magnitude (length) of ''vec''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|VXTR|VectorElement vec|Vector X To Real|Extracts X component of ''vec''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|VXTR|VectorElement&nbsp;vec|Vector X To Real|Extracts X component of ''vec''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|VYTR|VectorElement vec|Vector Y To Real|Extracts Y component of ''vec''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|VYTR|VectorElement&nbsp;vec|Vector Y To Real|Extracts Y component of ''vec''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|VZTR|VectorElement vec|Vector Z To Real|Extracts Z component of ''vec''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|VZTR|VectorElement&nbsp;vec|Vector Z To Real|Extracts Z component of ''vec''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
|}
 
|}
  
Line 165: Line 165:
 
! DKCR
 
! DKCR
 
! DKCTF
 
! DKCTF
{{ParticleElementRow|ADD_|VectorElement a, VectorElement b|Add|Returns ''a'' + ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|ADD_|VectorElement&nbsp;a, VectorElement&nbsp;b|Add|Returns ''a'' + ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|ANGC|RealElement angleXBias, RealElement angleYBias, RealElement angleXRange, RealElement angleYRange, RealElement magnitude|Angle Cone|Generates a random vector based on (0,0,1) rotated about the X/Y axis. The angles of rotation (in degrees) are set by random ranges ''angleXRange'' and ''angleYRange'', centered around non-random ''angleXBias'' and ''angleYBias''. The resulting vector's length is set as ''magnitude''.|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|ANGC|RealElement&nbsp;angleXBias, RealElement&nbsp;angleYBias, RealElement&nbsp;angleXRange, RealElement&nbsp;angleYRange, RealElement&nbsp;magnitude|Angle Cone|Generates a random vector based on (0,0,1) rotated about the X/Y axis. The angles of rotation (in degrees) are set by random ranges ''angleXRange'' and ''angleYRange'', centered around non-random ''angleXBias'' and ''angleYBias''. The resulting vector's length is set as ''magnitude''.|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|CCLU|VectorElement circleOffset, VectorElement circleNormal, IntElement cycleFrames, RealElement randomFactor|Circle Cluster|Generates a vector along an angular sweep of a unit-circle offset by ''circleOffset'', oriented according to ''circleNormal''. The sweep makes a full rotation within the circle over ''cycleFrames''. The resulting vector has a randomized 3D jitter added; scaled by ''randomFactor'' times the intermediate magnitude.|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|CCLU|VectorElement&nbsp;circleOffset, VectorElement&nbsp;circleNormal, IntElement&nbsp;cycleFrames, RealElement&nbsp;randomFactor|Circle Cluster|Generates a vector along an angular sweep of a unit-circle offset by ''circleOffset'', oriented according to ''circleNormal''. The sweep makes a full rotation within the circle over ''cycleFrames''. The resulting vector has a randomized 3D jitter added; scaled by ''randomFactor'' times the intermediate magnitude.|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|CHAN|VectorElement a, VectorElement b, IntElement thresholdFrame|Time Chain|Returns ''a'' when current frame index is less-than ''thresholdFrame'', otherwise ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|CHAN|VectorElement&nbsp;a, VectorElement&nbsp;b, IntElement&nbsp;thresholdFrame|Time Chain|Returns ''a'' when current frame index is less-than ''thresholdFrame'', otherwise ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|CIRC|VectorElement circleOffset, VectorElement circleNormal, RealElement angleConstant, RealElement angleLinear, RealElement circleRadius|Circle|Generates a vector along an angular sweep of a circle of ''circleRadius'' offset by ''circleOffset'' oriented according to ''circleNormal''. The sweep angle (in degrees) is calculated as (''angleLinear'' * curFrame + ''angleConstant'').|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|CIRC|VectorElement&nbsp;circleOffset, VectorElement&nbsp;circleNormal, RealElement&nbsp;angleConstant, RealElement&nbsp;angleLinear, RealElement&nbsp;circleRadius|Circle|Generates a vector along an angular sweep of a circle of ''circleRadius'' offset by ''circleOffset'' oriented according to ''circleNormal''. The sweep angle (in degrees) is calculated as (''angleLinear'' * curFrame + ''angleConstant'').|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|CNST|RealElement x, RealElement y, RealElement z|Constant|Composes a vector from 3 float components. If all 3 components are ''Constant'', then the internal representation is an optimized <code>CVector3f</code> data-structure.|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|CNST|RealElement&nbsp;x, RealElement&nbsp;y, RealElement&nbsp;z|Constant|Composes a vector from 3 float components. If all 3 components are ''Constant'', then the internal representation is an optimized <code>CVector3f</code> data-structure.|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|CONE|VectorElement direction, RealElement baseRadius|Cone|Generates a vector within a cone directed towards ''direction''; with the cone's base limited by min(1.0, ''baseRadius'')|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|CONE|VectorElement&nbsp;direction, RealElement&nbsp;baseRadius|Cone|Generates a vector within a cone directed towards ''direction''; with the cone's base limited by min(1.0, ''baseRadius'')|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
{{ParticleElementRow|CTVC|ColorElement color|Color To Vector|Converts RGB components of ''color'' to a 3-component vector|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
{{ParticleElementRow|CTVC|ColorElement color|Color To Vector|Converts RGB components of ''color'' to a 3-component vector|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|KEYE|[[#Keyframe Emitter Template|KeyframeEmitterData]] data|Keyframe Emitter|List of synchronized animation keys|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|KEYE|[[#Keyframe Emitter Template|KeyframeEmitterData]]&nbsp;data|Keyframe Emitter|List of synchronized animation keys|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|KEYP|[[#Keyframe Emitter Template|KeyframeEmitterData]] data|Keyframe Emitter|List of percentage-tweened animation keys|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|KEYP|[[#Keyframe Emitter Template|KeyframeEmitterData]]&nbsp;data|Keyframe Emitter|List of percentage-tweened animation keys|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|MULT|VectorElement a, VectorElement b|Multiply|Returns ''a'' * ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|MULT|VectorElement&nbsp;a, VectorElement&nbsp;b|Multiply|Returns ''a'' * ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
{{ParticleElementRow|PLCO||Previous Particle Location|Accesses the location (world space) of the current particle instance on the previous frame (or current frame if at frame 0)|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
{{ParticleElementRow|PLCO||Previous Particle Location|Accesses the location (world space) of the current particle instance on the previous frame (or current frame if at frame 0)|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
{{ParticleElementRow|PLOC||Particle Location|Accesses the location (world space) of the current particle instance|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
{{ParticleElementRow|PLOC||Particle Location|Accesses the location (world space) of the current particle instance|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
Line 182: Line 182:
 
{{ParticleElementRow|PSOR||Particle System Right|Accesses the local right-pointing vector of the current particle system, oriented in world space|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
{{ParticleElementRow|PSOR||Particle System Right|Accesses the local right-pointing vector of the current particle system, oriented in world space|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
{{ParticleElementRow|PSTR||Particle System Translation|Accesses the translation vector (world space) of the current particle system|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
{{ParticleElementRow|PSTR||Particle System Translation|Accesses the translation vector (world space) of the current particle system|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|PULS|IntElement aDuration, IntElement bDuration, VectorElement a, VectorElement b|Pulse|Returns ''a'' for ''aDuration'' frames then ''b'' for ''bDuration'' frames, then repeats this cycle|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|PULS|IntElement&nbsp;aDuration, IntElement&nbsp;bDuration, VectorElement&nbsp;a, VectorElement&nbsp;b|Pulse|Returns ''a'' for ''aDuration'' frames then ''b'' for ''bDuration'' frames, then repeats this cycle|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
{{ParticleElementRow|PVEL||Particle System Velocity|Accesses the velocity vector (world space) of the current particle instance|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
{{ParticleElementRow|PVEL||Particle System Velocity|Accesses the velocity vector (world space) of the current particle instance|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|RTOV|RealElement val|Real To Vector|Assigns ''val'' to all 3 components of the returned vector|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|RTOV|RealElement&nbsp;val|Real To Vector|Assigns ''val'' to all 3 components of the returned vector|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
{{ParticleElementRow|SUB_|VectorElement a, VectorElement b|Subtract|Returns ''a'' - ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
+
{{ParticleElementRow|SUB_|VectorElement&nbsp;a, VectorElement&nbsp;b|Subtract|Returns ''a'' - ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 
|}
 
|}
  
 
=== Mod Vector Elements ===
 
=== Mod Vector Elements ===
 +
 +
{| class="wikitable"
 +
! FourCC
 +
! Parameters
 +
! Description
 +
! Notes
 +
! MP1
 +
! MP2
 +
! MP3
 +
! DKCR
 +
! DKCTF
 +
{{ParticleElementRow|BNCE|VectorElement&nbsp;planePoint, VectorElement&nbsp;planeNormal, RealElement&nbsp;friction, RealElement&nbsp;restitution, bool&nbsp;dieOnPenetrate|Bounce|Maintains the state of an unbounded plane in local space, defined by ''planePoint'' and ''planeNormal''. If the particle's position penetrates this plane, it will either be destroyed if ''dieOnPenetrate'' is set, or a [[wikipedia:Deflection_(physics)|deflection]] will occur. This deflection accounts for [[wikipedia:Friction#Coefficient_of_friction|''friction'']] along the plane and [[wikipedia:Coefficient_of_restitution|''restitution'']] of the objects represented by the particles.|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 +
{{ParticleElementRow|CHAN|ModVectorElement&nbsp;a, ModVectorElement&nbsp;b, IntElement&nbsp;thresholdFrame|Time Chain|Returns ''a'' when current frame index is less-than ''thresholdFrame'', otherwise ''b''|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 +
{{ParticleElementRow|CNST|RealElement&nbsp;x, RealElement&nbsp;y, RealElement&nbsp;z|Constant|Composes a mod vector from 3 float components. If all 3 components are ''Constant'', then the internal representation is an optimized <code>CVector3f</code> data-structure. This vector is set as the velocity out when called.|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 +
{{ParticleElementRow|EMPL|VectorElement&nbsp;implodePoint, RealElement&nbsp;velocityScale, RealElement&nbsp;maxRadius, RealElement&nbsp;minRadius, bool&nbsp;enableMinRadius|Exponential Implosion|Integrates a cumulative implosion force over time by influencing the velocity (not the position) of particles within ''maxRadius'' of ''implodePoint'' (and outside ''minRadius'' if ''enableMinRadius'' set). The velocity of these particles is set as (particleVelocity + ''velocityScale'' * (''implodePoint'' - particlePosition)).|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 +
{{ParticleElementRow|IMPL|VectorElement&nbsp;implodePoint, RealElement&nbsp;velocityScale, RealElement&nbsp;maxRadius, RealElement&nbsp;minRadius, bool&nbsp;enableMinRadius|Implosion|Integrates a cumulative implosion force-differential over time by influencing the velocity (not the position) of particles within ''maxRadius'' of ''implodePoint'' (and outside ''minRadius'' if ''enableMinRadius'' set). The velocity of these particles is set as (particleVelocity + (''velocityScale'' / magnitude(''implodePoint'' - particlePosition)) * (''implodePoint'' - particlePosition)).|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 +
{{ParticleElementRow|LMPL|VectorElement&nbsp;implodePoint, RealElement&nbsp;velocityScale, RealElement&nbsp;maxRadius, RealElement&nbsp;minRadius, bool&nbsp;enableMinRadius|Linear Implosion|Integrates a non-cumulative implosion force-differential over time by influencing the velocity (not the position) of particles within ''maxRadius'' of ''implodePoint'' (and outside ''minRadius'' if ''enableMinRadius'' set). The velocity of these particles is set as ((''velocityScale'' / magnitude(''implodePoint'' - particlePosition)) * (''implodePoint'' - particlePosition)).|{{check}}|{{check}}|{{check}}|{{check}}|{{check}}}}
 +
|}
  
 
=== Color Elements ===
 
=== Color Elements ===

Revision as of 01:54, 28 February 2016

Morphball render.png This file format is almost completely documented
Details are subject to corrections

Retro games feature a uniform, fixed-function Particle Script system for describing various geometrical effects and weapon systems. The PAK archives contain binary resources using FourCCs to build a key-value dictionary. These codes correspond to application-specific parameters controlling the system in question.

The scripts use a dataflow paradigm built around value-generating element classes of the following types:

  • Int
  • Real (float)
  • Vector (3-component float)
  • Mod Vector (3-component float)
    • Local velocity vector in/out
    • Local position vector in/out
  • Color (4-component float, internally converted to RGBA8)
  • UV (TXTR reference and UV coordinate source)
  • Emitter
    • Initial local position vector (3-component float)
    • Initial local velocity vector (3-component float)

The system features several subclasses that output generated values through GetValue as a function of the current frame index. These implementations may recursively accept input from other elements, permitting effect designs of scalable complexity.

File Layout

All effect script file formats are read linearly to populate a description tree of element nodes, serving as a template to build an arbitrary number of generator instances:

  • Script Magic FourCC (see table below)
  • Parameters
    • Key FourCC
    • Value Parameter(s) (one of:)
      • NONE: null value (equivalent to not specifying the key at all)
      • Element FourCC (see below)
        • Child Elements (count/types according to parent)
  • _END

Script Types

Type Magic Purpose
PART GPSM Particle element generator
SWHC SWSH Swoosh generator
ELSC ELSM Electric generator
DPSC DPSM Decal generator
WPSC WPSM Projectile weapon configuration
CRSC CRSM Projectile collision response configuration

Elements

Many of the animated qualities in particle scripts are achieved with dynamic elements. These elements provide I/O interfaces and internally process numeric data that passes through. They may also gather data from other sources within the particle system's state.

Int Elements

FourCC Parameters Description Notes MP1 MP2 MP3 DKCR DKCTF
ADD_ (IntElement a, IntElement b) Add Returns a + b
CHAN (IntElement a, IntElement b, IntElement thresholdFrame) Time Chain Returns a when current frame index is less-than thresholdFrame, otherwise b
CLMP (IntElement min, IntElement max, IntElement val) Clamp Returns val clamped between min and max
CNST (s32 value) Constant Returns value on every call
DETH (IntElement passthrough, IntElement thresholdFrame) Death Always returns passthrough, and signals out-of-band to cease updating the system when the current frame index exceeds thresholdFrame
GAPC () Unknown
GEMT () Unknown
GTCP () Unknown
ILPT (IntElement percent) Lifetime Percent Queries the frame index at percent/100.0 into the lifetime of the particle instance
IMPL (IntElement val) Impulse Returns val ONLY at frame index 0, then returns 0 for subsequent frames
IRND (IntElement a, IntElement b) Initial Random Rolls a random value between a and b on frame index 0; returns that value for subsequent frames
KEYE (KeyframeEmitterData data) Keyframe Emitter List of synchronized animation keys
KEYP (KeyframeEmitterData data) Keyframe Emitter List of percentage-tweened animation keys
MODU (IntElement a, IntElement b) Modulo Returns a % b
MULT (IntElement a, IntElement b) Multiply Returns a * b
PULS (IntElement aDuration, IntElement bDuration, IntElement a, IntElement b) Pulse Returns a for aDuration frames then b for bDuration frames, then repeats this cycle
RAND (IntElement a, IntElement b) Random Rolls a random value between a and b
SPAH (IntElement val, IntElement waitMin, IntElement waitMax) Sample And Hold Stores val for a random count of frames between waitMin and waitMax and repeats this cycle
SUB_ (IntElement a, IntElement b) Subtract Returns a - b
TSCL (RealElement dv) Time Scale Returns dv times the current frame index (rounding down to nearest integer)

Real Elements

FourCC Parameters Description Notes MP1 MP2 MP3 DKCR DKCTF
ADD_ (RealElement a, RealElement b) Add Returns a + b
CEQL (RealElement ca, RealElement cb, RealElement pass, RealElement fail) Compare Equals Returns pass if ca and cb are within 0.00001 difference, otherwise fail
CEXT (IntElement a) Unknown Involves a lookup table
CHAN (RealElement a, RealElement b, IntElement thresholdFrame) Time Chain Returns a when current frame index is less-than thresholdFrame, otherwise b
CLMP (RealElement min, RealElement max, RealElement val) Clamp Returns val clamped between min and max
CLTN (RealElement ca, RealElement cb, RealElement pass, RealElement fail) Compare Less-Than Returns pass if ca is less-than cb, otherwise fail
CNST (float value) Constant Returns value on every call
CRNG (RealElement val, RealElement min, RealElement max, RealElement inRange, RealElement outOfRange) Constant Range Returns inRange if val is between min and max, otherwise outOfRange
DOTP (VectorElement a, VectorElement b) Dot Product Returns a · b
GTCR (ColorElement color) Get Component Red Extracts red component from color
GTCG (ColorElement color) Get Component Green Extracts green component from color
GTCB (ColorElement color) Get Component Blue Extracts blue component from color
GTCA (ColorElement color) Get Component Alpha Extracts alpha component from color
IRND (RealElement a, RealElement b) Initial Random Rolls a random value between a and b on frame index 0; returns that value for subsequent frames
ISWT (RealElement a, RealElement b) Initial Switch Returns a ONLY at frame index 0, then returns b for subsequent frames
ITRL (IntElement a, RealElement b) Int Times Real Returns a * b
KEYE (KeyframeEmitterData data) Keyframe Emitter List of synchronized animation keys
KEYP (KeyframeEmitterData data) Keyframe Emitter List of percentage-tweened animation keys
LFTW (RealElement a, RealElement b) Lifetime Tween Linearly-interpolates a to b over the lifetime of the particle instance
MULT (RealElement a, RealElement b) Multiply Returns a * b
PAPn () Particle System Access Parameter Accesses the value stored into ADV[1-8] for each system update
PRLW () Particle Rotation or Line Width Returns the rotation (in degrees) or line width for the current particle instance
PSLL () Particle Size or Line Length Returns the size or line length for the current particle instance
PULS (IntElement aDuration, IntElement bDuration, RealElement a, RealElement b) Pulse Returns a for aDuration frames then b for bDuration frames, then repeats this cycle
RAND (RealElement a, RealElement b) Random Rolls a random value between a and b
RLPT (RealElement percent) Lifetime Percent Queries the frame index at percent/100.0 into the lifetime of the particle instance
SCAL (RealElement dv) Time Scale Returns dv times the current frame index
SINE (RealElement magnitude, RealElement linearAngle, RealElement constantAngle) Sine Wave Returns sin((curFrame * linearAngle + constantAngle) * π / 180.0) * magnitude
SUB_ (RealElement a, RealElement b) Subtract Returns a - b
VMAG (VectorElement vec) Vector Magnitude Computes magnitude (length) of vec
VXTR (VectorElement vec) Vector X To Real Extracts X component of vec
VYTR (VectorElement vec) Vector Y To Real Extracts Y component of vec
VZTR (VectorElement vec) Vector Z To Real Extracts Z component of vec

Vector Elements

FourCC Parameters Description Notes MP1 MP2 MP3 DKCR DKCTF
ADD_ (VectorElement a, VectorElement b) Add Returns a + b
ANGC (RealElement angleXBias, RealElement angleYBias, RealElement angleXRange, RealElement angleYRange, RealElement magnitude) Angle Cone Generates a random vector based on (0,0,1) rotated about the X/Y axis. The angles of rotation (in degrees) are set by random ranges angleXRange and angleYRange, centered around non-random angleXBias and angleYBias. The resulting vector's length is set as magnitude.
CCLU (VectorElement circleOffset, VectorElement circleNormal, IntElement cycleFrames, RealElement randomFactor) Circle Cluster Generates a vector along an angular sweep of a unit-circle offset by circleOffset, oriented according to circleNormal. The sweep makes a full rotation within the circle over cycleFrames. The resulting vector has a randomized 3D jitter added; scaled by randomFactor times the intermediate magnitude.
CHAN (VectorElement a, VectorElement b, IntElement thresholdFrame) Time Chain Returns a when current frame index is less-than thresholdFrame, otherwise b
CIRC (VectorElement circleOffset, VectorElement circleNormal, RealElement angleConstant, RealElement angleLinear, RealElement circleRadius) Circle Generates a vector along an angular sweep of a circle of circleRadius offset by circleOffset oriented according to circleNormal. The sweep angle (in degrees) is calculated as (angleLinear * curFrame + angleConstant).
CNST (RealElement x, RealElement y, RealElement z) Constant Composes a vector from 3 float components. If all 3 components are Constant, then the internal representation is an optimized CVector3f data-structure.
CONE (VectorElement direction, RealElement baseRadius) Cone Generates a vector within a cone directed towards direction; with the cone's base limited by min(1.0, baseRadius)
CTVC (ColorElement color) Color To Vector Converts RGB components of color to a 3-component vector
KEYE (KeyframeEmitterData data) Keyframe Emitter List of synchronized animation keys
KEYP (KeyframeEmitterData data) Keyframe Emitter List of percentage-tweened animation keys
MULT (VectorElement a, VectorElement b) Multiply Returns a * b
PLCO () Previous Particle Location Accesses the location (world space) of the current particle instance on the previous frame (or current frame if at frame 0)
PLOC () Particle Location Accesses the location (world space) of the current particle instance
PSOF () Particle System Forward Accesses the local forward-pointing vector of the current particle system, oriented in world space
PSOU () Particle System Up Accesses the local up-pointing vector of the current particle system, oriented in world space
PSOR () Particle System Right Accesses the local right-pointing vector of the current particle system, oriented in world space
PSTR () Particle System Translation Accesses the translation vector (world space) of the current particle system
PULS (IntElement aDuration, IntElement bDuration, VectorElement a, VectorElement b) Pulse Returns a for aDuration frames then b for bDuration frames, then repeats this cycle
PVEL () Particle System Velocity Accesses the velocity vector (world space) of the current particle instance
RTOV (RealElement val) Real To Vector Assigns val to all 3 components of the returned vector
SUB_ (VectorElement a, VectorElement b) Subtract Returns a - b

Mod Vector Elements

FourCC Parameters Description Notes MP1 MP2 MP3 DKCR DKCTF
BNCE (VectorElement planePoint, VectorElement planeNormal, RealElement friction, RealElement restitution, bool dieOnPenetrate) Bounce Maintains the state of an unbounded plane in local space, defined by planePoint and planeNormal. If the particle's position penetrates this plane, it will either be destroyed if dieOnPenetrate is set, or a deflection will occur. This deflection accounts for friction along the plane and restitution of the objects represented by the particles.
CHAN (ModVectorElement a, ModVectorElement b, IntElement thresholdFrame) Time Chain Returns a when current frame index is less-than thresholdFrame, otherwise b
CNST (RealElement x, RealElement y, RealElement z) Constant Composes a mod vector from 3 float components. If all 3 components are Constant, then the internal representation is an optimized CVector3f data-structure. This vector is set as the velocity out when called.
EMPL (VectorElement implodePoint, RealElement velocityScale, RealElement maxRadius, RealElement minRadius, bool enableMinRadius) Exponential Implosion Integrates a cumulative implosion force over time by influencing the velocity (not the position) of particles within maxRadius of implodePoint (and outside minRadius if enableMinRadius set). The velocity of these particles is set as (particleVelocity + velocityScale * (implodePoint - particlePosition)).
IMPL (VectorElement implodePoint, RealElement velocityScale, RealElement maxRadius, RealElement minRadius, bool enableMinRadius) Implosion Integrates a cumulative implosion force-differential over time by influencing the velocity (not the position) of particles within maxRadius of implodePoint (and outside minRadius if enableMinRadius set). The velocity of these particles is set as (particleVelocity + (velocityScale / magnitude(implodePoint - particlePosition)) * (implodePoint - particlePosition)).
LMPL (VectorElement implodePoint, RealElement velocityScale, RealElement maxRadius, RealElement minRadius, bool enableMinRadius) Linear Implosion Integrates a non-cumulative implosion force-differential over time by influencing the velocity (not the position) of particles within maxRadius of implodePoint (and outside minRadius if enableMinRadius set). The velocity of these particles is set as ((velocityScale / magnitude(implodePoint - particlePosition)) * (implodePoint - particlePosition)).

Color Elements

UV Elements

Emitter Elements

Keyframe Emitter Template

KEYE and KEYP elements are able to statically encode a list of key values for all element types (except UV and Emitter elements). T represents the type being encoded.

Data Type Description Notes
u32 Percentage-Tweening Flag If non-zero, this is a KEYP and there are exactly 101 keys in the list; all of these keys are linearly-interpolated over the lifetime of the particle instance (however long that may be)
u32 Unknown Not used by GetValue
u8 Loop Flag If non-zero, the key values are looped between loopStart and loopEnd indices (does not apply to KEYP)
u8 Unknown Not used by GetValue
u32 Loop End Final key index in the loop
u32 Loop Start First key index in the loop
u32 Key Count Count of keys encoded in the list
T[keyCount] Keys The actual key values themselves