BioRifle style charge-up.

The best and quickest support by a group of top-notch editing specialists, guaranteed!

Moderator: Forum Guards

BioRifle style charge-up.

Postby Allan » Wed Mar 08, 06 8:05 pm

Ok, once again, i need the help of the Top Notch Editing Specialists (Prehaps i should start a thread just for my problems :P )

I wanted a weapon that fires like the Bio-Rifle's Alternate fire mode in Unreal Tournament (If you hold the button for long enough, it fires loads of blobs instead of one or two blobs). I already have made a code for blobs like the BioRifle's, but how would i go about making a gun so it would wait for something like 5 seconds at the max with the trigger held down, and for every 0.5 seconds up to this 5 seconds mark, it should add 1 blob to the amount discharged when the trigger is let go, but if it goes over this 5 second mark, the gun backfires, and the player is sprayed in the blobs themselves. Would this be possible for DXMP?
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Postby Snakey » Wed Mar 08, 06 8:26 pm

The backfire bit would be extremely annoying.
<center>

Image
User avatar
Snakey
Alpha
 
Posts: 3926
Joined: Wed Mar 30, 05 7:09 pm
Location: Wales

Re: BioRifle style charge-up.

Postby MrBlackDX » Wed Mar 08, 06 8:38 pm

Allan wrote:Ok, once again, i need the help of the Top Notch Editing Specialists (Prehaps i should start a thread just for my problems :P )

I wanted a weapon that fires like the Bio-Rifle's Alternate fire mode in Unreal Tournament (If you hold the button for long enough, it fires loads of blobs instead of one or two blobs). I already have made a code for blobs like the BioRifle's, but how would i go about making a gun so it would wait for something like 5 seconds at the max with the trigger held down, and for every 0.5 seconds up to this 5 seconds mark, it should add 1 blob to the amount discharged when the trigger is let go, but if it goes over this 5 second mark, the gun backfires, and the player is sprayed in the blobs themselves. Would this be possible for DXMP?


can you look at the BioRifles UT code?
MrBlackDX
Nobel Peace Prize
 
Posts: 3943
Joined: Sun Dec 19, 04 8:40 pm

Postby Tsukasa Nishino » Wed Mar 08, 06 10:25 pm

didnt we have one of those before? that tnag mod?
User avatar
Tsukasa Nishino
Master
 
Posts: 1730
Joined: Sun Jul 04, 04 9:36 pm

Postby Snakey » Wed Mar 08, 06 10:31 pm

Tsukasa Nishino wrote:didnt we have one of those before? that tnag mod?


He wants to know how the Bio Rifle from tnag (And UT) accomplishes its charge up effect.
<center>

Image
User avatar
Snakey
Alpha
 
Posts: 3926
Joined: Wed Mar 30, 05 7:09 pm
Location: Wales

Postby Alex » Wed Mar 08, 06 10:31 pm

Bio Rifle from tnag doesn't has charge up effect.

Anyways... I looked into the source of it...

Code: Select all
//=============================================================================
// UT_BioRifle.
//=============================================================================
class UT_BioRifle extends TournamentWeapon;

var float ChargeSize, Count;
var bool bBurst;

simulated function PlayIdleAnim()
{
   if ( Mesh == PickupViewMesh )
      return;
   if ( (Owner != None) && (VSize(Owner.Velocity) > 10) )
      PlayAnim('Walking',0.3,0.3);
   else
      TweenAnim('Still', 1.0);
   Enable('AnimEnd');
}

function float RateSelf( out int bUseAltMode )
{
   local float EnemyDist;
   local bool bRetreating;
   local vector EnemyDir;

   if ( AmmoType.AmmoAmount <=0 )
      return -2;
   bUseAltMode = 0;
   if ( Pawn(Owner).Enemy == None )
      return AIRating;

   EnemyDir = Pawn(Owner).Enemy.Location - Owner.Location;
   EnemyDist = VSize(EnemyDir);
   if ( EnemyDist > 1400 )
      return 0;

   bRetreating = ( ((EnemyDir/EnemyDist) Dot Owner.Velocity) < -0.6 );
   if ( (EnemyDist > 600) && (EnemyDir.Z > -0.4 * EnemyDist) )
   {
      // only use if enemy not too far and retreating
      if ( !bRetreating )
         return 0;

      return AIRating;
   }

   bUseAltMode = int( FRand() < 0.3 );

   if ( bRetreating || (EnemyDir.Z < -0.7 * EnemyDist) )
      return (AIRating + 0.18);
   return AIRating;
}

// return delta to combat style
function float SuggestAttackStyle()
{
   return -0.3;
}

function float SuggestDefenseStyle()
{
   return -0.4;
}

function AltFire( float Value )
{
   bPointing=True;
   if ( AmmoType == None )
   {
      // ammocheck
      GiveAmmo(Pawn(Owner));
   }
   if ( AmmoType.UseAmmo(1) )
   {
      GoToState('AltFiring');
      bCanClientFire = true;
      ClientAltFire(Value);
   }
}

simulated function bool ClientAltFire( float Value )
{
   local bool bResult;

   InstFlash = 0.0;
   bResult = Super.ClientAltFire(value);
   InstFlash = Default.InstFlash;
   return bResult;
}

function Projectile ProjectileFire(class<projectile> ProjClass, float ProjSpeed, bool bWarn)
{
   local Vector Start, X,Y,Z;

   Owner.MakeNoise(Pawn(Owner).SoundDampening);
   GetAxes(Pawn(owner).ViewRotation,X,Y,Z);
   Start = Owner.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z;
   AdjustedAim = pawn(owner).AdjustToss(ProjSpeed, Start, 0, True, (bWarn || (FRand() < 0.4)));   
   return Spawn(ProjClass,,, Start,AdjustedAim);
}

simulated function PlayAltFiring()
{
   PlayOwnedSound(Sound'Botpack.BioRifle.BioAltRep', SLOT_Misc, 1.3*Pawn(Owner).SoundDampening);    //loading goop   
   PlayAnim('Charging',0.24,0.05);
}

///////////////////////////////////////////////////////
state ClientAltFiring
{
   simulated function Tick(float DeltaTime)
   {
      if ( bBurst )
         return;
      if ( !bCanClientFire || (Pawn(Owner) == None) )
         GotoState('');
      else if ( Pawn(Owner).bAltFire == 0 )
      {
         PlayAltBurst();
         bBurst = true;
      }
   }

   simulated function AnimEnd()
   {
      if ( bBurst )
      {
         bBurst = false;
         Super.AnimEnd();
      }
      else
         TweenAnim('Loaded', 0.5);
   }
}

state AltFiring
{
   ignores AnimEnd;

   function Tick( float DeltaTime )
   {
      //SetLocation(Owner.Location);
      if ( ChargeSize < 4.1 )
      {
         Count += DeltaTime;
         if ( (Count > 0.5) && AmmoType.UseAmmo(1) )
         {
            ChargeSize += Count;
            Count = 0;
            if ( (PlayerPawn(Owner) == None) && (FRand() < 0.2) )
               GoToState('ShootLoad');
         }
      }
      if( (pawn(Owner).bAltFire==0) )
         GoToState('ShootLoad');
   }

   function BeginState()
   {
      ChargeSize = 0.0;
      Count = 0.0;
   }

   function EndState()
   {
      ChargeSize = FMin(ChargeSize, 4.1);
   }

Begin:
   FinishAnim();
}

