Legacy:InstantFire - Unreal Wiki

# Legacy:InstantFire

### From Unreal Wiki, The Unreal Engine Documentation Site

UT2003 :: Actor >> WeaponFire (UT2003) >> InstantFire (Package: xWeapons)
UT2004 :: Object >> WeaponFire >> InstantFire (Package: xWeapons)

## Properties

int DamageMax
int DamageMin
class<DamageType> DamageType
  The class of the damage type
float Momentum

Momentum is a scaler that is applied to a vector. It represents the force in which a strike hits. Anything less than 50000 probably won't be very noticable unless you're playing in low gravity. Warning: Always make sure you use a normal vector, not a directional vector. You use a directional vector and the person will get killed from the force of impact from smashing into a wall.

Remember :MomentumTransfer for Projectiles is the same as Momentum for InstantFire classes.

A normal vector has the value range of -1.0 to 1.0. A directional vector is relative to the origin of the world, and can easily have a range of +- 1000 or greater. And yes, the Momentum variable is a float, but if you look at the TakeDamage function, the paramener that the X*Momentum feeds is a vector, not a float. Momentum is used as a scalAr.A normal vector is one with a magnitude of 1.0 (that is, VSize(vector) = 1.0)

float TraceRange
  The weapon maximum range

## Methods

float MaxRange ( )
  Returns the weapon range stored in TraceRange;

DoFireEffect( )
  This function:

  - Makes your pawn do some noise;
  - Set the start of the hit trace right in front of the eye;
  - Calls WeaponFire (UT2003).AdjustAim, that calls a native function to adjust aim (maybe it helps your aiming, if auto aim is on)
  - Add Some random error to aim

  - Calls DoTrace, passing the start of the hit trace and the rotation desired

DoTrace (Vector Start, Rotator Dir)
  This function tells where we hit, applyes damage and calls the creation of the visual effects for our shot:

  - This is a reflective weapon, so we will be on a reflection loop until we hit something not reflective or have reflected 3 times;
  - Defines the max range of our trace with:

        End = Start + TraceRange * X;

  - Other is where we hit; The trace returns the HitLocation and the HitNormal vectors, used for spawning the effects in the hit place:

        Other = Trace(HitLocation, HitNormal, End, Start, true);

  - Now, do some reflection tests. If we hit in something that should be hurt, apply the damage with:

        Other.TakeDamage(Damage, Instigator, HitLocation, Momentum*X, DamageType);

  - Call SpawnBeamEffect, to create the visual effects for this shot.

## Known Subclasses

- AssaultFire
- MinigunFire
  - MinigunAltFire
- ShockBeamFire
  - SuperShockBeamFire
- SniperFire

## Comments

Category:Legacy Class (UT2003)
Category:Legacy Class (UT2004)
Category:Legacy To Do - fill in subclass tree up to UT2004, class looks the same as ut2003 version.

Categories: Legacy Class (UT2003) | Legacy Class (UT2004) | Legacy To Do

##### Views

- Legacy
- Discussion
- Current revision

##### Search