Author Topic: Spread cuases player knockback  (Read 803 times)

spreads code
Code: [Select]
function autolaserImage::onFire(%this,%obj,%slot)
{
%obj.setVelocity(VectorAdd(%obj.getVelocity(),VectorScale(%obj.client.player.getEyeVector(),"-3")));
%obj.playThread(2, none);

%projectile = %this.projectile;
%spread = 0.0025;
%shellcount = 1;

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;
}
i know its somethign in there that causes knockback, but what do i change so there is none anymroe, cause its having very glitchy effects
IE effectivly turning my auto laser into a jetpack
and instead of someone jsut posting the fix, please, as i want to learn more, explain why you made the change and what it does in more detail please
i wanna learn stuffs

WOOOOO
I FIGURED IT OUT BY MYSELF!!!!!
SWEEEEET
ok so this topic is done unless osmone else is curiours as to what i did to fix

You removed the third line and I know this because it is the shotgun oncollision code.

yeah i did that after noticing that ebign the difference between the spreader from LWP and the shotgun
thanks anyways ephi

All this spread stuff if from the GG Resources...
And the CS:S style spread is not what you think, it changes spread while you're moving.