How or what is the function for delaying functions? Is it wait(#) Where # is the number of MS to wait before continuing the script? or whatever its called. I just want a delay for the projectile loop in this script:
function M4203Image::onFire(%this,%obj,%slot)
{
%projectile = M4ACOGProjectile;
%spread = 0.0007;
%shellcount = getRandom(3,6);
for(%shell=0; %shell<%shellcount; %shell++)
{
%vector = %obj.getMuzzleVector(%slot);
%objectVelocity = %obj.getVelocity();
%vector1 = VectorScale(%vector, %projectile.muzzleVelocity);
%vector2 = VectorScale(%objectVelocity, %projectile.velInheritFactor);
%velocity = VectorAdd(%vector1,%vector2);
%x = (getRandom() - 0.5) * 10 * 3.1415926 * %spread;
%y = (getRandom() - 0.5) * 10 * 3.1415926 * %spread;
%z = (getRandom() - 0.5) * 10 * 3.1415926 * %spread;
%mat = MatrixCreateFromEuler(%x @ " " @ %y @ " " @ %z);
%velocity = MatrixMulVector(%mat, %velocity);
%p = new (%this.projectileType)()
{
dataBlock = %projectile;
initialVelocity = %velocity;
initialPosition = %obj.getMuzzlePoint(%slot);
sourceObject = %obj;
sourceSlot = %slot;
client = %obj.client;
};
MissionCleanup.add(%p)
}
return %p;
}
What I'm trying to do (incase you don't get everything I said) is to do a Burst fire mode. Burst fire is firing single shots that have delays but each shots fire around 3 to 6 bullets, and each bullet dont fire all at once, they fire simultaneuously after another.
If my idea doesnt work. What else can you suggest?
Thanks for the upcoming help.
EDIT: Should I go for schedules?