state ShootLoad
{
   function ForceFire()
   {
      bForceFire = true;
   }

   function ForceAltFire()
   {
      bForceAltFire = true;
   }

   function Fire(float F)
   {
   }

   function AltFire(float F)
   {
   }

   function Timer()
   {
      local rotator R;
      local vector start, X,Y,Z;

      GetAxes(Pawn(owner).ViewRotation,X,Y,Z);
      R = Owner.Rotation;
      R.Yaw = R.Yaw + Rand(8000) - 4000;
      R.Pitch = R.Pitch + Rand(1000) - 500;
      Start = Owner.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z;
      Spawn(AltProjectileClass,,, Start,R);

      R = Owner.Rotation;
      R.Yaw = R.Yaw + Rand(8000) - 4000;
      R.Pitch = R.Pitch + Rand(1000) - 500;
      Start = Owner.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z;
      Spawn(AltProjectileClass,,, Start,R);
   }

   function AnimEnd()
   {
      Finish();
   }

   function BeginState()
   {
      Local Projectile Gel;

      Gel = ProjectileFire(AltProjectileClass, AltProjectileSpeed, bAltWarnTarget);
      Gel.DrawScale = 1.0 + 0.8 * ChargeSize;
      PlayAltBurst();
   }

Begin:
}


// Finish a firing sequence
function Finish()
{
   local bool bForce, bForceAlt;

   bForce = bForceFire;
   bForceAlt = bForceAltFire;
   bForceFire = false;
   bForceAltFire = false;

   if ( bChangeWeapon )
      GotoState('DownWeapon');
   else if ( PlayerPawn(Owner) == None )
   {
      Pawn(Owner).bAltFire = 0;
      Super.Finish();
   }
   else if ( (AmmoType.AmmoAmount<=0) || (Pawn(Owner).Weapon != self) )
      GotoState('Idle');
   else if ( (Pawn(Owner).bFire!=0) || bForce )
      Global.Fire(0);
   else if ( (Pawn(Owner).bAltFire!=0) || bForceAlt )
      Global.AltFire(0);
   else
      GotoState('Idle');
}

simulated function PlayAltBurst()
{
   if ( Owner.IsA('PlayerPawn') )
      PlayerPawn(Owner).ClientInstantFlash( InstFlash, InstFog);
   PlayOwnedSound(FireSound, SLOT_Misc, 1.7*Pawn(Owner).SoundDampening);   //shoot goop
   PlayAnim('Fire',0.4, 0.05);
}

simulated function PlayFiring()
{
   PlayOwnedSound(AltFireSound, SLOT_None, 1.7*Pawn(Owner).SoundDampening);   //fast fire goop
   LoopAnim('Fire',0.65 + 0.4 * FireAdjust, 0.05);
}

defaultproperties
{
     WeaponDescription="Classification: Toxic Rifle\n\nPrimary Fire: Wads of Tarydium byproduct are lobbed at a medium rate of fire.\n\nSecondary Fire: When trigger is held down, the BioRifle will create a much larger wad of byproduct. When this wad is launched, it will burst into smaller wads which will adhere to any surfaces.\n\nTechniques: Byproducts will adhere to walls, floors, or ceilings. Chain reactions can be caused by covering entryways with this lethal green waste."
     InstFlash=-0.150000
     InstFog=(X=139.000000,Y=218.000000,Z=72.000000)
     AmmoName=Class'Botpack.BioAmmo'
     PickupAmmoCount=25
     bAltWarnTarget=True
     bRapidFire=True
     FiringSpeed=1.000000
     FireOffset=(X=12.000000,Y=-11.000000,Z=-6.000000)
     ProjectileClass=Class'Botpack.UT_BioGel'
     AltProjectileClass=Class'Botpack.BioGlob'
     AIRating=0.600000
     RefireRate=0.900000
     AltRefireRate=0.700000
     FireSound=Sound'UnrealI.BioRifle.GelShot'
     AltFireSound=Sound'UnrealI.BioRifle.GelShot'
     CockingSound=Sound'UnrealI.BioRifle.GelLoad'
     SelectSound=Sound'UnrealI.BioRifle.GelSelect'
     DeathMessage="%o drank a glass of %k's dripping green load."
     NameColor=(R=0,B=0)
     AutoSwitchPriority=3
     InventoryGroup=3
     PickupMessage="You got the GES BioRifle."
     ItemName="GES Bio Rifle"
     PlayerViewOffset=(X=1.700000,Y=-0.850000,Z=-0.950000)
     PlayerViewMesh=LodMesh'Botpack.BRifle2'
     BobDamping=0.972000
     PickupViewMesh=LodMesh'Botpack.BRifle2Pick'
     ThirdPersonMesh=LodMesh'Botpack.BRifle23'
     StatusIcon=Texture'Botpack.Icons.UseBio'
     PickupSound=Sound'UnrealShare.Pickups.WeaponPickup'
     Icon=Texture'Botpack.Icons.UseBio'
     Mesh=LodMesh'Botpack.BRifle2Pick'
     bNoSmooth=False
     CollisionHeight=19.000000
}

Alex
Alpha
 
Posts: 8067
Joined: Wed Nov 12, 03 4:51 pm

Postby Snakey » Wed Mar 08, 06 10:33 pm

Thats a hefty script..
<center>

Image
User avatar
Snakey
Alpha
 
Posts: 3926
Joined: Wed Mar 30, 05 7:09 pm
Location: Wales

Postby Tsukasa Nishino » Wed Mar 08, 06 10:41 pm

wow and this is for one gun only, imagine the codes for heavy weapons
User avatar
Tsukasa Nishino
Master
 
Posts: 1730
Joined: Sun Jul 04, 04 9:36 pm

Postby Alex » Wed Mar 08, 06 10:43 pm

Heavy weapon:
Code: Select all
//=============================================================================
// UT_Eightball.
//=============================================================================
class UT_Eightball extends TournamentWeapon;

var name LoadAnim[6], RotateAnim[6], FireAnim[6];
var int RocketsLoaded, ClientRocketsLoaded;
var bool bFireLoad,bTightWad, bInstantRocket, bAlwaysInstant, bClientDone, bRotated, bPendingLock;
var Actor LockedTarget, NewTarget, OldTarget;

Replication
{
   reliable if ( bNetOwner && (Role == ROLE_Authority) )
      bInstantRocket;
}

function setHand(float Hand)
{
   Super.SetHand(Hand);

   if ( Hand == 0 )
      PlayerViewOffset.Y = 0;
   if ( Hand == 1 )
      Mesh = mesh(DynamicLoadObject("Botpack.EightML", class'Mesh'));
   else
      Mesh = mesh'EightM';
}

function BecomeItem()
{
   local TournamentPlayer TP;

   Super.BecomeItem();
   TP = TournamentPlayer(Instigator);
   bInstantRocket = bAlwaysInstant || ( (TP != None) && TP.bInstantRocket );
}

simulated event RenderTexture(ScriptedTexture Tex)
{
   local Color C;
   local string Temp;
   
   if ( AmmoType != None )
      Temp = String(AmmoType.AmmoAmount);

   while(Len(Temp) < 3) Temp = "0"$Temp;

   C.R = 255;
   C.G = 0;
   C.B = 0;

   Tex.DrawColoredText( 2, 10, Temp, Font'LEDFont2', C );   
}

