Author Topic: mounting particles  (Read 736 times)

How would one mount particles to the end of the barrel of the gun when this fires?

Code: [Select]
package flameraltFire
{
function Armor::onTrigger(%this, %player, %slot, %val)
{
if(%player.getMountedImage(0) $= FlamerImage.getID() && %slot $= 4 && %val)
{
%projectile = flamerAirProjectile;
%vector = %player.getMuzzleVector(0);
%objectVelocity = %player.getVelocity();
%vector1 = VectorScale(%vector, %projectile.muzzleVelocity);
%vector2 = VectorScale(%objectVelocity, %projectile.velInheritFactor);
%velocity = VectorAdd(%vector1,%vector2);
%p = new Projectile()
{
dataBlock = %projectile;
initialVelocity = %velocity;
initialPosition = %player.getMuzzlePoint(0);
sourceObject = %player;
sourceSlot = 0;
client = %player.client;
};
MissionCleanup.add(%p);
return %p;
}     
Parent::onTrigger(%this, %player, %slot, %val);
}
};
activatePackage(flameraltFire);


stateEmitter[?] = emitterName;

stateEmitter[?] = emitterName;

He's not using the state system for firing. Look at what I did in the tank script, I just created an image that had an emitter (much like how an emote works) and mounted it to a node constrained to the rotation of the turret barrel for a few seconds.