*bump, thanks swat, ill look for help
But in the mean time i have a problem coming up, im testing the sound layers on the Blockombat Service Pistol (CM1911). I put in the audio profiles
datablock AudioProfile(CM1911A1FireSound)
{
filename = "./CM1911A1Fire.wav";
description = AudioClosest3d;
preload = true;
};
datablock AudioProfile(LightClose)
{
filename = "./LightClose.wav";
description = AudioClose3d;
preload = true;
};
datablock AudioProfile(LightFar)
{
filename = "./LightFar.wav";
description = AudioDefault3d;
preload = true;
};
CM1911Fire being the base sound
LightClose being the pop at 5 meters
and LightFar being the pop at 10 meters ( just to test )
However ive found 2 or 3 "OnFire Functions, such as this one
function CM1911A1Image::onFire(%this,%obj,%slot)
{
CM1911A1Fire(%this,%obj,%slot);
%obj.toolAmmo[%obj.currTool]--;
if($BKT::DH){commandToClient(%obj.client,'bottomPrint',"<just:right><font:impact:24><color:FF0000>.45 ACP Pistol <font:impact:34>\c6" @ %obj.toolAmmo[%obj.currTool]+0 @ " / " @ %obj.client.quantity["45caliber"]+0 @ "", 4, 2, 3, 4);}
if($BKT::Recoil)
{
%projectile = "ATACRecoilProjectile";
%vector = %obj.getMuzzleVector(%slot);
%objectVelocity = %obj.getVelocity();
%vector1 = VectorScale(%vector, %projectile.muzzleVelocity);
%vector2 = VectorScale(%objectVelocity, %projectile.velInheritFactor);
%velocity = VectorAdd(%vector1,%vector2);
%p = new (%this.projectileType)()
{
dataBlock = %projectile;
initialVelocity = %velocity;
initialPosition = %obj.getMuzzlePoint(%slot);
sourceObject = %obj;
sourceSlot = %slot;
client = %obj.client;
};
}
MissionCleanup.add(%p);
return %p;
}
and this one,
function CM1911A1ADSImage::onFire(%this,%obj,%slot)
{
CM1911A1Fire(%this,%obj,%slot);
%obj.toolAmmo[%obj.currTool]--;
if($BKT::DH){commandToClient(%obj.client,'bottomPrint',"<just:right><font:impact:24><color:FF0000>.45 ACP Pistol <font:impact:34>\c6" @ %obj.toolAmmo[%obj.currTool]+0 @ " / " @ %obj.client.quantity["45caliber"]+0 @ "", 4, 2, 3, 4);}
if($BKT::Recoil)
{
%projectile = "ATACRecoilProjectile";
%vector = %obj.getMuzzleVector(%slot);
%objectVelocity = %obj.getVelocity();
%vector1 = VectorScale(%vector, %projectile.muzzleVelocity);
%vector2 = VectorScale(%objectVelocity, %projectile.velInheritFactor);
%velocity = VectorAdd(%vector1,%vector2);
%p = new (%this.projectileType)()
{
dataBlock = %projectile;
initialVelocity = %velocity;
initialPosition = %obj.getMuzzlePoint(%slot);
sourceObject = %obj;
sourceSlot = %slot;
client = %obj.client;
};
}
MissionCleanup.add(%p);
return %p;
}
the two strips of code are for "Non-ADS" and "ADS"
i put the following script in:
origin = origin-of-sound.getTransform();
for all clients
{
transform = client.Transform()
distance = vectorDist(origin, transform)
if(dist < 5)
play sound 1 - client.play3D(LightClose, origin)
else if(dist < 10)
play sound 2 - client.play3D(LightFar, origin)
}
I tried putting this in on both "OnFire" functions
but it just screws up the gun.
can one of you intellegent people, tell me where and how im loving up this bad?