simulated event RenderOverlays( canvas Canvas )
{
   Texture'MiniAmmoled'.NotifyActor = Self;
   Super.RenderOverlays(Canvas);
   Texture'MiniAmmoled'.NotifyActor = None;
}

simulated function PostRender( canvas Canvas )
{
   local float XScale;

   Super.PostRender(Canvas);
   bOwnsCrossHair = bLockedOn;
   if ( bOwnsCrossHair )
   {
      // if locked on, draw special crosshair
      XScale = FMax(1.0, Canvas.ClipX/640.0);
      Canvas.SetPos(0.5 * (Canvas.ClipX - Texture'Crosshair6'.USize * XScale), 0.5 * (Canvas.ClipY - Texture'Crosshair6'.VSize * XScale));
      Canvas.Style = ERenderStyle.STY_Normal;
      Canvas.DrawIcon(Texture'Crosshair6', 1.0);
      Canvas.Style = 1;   
   }
}
      
simulated function PlayLoading(float rate, int num)
{
   if ( Owner == None )
      return;
   Owner.PlayOwnedSound(CockingSound, SLOT_None, Pawn(Owner).SoundDampening);
   PlayAnim(LoadAnim[num],, 0.05);
}

simulated function PlayRotating(int num)
{
   Owner.PlayOwnedSound(Misc3Sound, SLOT_None, 0.1*Pawn(Owner).SoundDampening);
   PlayAnim(RotateAnim[num],, 0.05);
}

simulated function PlayRFiring(int num)
{
   if ( Owner.IsA('PlayerPawn') )
   {
      PlayerPawn(Owner).shakeview(ShakeTime, ShakeMag*RocketsLoaded, ShakeVert); //shake player view
      PlayerPawn(Owner).ClientInstantFlash( -0.4, vect(650, 450, 190));
   }
   if ( Affector != None )
      Affector.FireEffect();
   if ( bFireLoad )
      PlayOwnedSound(class'RocketMk2'.Default.SpawnSound, SLOT_None, 4.0*Pawn(Owner).SoundDampening);
   else
      PlayOwnedSound(AltFireSound, SLOT_None, 4.0*Pawn(Owner).SoundDampening);
   if ( bFireLoad && bInstantRocket )
      PlayAnim(FireAnim[num], 0.54, 0.05);
   else            
      PlayAnim(FireAnim[num], 0.6, 0.05);
}

simulated function PlayIdleAnim()
{
   if ( Mesh == PickupViewMesh )
      return;
   if (AnimSequence == LoadAnim[0] )
      PlayAnim('Idle',0.1,0.0);
   else
      TweenAnim('Idle', 0.5);
}

// tell bot how valuable this weapon would be to use, based on the bot's combat situation
// also suggest whether to use regular or alternate fire mode
function float RateSelf( out int bUseAltMode )
{
   local float EnemyDist, Rating;
   local bool bRetreating;
   local vector EnemyDir;
   local Pawn P;

   // don't recommend self if out of ammo
   if ( AmmoType.AmmoAmount <=0 )
      return -2;

   // by default use regular mode (rockets)
   bUseAltMode = 0;
   P = Pawn(Owner);
   if ( P.Enemy == None )
      return AIRating;

   // if standing on a lift, make sure not about to go around a corner and lose sight of target
   // (don't want to blow up a rocket in bot's face)
   if ( (P.Base != None) && (P.Base.Velocity != vect(0,0,0))
      && !P.CheckFutureSight(0.1) )
      return 0.1;

   EnemyDir = P.Enemy.Location - Owner.Location;
   EnemyDist = VSize(EnemyDir);
   Rating = AIRating;

   // don't pick rocket launcher is enemy is too close
   if ( EnemyDist < 360 )
   {
      if ( P.Weapon == self )
      {
         // don't switch away from rocket launcher unless really bad tactical situation
         if ( (EnemyDist > 230) || ((P.Health < 50) && (P.Health < P.Enemy.Health - 30)) )
            return Rating;
      }
      return 0.05 + EnemyDist * 0.001;
   }

   // increase rating for situations for which rocket launcher is well suited
   if ( P.Enemy.IsA('StationaryPawn') )
      Rating += 0.4;

   // rockets are good if higher than target, bad if lower than target
   if ( Owner.Location.Z > P.Enemy.Location.Z + 120 )
      Rating += 0.25;
   else if ( P.Enemy.Location.Z > Owner.Location.Z + 160 )
      Rating -= 0.35;
   else if ( P.Enemy.Location.Z > Owner.Location.Z + 80 )
      Rating -= 0.05;

   // decide if should use alternate fire (grenades) instead
   if ( (Owner.Physics == PHYS_Falling) || Owner.Region.Zone.bWaterZone )
      bUseAltMode = 0;
   else if ( EnemyDist < -1.5 * EnemyDir.Z )
      bUseAltMode = int( FRand() < 0.5 );
   else
   {
      // grenades are good covering fire when retreating
      bRetreating = ( ((EnemyDir/EnemyDist) Dot Owner.Velocity) < -0.7 );
      bUseAltMode = 0;
      if ( bRetreating && (EnemyDist < 800) && (FRand() < 0.4) )
         bUseAltMode = 1;
   }
   return Rating;
}

// return delta to combat style while using this weapon
function float SuggestAttackStyle()
{
   local float EnemyDist;

   // recommend backing off if target is too close
   EnemyDist = VSize(Pawn(Owner).Enemy.Location - Owner.Location);
   if ( EnemyDist < 600 )
   {
      if ( EnemyDist < 300 )
         return -1.5;
      else
         return -0.7;
   }
   else
      return -0.2;
}

function Fire( float Value )
{
   local TournamentPlayer TP;

   bPointing=True;
   if ( AmmoType == None )
   {
      // ammocheck
      GiveAmmo(Pawn(Owner));
   }
   if ( AmmoType.UseAmmo(1) )
   {
      TP = TournamentPlayer(Instigator);
      bCanClientFire = true;
      bInstantRocket = bAlwaysInstant || ( (TP != None) && TP.bInstantRocket );
      if ( bInstantRocket )
      {
         bFireLoad = True;
         RocketsLoaded = 1;
         GotoState('');
         GotoState('FireRockets', 'Begin');
      }
      else if ( Instigator.IsA('Bot') )
      {
         if ( LockedTarget != None )
         {
            bFireLoad = True;
            RocketsLoaded = 1;
            Instigator.bFire = 0;
            bPendingLock = true;
            GotoState('');
            GotoState('FireRockets', 'Begin');
            return;
         }
         else if ( (NewTarget != None) && !NewTarget.IsA('StationaryPawn')
            && (FRand() < 0.8)
            && (VSize(Instigator.Location - NewTarget.Location) > 400 + 400 * (1.25 - TimerCounter) + 1300 * FRand()) )
         {
            Instigator.bFire = 0;
            bPendingLock = true;
            GotoState('Idle','PendingLock');
            return;
         }
         else if ( !Bot(Owner).bNovice
               && (FRand() < 0.7)
               && IsInState('Idle') && (Instigator.Enemy != None)
               && ((Instigator.Enemy == Instigator.Target) || (Instigator.Target == None))
               && !Instigator.Enemy.IsA('StationaryPawn')
               && (VSize(Instigator.Location - Instigator.Enemy.Location) > 700 + 1300 * FRand())
               && (VSize(Instigator.Location - Instigator.Enemy.Location) < 2000) )
         {
            NewTarget = CheckTarget();
            OldTarget = NewTarget;
            if ( NewTarget == Instigator.Enemy )
            {
               if ( TimerCounter > 0.6 )
                  SetTimer(1.0, true);
               Instigator.bFire = 0;
               bPendingLock = true;
               GotoState('Idle','PendingLock');
               return;
            }
         }
         bPendingLock = false;
         GotoState('NormalFire');
      }
      else
         GotoState('NormalFire');
   }
}

