Author Topic: Weapon Firing Two Projectiles?  (Read 389 times)

Is it possible to make a weapon fire two projectiles at different spots at the same time? if so, how?

something along the lines of this
Code: [Select]
function SpecialGunImage::onFire(%this,%obj,%slot)
{
%projectile = GunProjectile;

%p = new (%this.projectileType)()
{
dataBlock = %projectile;
initialVelocity = %velocity;
initialPosition = %obj.getMuzzlePoint(%slot);
sourceObject = %obj;
sourceSlot = %slot;
client = %obj.client;
};
MissionCleanup.add(%p);

%projectile = OtherGunProjectile;

%p = new (%this.projectileType)()
{
dataBlock = %projectile;
initialVelocity = %velocity;
initialPosition = %obj.getMuzzlePoint(%slot);
sourceObject = %obj;
sourceSlot = %slot;
client = %obj.client;
};
MissionCleanup.add(%p);
}

Is it possible to make a weapon fire two projectiles at different spots at the same time? if so, how?


yah he'll have to mess around with it because I'm not exactly sure, I was just starting him out

yah he'll have to mess around with it because I'm not exactly sure, I was just starting him out
The words initialPosition should mean something. ;)
If you mess with the value of that you should be able to shoot from another place.

So yeah, you should have a custom onFire script where you make 2 new projectiles.
One from the muzzlePoint, one from the other position.
You can add another vector to the vector that the muzzlePoint returns to move the point where the second one shoots from a bit.

Can you do something with that?