CreateParticleAtBone

Kategorie: Partikel
Ab Engineversion: 4.0 OC

Beschreibung

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.

Syntax

bool CreateParticleAtBone(string szName, string szBoneName, array pos, array dir, int lifetime, proplist properties, int amount);

Parameter

szName:
Name des Partikels
szBoneName:
Name of the bone at which to create the particle
pos:
Vector of three elements with the X,Y and Z coordinates of the particle relative to the bone position and orientation.
dir:
Vector of three elements with the X,Y and Z components of the velocity of theparticle relative to the bone orientation.
lifetime:
Time in frames that the particle will be alive before it is removed. Can also be a value provider function.
properties:
PropList with the particle attributes (see the particle documentation).
amount:
Amount of particles to create. Defaults to 1.

Anmerkung

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.

Beispiel

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.
Siehe auch: CreateParticle
Clonk-Karl, 2012-12