simulated function bool ClientFire( float Value )
{
   if ( bCanClientFire && ((Role == ROLE_Authority) || (AmmoType == None) || (AmmoType.AmmoAmount > 0)) )
   {
      GotoState('ClientFiring');
      return true;
   }
   return false;
}

simulated function FiringRockets()
{
   PlayRFiring(ClientRocketsLoaded - 1);
   bClientDone = true;
   Disable('Tick');
}

function AltFire( float Value )
{
   bPointing=True;
   bCanClientFire = true;
   if ( AmmoType == None )
   {
      // ammocheck
      GiveAmmo(Pawn(Owner));
   }
   if ( AmmoType.UseAmmo(1) )
      GoToState('AltFiring');
}

simulated function bool ClientAltFire( float Value )
{
   if ( bCanClientFire && ((Role == ROLE_Authority) || (AmmoType == None) || (AmmoType.AmmoAmount > 0)) )
   {
      GotoState('ClientAltFiring');
      return true;
   }
   return false;
}

function Actor CheckTarget()
{
   local Actor ETarget;
   local Vector Start, X,Y,Z;
   local float bestDist, bestAim;
   local Pawn PawnOwner;
   local rotator AimRot;
   local int diff;

   PawnOwner = Pawn(Owner);
   bPointing = false;
   if ( Owner.IsA('PlayerPawn') )
   {
      GetAxes(PawnOwner.ViewRotation,X,Y,Z);
      Start = Owner.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z;
      bestAim = 0.93;
      ETarget = PawnOwner.PickTarget(bestAim, bestDist, X, Start);
   }
   else if ( PawnOwner.Enemy == None )
      return None;
   else if ( Owner.IsA('Bot') && Bot(Owner).bNovice )
      return None;
   else if ( VSize(PawnOwner.Enemy.Location - PawnOwner.Location) < 2000 )
   {
      Start = Owner.Location + CalcDrawOffset() + FireOffset.Z * vect(0,0,1);
      AimRot = rotator(PawnOwner.Enemy.Location - Start);
      diff = abs((AimRot.Yaw & 65535) - (PawnOwner.Rotation.Yaw & 65535));
      if ( (diff > 7200) && (diff < 58335) )
         return None;
      // check if can hold lock
      if ( !bPendingLock ) //not already locked
      {
         AimRot = rotator(PawnOwner.Enemy.Location + (3 - PawnOwner.Skill) * 0.3 * PawnOwner.Enemy.Velocity - Start);
         diff = abs((AimRot.Yaw & 65535) - (PawnOwner.Rotation.Yaw & 65535));
         if ( (diff > 16000) && (diff < 49535) )
            return None;
      }
                     
      // check line of sight
      ETarget = Trace(X,Y, PawnOwner.Enemy.Location, Start, false);
      if ( ETarget != None )
         return None;

      return PawnOwner.Enemy;
   }
   bPointing = (ETarget != None);
   Return ETarget;
}

//////////////////////////////////////////////////////
state AltFiring
{
   function Tick( float DeltaTime )
   {
      if( (pawn(Owner).bAltFire==0) || (RocketsLoaded > 5) )  // If if Fire button down, load up another
          GoToState('FireRockets');
   }

   
   function AnimEnd()
   {
      if ( bRotated )
      {
         bRotated = false;
         PlayLoading(1.1, RocketsLoaded);
      }
      else
      {
         if ( RocketsLoaded == 6 )
         {
            GotoState('FireRockets');
            return;
         }
         RocketsLoaded++;
         AmmoType.UseAmmo(1);      
         if ( (PlayerPawn(Owner) == None) && ((FRand() > 0.5) || (Pawn(Owner).Enemy == None)) )
            Pawn(Owner).bAltFire = 0;
         bPointing = true;
         Owner.MakeNoise(0.6 * Pawn(Owner).SoundDampening);      
         RotateRocket();
      }
   }

   function RotateRocket()
   {
      if (AmmoType.AmmoAmount<=0)
      {
         GotoState('FireRockets');
         return;
      }      
      PlayRotating(RocketsLoaded-1);
      bRotated = true;
   }

   function BeginState()
   {
      Super.BeginState();
      RocketsLoaded = 1;
      bFireLoad = False;
      RotateRocket();
   }

Begin:
   bLockedOn = False;
}

///////////////////////////////////////////////////////
state NormalFire
{
   function bool SplashJump()
   {
      return true;
   }

   function Tick( float DeltaTime )
   {
      if ( (PlayerPawn(Owner) == None)
         && ((Pawn(Owner).MoveTarget != Pawn(Owner).Target)
            || (LockedTarget != None)
            || (Pawn(Owner).Enemy == None)
            || ( Mover(Owner.Base) != None )
            || ((Owner.Physics == PHYS_Falling) && (Owner.Velocity.Z < 5))
            || (VSize(Owner.Location - Pawn(Owner).Target.Location) < 400)
            || !Pawn(Owner).CheckFutureSight(0.15)) )
         Pawn(Owner).bFire = 0;

      if( pawn(Owner).bFire==0 || RocketsLoaded > 5)  // If Fire button down, load up another
          GoToState('FireRockets');
   }
   
   function AnimEnd()
   {
      if ( bRotated )
      {
         bRotated = false;
         PlayLoading(1.1, RocketsLoaded);
      }
      else
      {
         if ( RocketsLoaded == 6 )
         {
            GotoState('FireRockets');
            return;
         }
         RocketsLoaded++;
         AmmoType.UseAmmo(1);
         if (pawn(Owner).bAltFire!=0) bTightWad=True;
         NewTarget = CheckTarget();
         if ( Pawn(NewTarget) != None )
            Pawn(NewTarget).WarnTarget(Pawn(Owner), ProjectileSpeed, vector(Pawn(Owner).ViewRotation));   
         if ( LockedTarget != None )
         {
            If ( NewTarget != LockedTarget )
            {
               LockedTarget = None;
               Owner.PlaySound(Misc2Sound, SLOT_None, Pawn(Owner).SoundDampening);
               bLockedOn=False;
            }
            else if (LockedTarget != None)
                Owner.PlaySound(Misc1Sound, SLOT_None, Pawn(Owner).SoundDampening);
         }
         bPointing = true;
         Owner.MakeNoise(0.6 * Pawn(Owner).SoundDampening);      
         RotateRocket();
      }
   }

   function BeginState()
   {
      Super.BeginState();
      bFireLoad = True;
      RocketsLoaded = 1;
      RotateRocket();
   }

   function RotateRocket()
   {
      if ( PlayerPawn(Owner) == None )
      {
         if ( FRand() > 0.33 )
            Pawn(Owner).bFire = 0;
         if ( Pawn(Owner).bFire == 0 )
         {
             GoToState('FireRockets');
            return;
         }
      }
      if ( AmmoType.AmmoAmount <= 0 )
      {
         GotoState('FireRockets');
         return;
      }
      if ( AmmoType.AmmoAmount == 1 )
         Owner.PlaySound(Misc2Sound, SLOT_None, Pawn(Owner).SoundDampening);
      PlayRotating(RocketsLoaded-1);
      bRotated = true;
   }
            
Begin:
   Sleep(0.0);
}

