I have sucessfully implimented a shotgun into the mod I'm working on using ProjectileFire, but since all the other bullet based weapons are going to be InstantFire weapons, I feel like it would be more efficient and would make me feel better to have an InstantFire shotgun.
I've searched all over, in these forums, and have found some code that poeple have posted to do this, such as:
which was posted by EvilDrWong.
However, when I try to compile this class, I get an error "Error, Bad or missing expression after '<'" refuring to the i<TracesPerShot; part. Has anyone used code similar to this before? Or if you have code that you have used to do what I need and know it works, I would really appreciate seeing it.
I've searched all over, in these forums, and have found some code that poeple have posted to do this, such as:
Code:
class BuckshotFire extends InstantFire;
function DoFireEffect()
{
local Vector StartTrace, SpreadRand;
local Rotator R, Aim;
local int i;
Instigator.MakeNoise(1.0);
StartTrace = Instigator.Location + Instigator.EyePosition();
Aim = AdjustAim(StartTrace, AimError);
for( i=0; i<TracesPerShot; i++ )
{
SpreadRand = VRand()*FRand()*Spread;
R = rotator(vector(Aim) + SpreadRand);
DoTrace(StartTrace, R);
}
}
However, when I try to compile this class, I get an error "Error, Bad or missing expression after '<'" refuring to the i<TracesPerShot; part. Has anyone used code similar to this before? Or if you have code that you have used to do what I need and know it works, I would really appreciate seeing it.
Last edited: