The Horny Rat
2003-12-28, 07:41 PM
This is strange, my shotgun onfire function is making what ever projectile I use not be reloaded after the game goes to the next map...
The gun works the first time you play the game but after the map changes the projectile is not loaded..
I was thinking it was my shotguns projectile, so I changed it so it used the one for my minigun, located in a diffrent weapon file, same thing the shotgun and the minigun worked first map, but next map they both had no projectile...
so what ever projectile I make my shotgun onfire function call, gets not loaded after mission change, I even tested one more type same thing...
This blows my mind, this never happend coding tribes2!!!!
Plus I still can't get my beam projectile types to have explosions, and the death message stoped working correct after the last update...
// -----------------------------------------------------------------------------
// -- onFire Functions
// -----------------------------------------------------------------------------
function ShotgunImage::onFire( %data, %obj, %slot )
{
%obj.decInventory( %data.ammo, 1 );
%obj.applyKick(-150);
// ----
%projectile = "SGunProj";
// ----
// -- required for projectiles which inherit velocity from their parent
%muzzleVelocity = VectorAdd(
VectorScale(%obj.getMuzzleVector(%slot), %projectile.muzzleVelocity),
VectorScale(%obj.getVelocity(), %projectile.velInheritFactor));
// -- if there's a projectile variance, apply it
%TwoPi = 2 * 3.1415926;
%Spread = %TwoPi * %Data.projectileSpread;
%ProjectileCount = %Data.projectileCount;
%Count = 1;
while (%Count <= %ProjectileCount)
{
%VectorX = (getRandom() - 0.5) * %Spread;
%VectorY = (getRandom() - 0.5) * %Spread;
%VectorZ = (getRandom() - 0.5) * %Spread;
%Matrix = MatrixCreateFromEuler(%VectorX @ " " @ %VectorY @ " " @ %VectorZ);
%muzzleVelocity = MatrixMulVector( %matrix, %muzzleVelocity );
%p = new BulletProjectile()
{
dataBlock = %projectile;
initialVelocity = %muzzleVelocity;
initialPosition = %obj.getMuzzlePoint(%slot);
sourceObject = %obj;
sourceSlot = %slot;
client = %obj.client;
};
MissionCleanup.add(%projectile);
%Count++;
}
}
The gun works the first time you play the game but after the map changes the projectile is not loaded..
I was thinking it was my shotguns projectile, so I changed it so it used the one for my minigun, located in a diffrent weapon file, same thing the shotgun and the minigun worked first map, but next map they both had no projectile...
so what ever projectile I make my shotgun onfire function call, gets not loaded after mission change, I even tested one more type same thing...
This blows my mind, this never happend coding tribes2!!!!
Plus I still can't get my beam projectile types to have explosions, and the death message stoped working correct after the last update...
// -----------------------------------------------------------------------------
// -- onFire Functions
// -----------------------------------------------------------------------------
function ShotgunImage::onFire( %data, %obj, %slot )
{
%obj.decInventory( %data.ammo, 1 );
%obj.applyKick(-150);
// ----
%projectile = "SGunProj";
// ----
// -- required for projectiles which inherit velocity from their parent
%muzzleVelocity = VectorAdd(
VectorScale(%obj.getMuzzleVector(%slot), %projectile.muzzleVelocity),
VectorScale(%obj.getVelocity(), %projectile.velInheritFactor));
// -- if there's a projectile variance, apply it
%TwoPi = 2 * 3.1415926;
%Spread = %TwoPi * %Data.projectileSpread;
%ProjectileCount = %Data.projectileCount;
%Count = 1;
while (%Count <= %ProjectileCount)
{
%VectorX = (getRandom() - 0.5) * %Spread;
%VectorY = (getRandom() - 0.5) * %Spread;
%VectorZ = (getRandom() - 0.5) * %Spread;
%Matrix = MatrixCreateFromEuler(%VectorX @ " " @ %VectorY @ " " @ %VectorZ);
%muzzleVelocity = MatrixMulVector( %matrix, %muzzleVelocity );
%p = new BulletProjectile()
{
dataBlock = %projectile;
initialVelocity = %muzzleVelocity;
initialPosition = %obj.getMuzzlePoint(%slot);
sourceObject = %obj;
sourceSlot = %slot;
client = %obj.client;
};
MissionCleanup.add(%projectile);
%Count++;
}
}