///////////////////////////////////////////////////////
state Idle
{
   function Timer()
   {
      NewTarget = CheckTarget();
      if ( NewTarget == OldTarget )
      {
         LockedTarget = NewTarget;
         If (LockedTarget != None)
         {
            bLockedOn=True;         
            Owner.MakeNoise(Pawn(Owner).SoundDampening);
            Owner.PlaySound(Misc1Sound, SLOT_None,Pawn(Owner).SoundDampening);
            if ( (Pawn(LockedTarget) != None) && (FRand() < 0.7) )
               Pawn(LockedTarget).WarnTarget(Pawn(Owner), ProjectileSpeed, vector(Pawn(Owner).ViewRotation));   
            if ( bPendingLock )
            {
               OldTarget = NewTarget;
               Pawn(Owner).bFire = 0;
               bFireLoad = True;
               RocketsLoaded = 1;
               GotoState('FireRockets', 'Begin');
               return;
            }
         }
      }
      else if( (OldTarget != None) && (NewTarget == None) )
      {
         Owner.PlaySound(Misc2Sound, SLOT_None,Pawn(Owner).SoundDampening);
         bLockedOn = False;
      }
      else
      {
         LockedTarget = None;
         bLockedOn = False;
      }
      OldTarget = NewTarget;
      bPendingLock = false;
   }

Begin:
   if (Pawn(Owner).bFire!=0) Fire(0.0);
   if (Pawn(Owner).bAltFire!=0) AltFire(0.0);   
   bPointing=False;
   if (AmmoType.AmmoAmount<=0)
      Pawn(Owner).SwitchToBestWeapon();  //Goto Weapon that has Ammo
   PlayIdleAnim();
   OldTarget = CheckTarget();
   SetTimer(1.25,True);
   LockedTarget = None;
   bLockedOn = False;
PendingLock:
   if ( bPendingLock )
      bPointing = true;
   if ( TimerRate <= 0 )
      SetTimer(1.0, true);
}


state ClientReload
{
   simulated function bool ClientFire(float Value)
   {
      bForceFire = bForceFire || ( bCanClientFire && (Pawn(Owner) != None) && (AmmoType.AmmoAmount > 0) );
      return bForceFire;
   }

   simulated function bool ClientAltFire(float Value)
   {
      bForceAltFire = bForceAltFire || ( bCanClientFire && (Pawn(Owner) != None) && (AmmoType.AmmoAmount > 0) );
      return bForceAltFire;
   }

   simulated function AnimEnd()
   {
      if ( bCanClientFire && (PlayerPawn(Owner) != None) && (AmmoType.AmmoAmount > 0) )
      {
         if ( bForceFire || (Pawn(Owner).bFire != 0) )
         {
            Global.ClientFire(0);
            return;
         }
         else if ( bForceAltFire || (Pawn(Owner).bAltFire != 0) )
         {
            Global.ClientAltFire(0);
            return;
         }
      }         
      GotoState('');
      Global.AnimEnd();
   }

   simulated function EndState()
   {
      bForceFire = false;
      bForceAltFire = false;
   }

   simulated function BeginState()
   {
      bForceFire = false;
      bForceAltFire = false;
   }
}

state ClientFiring
{
   simulated function Tick(float DeltaTime)
   {
      if ( (Pawn(Owner).bFire == 0) || (Ammotype.AmmoAmount <= 0) )
         FiringRockets();
   }
   
   simulated function AnimEnd()
   {
      if ( !bCanClientFire || (Pawn(Owner) == None) )
         GotoState('');
      else if ( bClientDone )
      {
         PlayLoading(1.5,0);
         GotoState('ClientReload');
      }
      else if ( bRotated )
      {
         PlayLoading(1.1, ClientRocketsLoaded);
         bRotated = false;
         ClientRocketsLoaded++;
      }
      else
      {
         if ( bInstantRocket || (ClientRocketsLoaded == 6) )
         {
            FiringRockets();
            return;
         }
         Enable('Tick');
         PlayRotating(ClientRocketsLoaded - 1);
         bRotated = true;
      }
   }

   simulated function BeginState()
   {
      bFireLoad = true;
      if ( bInstantRocket )
      {
         ClientRocketsLoaded = 1;
         FiringRockets();
      }
      else
      {
         ClientRocketsLoaded = 1;
         PlayRotating(ClientRocketsLoaded - 1);
         bRotated = true;
      }
   }

   simulated function EndState()
   {
      ClientRocketsLoaded = 0;
      bClientDone = false;
      bRotated = false;
   }
}

state ClientAltFiring
{
   simulated function Tick(float DeltaTime)
   {
      if ( (Pawn(Owner).bAltFire == 0) || (Ammotype.AmmoAmount <= 0) )
         FiringRockets();
   }
   
   simulated function AnimEnd()
   {
      if ( !bCanClientFire || (Pawn(Owner) == None) )
         GotoState('');
      else if ( bClientDone )
      {
         PlayLoading(1.5,0);
         GotoState('ClientReload');
      }
      else if ( bRotated )
      {
         PlayLoading(1.1, ClientRocketsLoaded);
         bRotated = false;
         ClientRocketsLoaded++;
      }
      else
      {
         if ( ClientRocketsLoaded == 6 )
         {
            FiringRockets();
            return;
         }
         Enable('Tick');
         PlayRotating(ClientRocketsLoaded - 1);
         bRotated = true;
      }
   }

   simulated function BeginState()
   {
      bFireLoad = false;
      ClientRocketsLoaded = 1;
      PlayRotating(ClientRocketsLoaded - 1);
      bRotated = true;
   }

   simulated function EndState()
   {
      ClientRocketsLoaded = 0;
      bClientDone = false;
      bRotated = false;
   }
}

