Blockland Forums > Modification Help
Weapon Firing Two Projectiles?
Pages: (1/1)
jes00:
Is it possible to make a weapon fire two projectiles at different spots at the same time? if so, how?
Swollow:
something along the lines of this
--- Code: ---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);
}
--- End code ---
Treynolds416:
--- Quote from: jes00 on March 25, 2012, 03:52:35 PM ---Is it possible to make a weapon fire two projectiles at different spots at the same time? if so, how?
--- End quote ---
Swollow:
--- Quote from: Treynolds416 on March 25, 2012, 10:08:48 PM ---
--- End quote ---
yah he'll have to mess around with it because I'm not exactly sure, I was just starting him out
lordician:
--- Quote from: swollow on March 25, 2012, 10:22:54 PM ---yah he'll have to mess around with it because I'm not exactly sure, I was just starting him out
--- End quote ---
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?
Pages: (1/1)