CreateParticleAtBone
Particles
5.4 OC
bool
string
szName
Name of the particle
string
szBoneName
Name of the bone at which to create the particle
array
pos
Vector of three elements with the X,Y and Z coordinates of the particle relative to the bone position and orientation.
array
dir
Vector of three elements with the X,Y and Z components of the velocity of theparticle relative to the bone orientation.
int
lifetime
Time in frames that the particle will be alive before it is removed. Can also be a value provider function.
proplist
properties
PropList with the particle attributes (see the particle documentation).
int
amount
Amount of particles to create. Defaults to 1.
Creates a particle relative to a bone of the calling object's skeleton. The named particle definition must be loaded. For more information see the particle documentation.
This function returns false
if the particle definition was not found, or the function is called for an object which does not have a mesh graphics, or the skeleton of the mesh does not have a bone called szBoneName
. Otherwise, true
is returned. There is no return value indicating whether the particle has actually been created. This must be so to prevent synchronization problems in network games, as particles may be handled differently on each computer in the network.
func InitializePlayer(int plr)
{
AddEffect("IntColorize", 0, 1, 1);
}
global func FxIntColorizeTimer()
{
FindObject(Find_ID(Clonk))->CreateParticleAtBone("SphereSpark", "skeleton_body", [0, 0, 0], [0, 0, 0], PV_Random(20, 30), Particles_Spark());
FindObject(Find_ID(Clonk))->CreateParticleAtBone("Fire", "pos_hand1", [0, 0, 0], [0, 0, 0], PV_Random(5, 10), Particles_Fire());
FindObject(Find_ID(Clonk))->CreateParticleAtBone("Fire", "pos_hand2", [0, 0, 0], [0, 0, 0], PV_Random(5, 10), Particles_Fire());
return(0);
}
Scenario script. Creates an effect which traces a Clonk's body, left hand and right hand with differently colored sparks.
CreateParticle
Clonk-Karl2012-12