///////////////////////////////////////////////////////
state FireRockets
{
   function Fire(float F) {}
   function AltFire(float F) {}

   function ForceFire()
   {
      bForceFire = true;
   }

   function ForceAltFire()
   {
      bForceAltFire = true;
   }

   function bool SplashJump()
   {
      return false;
   }

   function BeginState()
   {
      local vector FireLocation, StartLoc, X,Y,Z;
      local rotator FireRot, RandRot;
      local rocketmk2 r;
      local UT_SeekingRocket s;
      local ut_grenade g;
      local float Angle, RocketRad;
      local pawn BestTarget, PawnOwner;
      local PlayerPawn PlayerOwner;
      local int DupRockets;
      local bool bMultiRockets;

      PawnOwner = Pawn(Owner);
      if ( PawnOwner == None )
         return;
      PawnOwner.PlayRecoil(FiringSpeed);
      PlayerOwner = PlayerPawn(Owner);
      Angle = 0;
      DupRockets = RocketsLoaded - 1;
      if (DupRockets < 0) DupRockets = 0;
      if ( PlayerOwner == None )
         bTightWad = ( FRand() * 4 < PawnOwner.skill );

      GetAxes(PawnOwner.ViewRotation,X,Y,Z);
      StartLoc = Owner.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z;

      if ( bFireLoad )       
         AdjustedAim = PawnOwner.AdjustAim(ProjectileSpeed, StartLoc, AimError, True, bWarnTarget);
      else
         AdjustedAim = PawnOwner.AdjustToss(AltProjectileSpeed, StartLoc, AimError, True, bAltWarnTarget);   
         
      if ( PlayerOwner != None )
         AdjustedAim = PawnOwner.ViewRotation;
      
      PlayRFiring(RocketsLoaded-1);      
      Owner.MakeNoise(PawnOwner.SoundDampening);
      if ( !bFireLoad )
      {
         LockedTarget = None;
         bLockedOn = false;
      }
      else if ( LockedTarget != None )
      {
         BestTarget = Pawn(CheckTarget());
         if ( (LockedTarget!=None) && (LockedTarget != BestTarget) )
         {
            LockedTarget = None;
            bLockedOn=False;
         }
      }
      else
         BestTarget = None;
      bPendingLock = false;
      bPointing = true;
      FireRot = AdjustedAim;
      RocketRad = 4;
      if (bTightWad || !bFireLoad) RocketRad=7;
      bMultiRockets = ( RocketsLoaded > 1 );
      While ( RocketsLoaded > 0 )
      {
         if ( bMultiRockets )
            Firelocation = StartLoc - (Sin(Angle)*RocketRad - 7.5)*Y + (Cos(Angle)*RocketRad - 7)*Z - X * 4 * FRand();
         else
            FireLocation = StartLoc;
         if (bFireLoad)
         {
            if ( Angle > 0 )
            {
               if ( Angle < 3 && !bTightWad)
                  FireRot.Yaw = AdjustedAim.Yaw - Angle * 600;
               else if ( Angle > 3.5 && !bTightWad)
                  FireRot.Yaw = AdjustedAim.Yaw + (Angle - 3)  * 600;
               else
                  FireRot.Yaw = AdjustedAim.Yaw;
            }
            if ( LockedTarget != None )
            {
               s = Spawn( class 'ut_SeekingRocket',, '', FireLocation,FireRot);
               s.Seeking = LockedTarget;
               s.NumExtraRockets = DupRockets;               
               if ( Angle > 0 )
                  s.Velocity *= (0.9 + 0.2 * FRand());         
            }
            else
            {
               r = Spawn( class'rocketmk2',, '', FireLocation,FireRot);
               r.NumExtraRockets = DupRockets;
               if (RocketsLoaded>4 && bTightWad) r.bRing=True;
               if ( Angle > 0 )
                  r.Velocity *= (0.9 + 0.2 * FRand());         
            }
         }
         else
         {
            g = Spawn( class 'ut_Grenade',, '', FireLocation,AdjustedAim);
            g.NumExtraGrenades = DupRockets;
            if ( DupRockets > 0 )
            {
               RandRot.Pitch = FRand() * 1500 - 750;
               RandRot.Yaw = FRand() * 1500 - 750;
               RandRot.Roll = FRand() * 1500 - 750;
               g.Velocity = g.Velocity >> RandRot;
            }
         }

         Angle += 1.0484; //2*3.1415/6;
         RocketsLoaded--;
      }
      bTightWad=False;
      bRotated = false;
   }

   function AnimEnd()
   {
      if ( !bRotated && (AmmoType.AmmoAmount > 0) )
      {   
         PlayLoading(1.5,0);
         RocketsLoaded = 1;
         bRotated = true;
         return;
      }
      LockedTarget = None;
      Finish();
   }
Begin:   
}

defaultproperties
{
     LoadAnim(0)=load1
     LoadAnim(1)=Load2
     LoadAnim(2)=Load3
     LoadAnim(3)=Load4
     LoadAnim(4)=Load5
     LoadAnim(5)=Load6
     RotateAnim(0)=Rotate1
     RotateAnim(1)=Rotate2
     RotateAnim(2)=Rotate3
     RotateAnim(3)=Rotate4
     RotateAnim(4)=Rotate5
     RotateAnim(5)=Rotate3
     FireAnim(0)=Fire1
     FireAnim(1)=Fire2
     FireAnim(2)=Fire3
     FireAnim(3)=Fire4
     FireAnim(4)=Fire2
     FireAnim(5)=Fire3
     WeaponDescription="Classification: Heavy Ballistic\n\nPrimary Fire: Slow moving but deadly rockets are fired at opponents. Trigger can be held down to load up to six rockets at a time, which can be fired at once.\n\nSecondary Fire: Grenades are lobbed from the barrel. Secondary trigger can be held as well to load up to six grenades.\n\nTechniques: Keeping this weapon pointed at an opponent will cause it to lock on, and while the gun is locked the next rocket fired will be a homing rocket.  Because the Rocket Launcher can load up multiple rockets, it fires when you release the fire button.  If you prefer, it can be configured to fire a rocket as soon as you press fire button down, at the expense of the multiple rocket load-up feature.  This is set in the Input Options menu."
     AmmoName=Class'Botpack.RocketPack'
     PickupAmmoCount=6
     bWarnTarget=True
     bAltWarnTarget=True
     bSplashDamage=True
     bRecommendSplashDamage=True
     FiringSpeed=1.000000
     FireOffset=(X=10.000000,Y=-5.000000,Z=-8.800000)
     ProjectileClass=Class'Botpack.RocketMk2'
     AltProjectileClass=Class'Botpack.UT_Grenade'
     shakemag=350.000000
     shaketime=0.200000
     shakevert=7.500000
     AIRating=0.750000
     RefireRate=0.250000
     AltRefireRate=0.250000
     AltFireSound=Sound'UnrealShare.Eightball.EightAltFire'
     CockingSound=Sound'UnrealShare.Eightball.Loading'
     SelectSound=Sound'UnrealShare.Eightball.Selecting'
     Misc1Sound=Sound'UnrealShare.Eightball.SeekLock'
     Misc2Sound=Sound'UnrealShare.Eightball.SeekLost'
     Misc3Sound=Sound'UnrealShare.Eightball.BarrelMove'
     DeathMessage="%o was smacked down by %k's %w."
     NameColor=(G=0,B=0)
     AutoSwitchPriority=9
     InventoryGroup=9
     PickupMessage="You got the Rocket Launcher."
     ItemName="Rocket Launcher"
     PlayerViewOffset=(X=2.400000,Y=-1.000000,Z=-2.200000)
     PlayerViewMesh=LodMesh'Botpack.Eightm'
     PlayerViewScale=2.000000
     BobDamping=0.975000
     PickupViewMesh=LodMesh'Botpack.Eight2Pick'
     ThirdPersonMesh=LodMesh'Botpack.EightHand'
     StatusIcon=Texture'Botpack.Icons.Use8ball'
     PickupSound=Sound'UnrealShare.Pickups.WeaponPickup'
     Icon=Texture'Botpack.Icons.Use8ball'
     Mesh=LodMesh'Botpack.Eight2Pick'
     bNoSmooth=False
     CollisionHeight=10.000000
}

Alex
Alpha
 
Posts: 8067
Joined: Wed Nov 12, 03 4:51 pm

Postby Tsukasa Nishino » Wed Mar 08, 06 10:46 pm

please don't tell me that melee weapons are just as long (logically its not possible)
User avatar
Tsukasa Nishino
Master
 
Posts: 1730
Joined: Sun Jul 04, 04 9:36 pm

Postby Wasted » Wed Mar 08, 06 10:46 pm

Why imagine, You have Alex. Straight to the point. :roll:
FFS
User avatar
Wasted
Forum Hero
 
