| Home Page | Recent Changes | Preferences

InstantFire

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

Properties

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

HunterKiller: I wish to know what is this...

Gerco: I think it's to indicate how much a player is "pushed back" when hit by this weapon, no idea about the units though, must be some unit of 'force'.

Languard: 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. Then again...that can be kinda fun ;).

MythOpus: Actually.... I had my weapon set to 10000 something like that and it shoots someone halfway across the map (Tested on Antalus) Are you sure you haven't added an extra 0 to your count ;)

Wormbo: Then your vector didn't have the length 1. Rockets use MomentumTransfer=50000 for example. MomentumTransfer for Projectile?s is the same as Momentum for InstantFire classes.

MythOpus: Oops. Yes your right... I forgot a few zeros :(

Foxpaw: What does that mean, use a normal vector, and not a directional vector? I don't see the difference. Plus, it's a float, not a vector?

Languard: 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 scaler.

DemonThing: A normal vector is one with a magnitude of 1.0 (that is, VSize(vector) = 1.0).

Tarquin: Yup. And it's "scalAr". This conversation needs cleaning up!

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.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 : Hunterkiller I'm not sure, is it really ???
    R = rotator(vector(Aim) + VRand()*FRand()*Spread) 
  • 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

Comments

HunterKiller: Ok, thats it for this one :)

Wormbo: Try sticking to the layout of other class pages like Material or HUD. You don't need to make an ASCII art subclasses tree if there aren't that many subclasses.

HunterKiller: Sure. I took a bad example :tup:

The Unreal Engine Documentation Site

Wiki Community

Topic Categories

Image Uploads

Random Page

Recent Changes

Offline Wiki

Unreal Engine

Console Commands

Terminology

Mapping Topics

Mapping Lessons

UnrealEd Interface

Questions&Answers

Scripting Topics

Scripting Lessons

Making Mods

Class Tree

Questions&Answers

Modeling Topics

Questions&Answers

Log In