ParticleArray
Introduction
Syntax
Format: [ShapeName, AnimationName, Type, TimerPeriod, LifeTime, Position, MoveVelocity, RotationVelocity, Weight, Volume, Rubbing, Size, Color, AnimationPhase, RandomDirectionPeriod, RandomDirectionIntensity, OnTimer, BeforeDestroy, Object]
Example
Create thunderbolt on logic named logic1
_pos = [ position logic1 select 0,position logic1 select 1,10 ]; drop ["blesk1","","Billboard",0.01,0.2,_pos,[0,0,0],0,1,1,0,[20 + random 20],[[1,1,1,1],[1,1,1,0.7]],[1,0],0,0,"","",""];
For several examples for the kind of effects that can be accomplished via particles, see ParticleTemplates.
Parameters
Global parameters
ShapeName - Name of the shape associated with the particle (see ParticleShape list).
AnimationName - Name of the animation of the shape.
- In ArmA, the Animation name can be defined as an array (Name, followed by three numbers):
- 1. Anim Divisor (6 for a 6x6, 8 for a 8x8, etc)
- 2. Anim Starting Row
- 3. Number of Frames to Play (speed controlled by animation phase below)
- In this shot of "\Ca\Data\ParticleEffects\FireAndSmokeAnim\SmokeAnim.p3d", note the following:
- The image used for this particle effect is 8*8 effect frames. This means you need to use 8 as your Anim Divisor. Overwise, the game will either draw too much of the image used, or too little. This is highly visible in most situations.
- The Anim Starting Row picks the coresponding superimposed number in the image above. 0 picks the first smoke effect, 1 picks the second smoke effect, 2 picks the first fire effect, etc.
- The setting for the Number of Number of Frames to Play should, in most cases, be the number of effects available to the animation. If you go over this (for example, selecting 9 in this 8*8 tile), it will play the first animation frame of the next effect down. If there is nothing below to grab, it will draw a blank for that frame. If 1 is used, it will only play the first frame of the selected row.
Type - Type of particle (either "Billboard" or "SpaceObject").
TimerPeriod - The period of calling the "OnTimer" event (in sec).
LifeTime - Life time of the particle (in sec).
Physical parameters:
Position - Either 3D coordinate (x, y, z) or name of the selection - in this case the Object property must be set.
MoveVelocity - 3D vector (x, y, z) which describes the velocity vector of the particle direction and speed in m/s.
RotationVelocity - Float number which determines number of rotations in one second.
Weight - Weight of the particle (kg).
Volume - Volume of the particle (m^3).
Rubbing - Float number without dimension which determines the impact of the density of the environment on this particle. 0 - no impact (vacuum).
Render parameters
Note: All these values are set as arrays to show their development in time.
If you set the array [1, 2] as a size, then at the beginning the size of the particle will be 1 and at the end of the life time of the particle it's size will be 2.
The rest of the values during the life time will be linearly interpolated.
Size - Size of the particle in time to render (m).
Color - Colour of the particle in time to render (RGBA).
AnimationPhase - Phase of the animation in time. In other words, the play speed of the selected frames for the Number of Frames to Play above. The higher the number, the faster it plays through the animation frames. Note that if the Number of Frames to Play above is set to 1, this will have no visible effect.
Random parameters:
RandomDirectionPeriod - Period of change of the velocity vector (s).
RandomDirectionIntensity - Each MoveVelocity component will be changed with random value from interval <0, RandomDirectionIntensity>.
OnTimer - Name of the script to run every period determined by TimerPeriod property.
Position of the particle is stored in "this" variable.
BeforeDestroy - Name of the script to run right before destroying the particle.
Position of the particle is stored in "this" variable.
Object - Object to bind this particle to.
Tutorials
See Also
setParticleCircle, setParticleParams, setParticleRandom, ParticleTemplates