Posts: 2861
Joined: Sun Oct 30, 05 6:29 pm
Location: 1337 14ND

Postby Alex » Wed Mar 08, 06 10:47 pm

ChainSaw is pretty small :)
Code: Select all
//=============================================================================
// ChainSaw.
//=============================================================================
class ChainSaw extends TournamentWeapon;

var() float Range;
var() sound HitSound, DownSound;
var Playerpawn LastHit;

function float RateSelf( out int bUseAltMode )
{
   local float EnemyDist;
   local bool bRetreating;
   local vector EnemyDir;

   bUseAltMode = 0;

   if ( (Pawn(Owner) == None) || (Pawn(Owner).Enemy == None) )
      return 0;

   EnemyDist = VSize(Pawn(Owner).Enemy.Location - Owner.Location);
   if ( EnemyDist > 400 )
      return -2;

   if ( EnemyDist < 110 )
      bUseAltMode = 1;

   return ( FMin(1.0, 81/(EnemyDist + 1)) );
}

function float SuggestAttackStyle()
{
   return 1.0;
}

function float SuggestDefenseStyle()
{
   return -0.7;
}

function Fire( float Value )
{
   GotoState('NormalFire');
   bPointing=True;
   bCanClientFire = true;
   Pawn(Owner).PlayRecoil(FiringSpeed);
   ClientFire(value);
   TraceFire(0.0);
}

simulated function PlayFiring()
{
   LoopAnim( 'Jab2', 0.7, 0.0 );
   AmbientSound = HitSound;
   SoundVolume = 255;      
}

function AltFire( float Value )
{
   GotoState('AltFiring');
   Pawn(Owner).PlayRecoil(FiringSpeed);
   bCanClientFire = true;
   bPointing=True;
   ClientAltFire(value);
}

simulated function PlayAltFiring()
{
   PlayAnim( 'Swipe', 0.6 );
   AmbientSound = HitSound;
   SoundVolume = 255;      
}

simulated function EndAltFiring()
{
   AmbientSound = Sound'Botpack.ChainIdle';
   TweenAnim('Idle', 1.0);
}


state NormalFire
{
   ignores AnimEnd;

   function BeginState()
   {
      Super.BeginState();
      AmbientSound = HitSound;
      SoundVolume = 255;      
   }

   function EndState()
   {
       AmbientSound = Sound'Botpack.ChainIdle';
      Super.EndState();
      SoundVolume = Default.SoundVolume;      
   }

Begin:
   Sleep(0.15);
   if ( PlayerPawn(Owner) != None )
      PlayerPawn(Owner).ShakeView(ShakeTime, ShakeMag, ShakeVert);
   TraceFire(0.0);
   Sleep(0.15);
   if ( PlayerPawn(Owner) != None )
      PlayerPawn(Owner).ShakeView(ShakeTime, ShakeMag, ShakeVert);
   if ( LastHit != None )
   {
      LastHit.ClientFlash( -0.38, vect(530, 90, 90));
      LastHit.ShakeView(0.25, 600, 6);
   }
   if ( Pawn(Owner).bFire == 0 )
      Finish();
   Goto('Begin');
}

////////////////////////////////////////////////////////
state ClientFiring
{
   simulated function EndState()
   {
       AmbientSound = Sound'Botpack.ChainIdle';
      Super.EndState();
      SoundVolume = Default.SoundVolume;      
   }
}

state ClientAltFiring
{
   simulated function AnimEnd()
   {
      if ( AnimSequence != 'Idle' )
      {
         EndAltFiring();
      }
      else if ( !bCanClientFire )
         GotoState('');
      else if ( Pawn(Owner) == None )
      {
         PlayIdleAnim();
         GotoState('');
      }
      else if ( Pawn(Owner).bFire != 0 )
         Global.ClientFire(0);
      else if ( Pawn(Owner).bAltFire != 0 )
         Global.ClientAltFire(0);
      else
      {
         PlayIdleAnim();
         GotoState('');
      }
   }

   function EndState()
   {
       AmbientSound = Sound'Botpack.ChainIdle';
      Super.EndState();
      SoundVolume = Default.SoundVolume;      
   }
}

state AltFiring
{
   ignores AnimEnd;

   function Fire(float F)
   {
   }

   function AltFire(float F)
   {
   }

   function BeginState()
   {
      Super.BeginState();
      AmbientSound = HitSound;
      SoundVolume = 255;      
   }

   function EndState()
   {
      Super.EndState();
       AmbientSound = Sound'Botpack.ChainIdle';
      SoundVolume = Default.SoundVolume;      
   }

Begin:
   AmbientSound = HitSound;
   Sleep(0.1);
   FinishAnim();
   EndAltFiring();
   FinishAnim();
   Finish();
}

state Idle
{
   ignores animend;

   function bool PutDown()
   {
      GotoState('DownWeapon');
      return True;
   }

Begin:
   bPointing=False;
   if ( (AmmoType != None) && (AmmoType.AmmoAmount<=0) )
      Pawn(Owner).SwitchToBestWeapon();  //Goto Weapon that has Ammo
   if ( Pawn(Owner).bFire!=0 )
      Fire(0.0);
   if ( Pawn(Owner).bAltFire!=0 )
      AltFire(0.0);
   FinishAnim();
   AnimFrame=0;
   PlayIdleAnim();
   Goto('Begin');
}

simulated function PlayIdleAnim()
{
   if ( Mesh != PickupViewMesh )
      PlayAnim( 'Idle', 1.0, 0.0 );
}

// Finish a firing sequence
function Finish()
{
   if ( bChangeWeapon )
   {
      GotoState('DownWeapon');
      return;
   }

   if ( PlayerPawn(Owner) == None )
   {
      if ( (Pawn(Owner).bFire != 0) && (FRand() < RefireRate) )
         Global.Fire(0);
      else if ( (Pawn(Owner).bAltFire != 0) && (FRand() < AltRefireRate) )
         Global.AltFire(0);   
      else
      {
         Pawn(Owner).StopFiring();
         GotoState('Idle');
      }
      return;
   }
   if ( Pawn(Owner).bFire!=0 )
      Global.Fire(0);
   else if ( Pawn(Owner).bAltFire!=0 )
      Global.AltFire(0);
   else
      GotoState('Idle');
}

function Slash()
{
   local vector HitLocation, HitNormal, EndTrace, X, Y, Z, Start;
   local actor Other;

   Owner.MakeNoise(Pawn(Owner).SoundDampening);
   GetAxes(Pawn(owner).ViewRotation, X, Y, Z);
   Start =  Owner.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z;
   AdjustedAim = pawn(owner).AdjustAim(1000000, Start, AimError, False, False);   
   EndTrace = Owner.Location + (Range * vector(AdjustedAim));
   Other = Pawn(Owner).TraceShot(HitLocation, HitNormal, EndTrace, Start);

   if ( (Other == None) || (Other == Owner) || (Other == self) )
      return;

   if ( PlayerPawn(Owner) != None )
      PlayerPawn(Owner).ShakeView(ShakeTime, ShakeMag, ShakeVert);
   Other.TakeDamage(110, Pawn(Owner), HitLocation, -10000.0 * Y, AltDamageType);
   if ( !Other.bIsPawn && !Other.IsA('Carcass') )
      spawn(class'SawHit',,,HitLocation+HitNormal, rotator(HitNormal));
}


