Hello, I still don't know what's wrong with my code.
Here is the code for the pipe bomb launcher and it's projectile.
//=============================================================================
// Pipebomb.
//=============================================================================
class Pipebomb expands FlakCannon;
var int Createdby;
function Fire(float value)
{
local Vector Start, X,Y,Z;
if (AmmoType.UseAmmo(1))
{
CheckVisibility();
Owner.PlaySound(Misc1Sound, SLOT_None, 0.6*Pawn(Owner).SoundDampening);
Owner.PlaySound(AltFireSound, SLOT_None,Pawn(Owner).SoundDampening*4.0);
PlayAnim('AltFire',1.3,0.05);
bPointing=True;
Owner.MakeNoise(Pawn(Owner).SoundDampening);
GetAxes(Pawn(owner).ViewRotation,X,Y,Z);
Start = Start + FireOffset.X * X + Fireoffset.Y * Y + FireOffset.Z * Z;
AdjustedAim = Pawn(owner).AdjustAim(AltProjectileSpeed, Start,AimError,True, bAltWarnTarget);
Spawn(class'pbomb2',,,Start,AdjustedAim);
If (PlayerPawn(Owner) !=None)
PlayerPawn(Owner).shakeview(ShakeTime, ShakeMag, ShakeVert);
GoToState('Firing');
}
}
function AltFire(float Value)
{
local actor A;
foreach Allactors(class 'Actor', A)
{
if( A.IsA('Pbomb2'))
{
if(pbomb2(A).ownerb == self.owner)
pbomb2(A).explode(a.location,a.location);
}
}
gotostate('AltFiring');
}
state Firing
{
Begin:
FinishAnim();
PlayAnim('Eject',1.5, 0.05);
Owner.PlaySound(Misc3Sound, SLOT_None,0.6*Pawn(Owner).SoundDampening);
FinishAnim();
PlayAnim('Loading',1.4, 0.05);
owner.PlaySound(CockingSound, SLOT_None,0.5*Pawn(Owner).SoundDampening);
FinishAnim();
Finish();
}
state AltFiring
{
Begin:
Owner.PlaySound(Misc1Sound,SLOT_None, 0.6*Pawn(Owner).SoundDampening);
Owner.PlaySound(AltFireSound, SLOT_None,Pawn(Owner).SoundDampening*4.0);
PlayAnim('Altfire', 1.3, 0.05);
Owner.MakeNoise(Pawn(Owner).SoundDampening);
PlayAnim('Loading', 1.4, 0.05);
Owner.PlaySound(CockingSound, SLOT_None,0.5*Pawn(Owner).SoundDampening);
FinishAnim();
Finish();
}
defaultproperties
{
}
Here is the code for the projectile.
//=============================================================================
// pbomb2.
//=============================================================================
class pbomb2 expands Grenade;
var Actor Createdby;
var() Actor Ownerb;
simulated function PostBeginPlay()
{
Super.PostBeginPlay();
SetTimer(29.0,False);
Ownerb = Instigator;
}
function Explode(vector HitLocation, vector HitNormal)
{
Local vector start;
HurtRadius(damage, 150, 'exploded', MomentumTransfer, HitLocation);
Start = Location;
Spawn(class'SpriteBallExplosion',,,Start);
Destroy();
}
function ProcessTouch (Actor Other, vector HitLocation)
{
if ((Other != Instigator) && (FlakShell(Other) == none))
Explode(HitLocation,Normal(HitLocation-Other.Location));
}
simulated function Timer()
{
Explode(Location,Location);
}
defaultproperties
{
}
I don't know what it could be...I think it's the fireoffset but i don't know.