function TraceFire(float accuracy)
{
   local vector HitLocation, HitNormal, EndTrace, X, Y, Z, Start;
   local actor Other;

   LastHit = None;
   Owner.MakeNoise(Pawn(Owner).SoundDampening);
   GetAxes(Pawn(owner).ViewRotation, X, Y, Z);
   Start =  Owner.Location + CalcDrawOffset() + FireOffset.Y * Y + FireOffset.Z * Z;
   AdjustedAim = pawn(owner).AdjustAim(1000000, Start, 2 * AimError, False, False);   
   EndTrace = Owner.Location + (10 + Range) * vector(AdjustedAim);
   Other = Pawn(Owner).TraceShot(HitLocation, HitNormal, EndTrace, Start);

   if ( (Other == None) || (Other == Owner) || (Other == self) )
      return;

   Other.TakeDamage(20.0, Pawn(Owner), HitLocation, -15000 * X, MyDamageType);
   if ( !Other.bIsPawn && !Other.IsA('Carcass') )
      spawn(class'SawHit',,,HitLocation+HitNormal, Rotator(HitNormal));
   else if ( Other.IsA('PlayerPawn') && (Pawn(Other).Health > 0) )
      LastHit = PlayerPawn(Other);
}


simulated function PlayPostSelect()
{
    AmbientSound = Sound'Botpack.ChainIdle';
   if ( Level.NetMode == NM_Client )
   {
      Super.PlayPostSelect();
      return;
   }
}


simulated function TweenDown()
{
   Owner.PlayOwnedSound(DownSound,, 4.0 * Pawn(Owner).SoundDampening);
   Super.TweenDown();
   AmbientSound = None;
}

defaultproperties
{
     Range=90.000000
     HitSound=Sound'Botpack.ChainSaw.SawHit'
     DownSound=Sound'Botpack.ChainSaw.ChainPowerDown'
     WeaponDescription="Classification: Melee Blade\n\nPrimary Fire: When the trigger is held down, the chain covered blade will rev up. Drive this blade into opponents to inflict massive damage.\n\nSecondary Fire: The revved up blade can be swung horizontally and can cause instant decapitation of foes.\n\nTechniques: The chainsaw makes a loud and recognizable roar and can be avoided by listening for audio cues."
     bMeleeWeapon=True
     bRapidFire=True
     FireOffset=(X=10.000000,Y=-2.500000,Z=5.000000)
     MyDamageType=slashed
     AltDamageType=Decapitated
     RefireRate=1.000000
     AltRefireRate=1.000000
     SelectSound=Sound'Botpack.ChainSaw.ChainPickup'
     DeathMessage="%k ripped into %o with a blood soaked %w."
     PickupMessage="Its been five years since I've seen one of these."
     ItemName="Chainsaw"
     PlayerViewOffset=(X=2.000000,Y=-1.100000,Z=-0.900000)
     PlayerViewMesh=LodMesh'Botpack.chainsawM'
     PickupViewMesh=LodMesh'Botpack.ChainSawPick'
     ThirdPersonMesh=LodMesh'Botpack.CSHand'
     StatusIcon=Texture'Botpack.Icons.UseSaw'
     PickupSound=Sound'UnrealShare.Pickups.WeaponPickup'
     Icon=Texture'Botpack.Icons.UseSaw'
     Mesh=LodMesh'Botpack.ChainSawPick'
     bNoSmooth=False
     SoundVolume=100
}

Alex
Alpha
 
Posts: 8067
Joined: Wed Nov 12, 03 4:51 pm

Postby Wasted » Wed Mar 08, 06 10:48 pm

11 replies and nearly a page of space :o
FFS
User avatar
Wasted
Forum Hero
 
Posts: 2861
Joined: Sun Oct 30, 05 6:29 pm
Location: 1337 14ND

Postby ~ô¿ô~Nobody~ » Wed Mar 08, 06 10:48 pm

@Alex:

ok, now explain the code :lol:

PS: Y DO U HAT ME? :shock:
you don't answer me on MSN anymore :cry:
Nobody is perfect...
------------------------------
Longc[A]t wrote:I still think Dae is a russian spambot.

~[A]Daedalus~ wrote:There will be a day when my patience goes away and you, along with all who rant with you, will get banned.

ô¿ô¥[GODZ]¥NOCHANC wrote:I can ban any one I want ANY time I want. You have no rights here.
User avatar
~ô¿ô~Nobody~
Alpha
 
Posts: 2520
Joined: Fri Dec 31, 04 3:20 pm
Location: Proclarush Taonas

Postby Alex » Wed Mar 08, 06 10:49 pm

Me? Am I online then?! Well, Didn't manage to get on MSN since it crashed =( (This is about 2 hours) I will explain the code later, I know I can do it :)
I got to go now, going to sleep, YES SLEEP, I'm HUMAN!!!!
Alex
Alpha
 
Posts: 8067
Joined: Wed Nov 12, 03 4:51 pm

Postby Wasted » Wed Mar 08, 06 10:51 pm

@Nobody

You freakishly log out when I log in :shock:


Ah well some internet problem probably.
FFS
User avatar
Wasted
Forum Hero
 
Posts: 2861
Joined: Sun Oct 30, 05 6:29 pm
Location: 1337 14ND

Postby Allan » Wed Mar 08, 06 11:01 pm

:P you think those are large, you see the mesh import file for DX! XD

(I only have the demo of UT-GOTY, doesnt have bio-rifle in it :( )
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Postby ~ô¿ô~Nobody~ » Thu Mar 09, 06 12:19 am

~Wasted~ wrote:@Nobody

You freakishly log out when I log in :shock:


Ah well some internet problem probably.



lol at least i logout and do not pretend to be logged in :P
well but german connections sucks anyways
even the new 16mbs connections just have 600kbs upload :x :roll:
Nobody is perfect...
------------------------------
Longc[A]t wrote:I still think Dae is a russian spambot.

~[A]Daedalus~ wrote:There will be a day when my patience goes away and you, along with all who rant with you, will get banned.

ô¿ô¥[GODZ]¥NOCHANC wrote:I can ban any one I want ANY time I want. You have no rights here.
User avatar
~ô¿ô~Nobody~
Alpha
 
Posts: 2520
Joined: Fri Dec 31, 04 3:20 pm
Location: Proclarush Taonas

Postby Allan » Thu Mar 09, 06 12:53 am

Nobody's ISP: "Ya, ich bin <Head of ISP's name>, und ich habe ein scheisse Internet connexion mit <ISP Name>" :P Germans are funny, but cool :D
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Postby Alex » Thu Mar 09, 06 7:31 am

Allan wrote::P you think those are large, you see the mesh import file for DX! XD

(I only have the demo of UT-GOTY, doesnt have bio-rifle in it :( )

Allan, I deleted the import code from the weapons :) UT doesn't has 1 general import file, it has the import code in the weapon itself.
Alex
Alpha
 
Posts: 8067
Joined: Wed Nov 12, 03 4:51 pm

Postby Allan » Fri Mar 10, 06 12:33 am

:? Why...? what's the point in that... :P

Anyway, i'm still trying to syphon through this load, see if i can find what makes it do it's charge effect :? No luck though, and most of this stuff covered here(Fire anims, etc) seems to be in DeusExWeapon anyway..[/code]
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.


Return to Editing issues

Who is online

Users browsing this forum: No registered users and 49 guests