UE2:U2Weapon (U2XMP)

From Unreal Wiki, The Unreal Engine Documentation Site
U2XMP Object >> Actor >> Inventory >> Weapon >> U2Weapon
Package:
U2
Direct subclasses:
WeaponInvEnergyRifle, U2XMPItem, WeaponInvAssaultRifle, WeaponInvDispersion, WeaponInvFlameThrower, WeaponInvGrenadeLauncher, WeaponInvLaserRifle, WeaponInvLeechGun, WeaponInvPistol, WeaponInvRocketLauncher, WeaponInvShotgun, WeaponInvSingularityCannon, WeaponInvSniperRifle, WeaponInvTakkra, WeaponTurretMounted

U2Weapon.uc Created By: Mike Lambert Created On: 6/14/01 $Author: Mfox $ $Date: 1/29/03 1:50p $ $Revision: 157 $

Constants

MaxRapidFireRate

Value: 0.50

firing rates <= this are considered rapid fire

MinSlowFireRate

Value: 0.51


RatingFireNow

Value: 100.000

weapon wants Pawn to fire it immediately (i.e. even if no target)

RatingHighest

Value: 90.000

weapon thinks it would be highly effective if used now

RatingDefault

Value: 0.000

default

RatingLow

Value: -5.000

weapon is a poor choice but could be used if nothing better

RatingIneffective

Value: -10.000

weapon will have no effect on target in current situation

RatingDangerous

Value: -20.000

using weapon now will likely hurt/kill owner

RatingNoAmmo

Value: -30.000

not enough ammo to fire/altfire

RatingCantFire

Value: -40.000

can't actually fire weapon currently (not ready etc.)

RatingDisabled

Value: -50.000

weapon is disabled (alt and primary fire)

RatingNone

Value: -99.999

no rating (e.g. no weapon)

RangeUnlimited

Value: 32767.0


Properties

Property group 'Firing'

AltFireLastDownTime

Type: float


Default value: 1.0

AltFireLastReloadTime

Type: float


Default value: 1.0

AltFireTime

Type: float


Default value: 0.5

DownTime

Type: float


Default value: 0.533

FireLastDownTime

Type: float


Default value: 1.0

FireLastReloadTime

Type: float


Default value: 1.0

FireTime

Type: float


Default value: 0.5

ReloadTime

Type: float


Default value: 0.5

ReloadUnloadedTime

Type: float


SelectTime

Type: float


Default value: 0.6

Property group 'U2Weapon'

See U2Weapon property group U2Weapon.

Property group 'WeaponShake'

AltShakeMag

Type: float


Default value: 5.0

AltShakeTime

Type: float


Default value: 0.2

Internal variables

AltProjectileSpeed

Type: float

used for aiming particle-based "projectile" weapons

bAdjustWeaponPitchYaw

Type: bool


bAdjustWeaponRoll

Type: bool


bAdjustWeaponXY

Type: bool


bAdjustWeaponZ

Type: bool


bAltFiring

Type: bool


bCrosshairGlows

Type: bool

crosshair should glow when it is over a targetable actor

bDisableFiring

Type: bool


bDisableTick

Type: bool

performance testing: disable weapon tick overhead temporarily

bFiring

Type: bool

firing state (used to differentiate Fire()/AltFire() handling)

bGlowing

Type: bool

whether the crosshair is currently glowing

bLastRound

Type: bool


bLockLocation

Type: bool


Crosshair

Type: Object.ComponentHandle


fAdjustWeaponRate

Type: float


Default value: 0.4

FireSkinTime

Type: float

Time we set the fireskin, so we can turn it off in the next tick (using a timer caused it to be turned off before we even saw it ;)

Default value: 1.0E9

FirstPersonMesh

Type: Mesh


GlowingAttitude

Type: Controller.EAttitude

attitude towards targetable actor (enemy/neutral/friend)

LastFullUpdateTime

Type: float


LastTriggeredAnim

Type: name


LastWaterRingTime

Type: float


LocationOffset

Type: Object.Vector


MagicKey

Type: int


ProjectileFireStartLocation

Type: Object.Vector


ProjectileSpeed

Type: float


RotationOffset

Type: Object.Rotator


TraceFireStartLocation

Type: Object.Vector


U2PCOwner

Type: U2PlayerController

set in XXXBeginPlay to avoid need to cast owner all over the place

UpdateRangeAmmoType

Type: Ammunition

for weapons using tossed projectiles (in case ammo type can vary)

UpdateRangeGravityZ

Type: float

for weapons using tossed projectiles, last Z gravity used to update ranges

UseGlowingCrosshairs

Type: bool

Modifiers: config

Allow user to disable for performance.

Default value: True

Default values

Property Value
ActorFOV 60.0
AIRating -99.999
AlignMeshTraceOffset1
Member Value
X 10.0
Y -5.0
Z -12.0
AlignMeshTraceOffset2
Member Value
X 10.0
Y 5.0
Z -12.0
AlignMeshTraceOffset3
Member Value
X -12.0
Z -12.0
bAutoEnableAgent True
bBounce True
bNoSmooth False
CollisionHeight 0.0
CollisionRadius 0.0
ShakeMag 5.0
ShakeTime 0.2
SoundRadius 800.0
TransientSoundRadius 800.0

Structs

DecoEffect

Modifiers: native

name AnimSequence
name of the associated animation that this effect should be triggered on
class<Actor> DecoClass
name of the class to spawn
ParticleGenerator Particles
name of the package.object to load the particle system from (optional)
string MountNode
name of the bone to attach to (can be left blank for attaching relative to the weapon's origin)
Object.Vector MountOffset
translation offset from mount location
Object.Rotator MountRot
rotation offset from mount orientation
Object.Vector ThirdPersonOffset
translation offset from weapon hand location in 3rd person (since those use staticmeshes, not golem meshes)
bool GameplayRelevant
effect has an effect on gameplay, such as damaging particles (will be placed at head offset)
bool bTriggerUpdateOnly
only update location when triggered (for effects that need to be left behind)
bool bWorldFOV
draw in world fov (as opposed to weapon fov)
bool bRequiresWorldZBuffer
if false and in a 1st-person weapon, draws after the z-buffer has been cleared and the weapon has been drawn. otherwise, draws into the world zbuffer
bool AutoAim
aim particle as though it was a projectile spawned via ProjectileFire.
int AIAim
if set, auto-aim effect for NPCs (value should be set to the speed of the projectile we're aiming -- for leading).
float PushBack
push the effect back up to this number of units if we're too close to anything (not evaluated for TriggerUpdateOnly effects).
Actor Effect
instance of above described effect

Functions

Static functions

AddAmmo

static function bool AddAmmo (Pawn Other, string AmmoClassString, int AddAmmoAmount, optional bool bMaximizeClipAmount)


Exec functions

AdjustWeaponLog

exec function AdjustWeaponLog ()


AdjustWeaponPitchYaw

exec function AdjustWeaponPitchYaw ()


AdjustWeaponRate

exec function AdjustWeaponRate (float f)


AdjustWeaponRoll

exec function AdjustWeaponRoll ()


AdjustWeaponXY

exec function AdjustWeaponXY ()


AdjustWeaponZ

exec function AdjustWeaponZ ()


StopAdjust

exec function StopAdjust ()


Events

AnimEnd

simulated event AnimEnd (int Channel)

Overrides: Actor.AnimEnd


Destroyed

simulated event Destroyed ()

Overrides: Weapon.Destroyed


PostBeginPlay

simulated event PostBeginPlay ()

Overrides: Weapon.PostBeginPlay


RenderOverlays

simulated event RenderOverlays (Canvas Canvas)

Overrides: Inventory.RenderOverlays


Other instance functions

See U2Weapon instance functions.

States

Active

Inherits from: Weapon.Active

Modifiers: simulated

Ignores: AltFire, Fire

Active.AnimEnd

simulated event AnimEnd (int Channel)

Overrides: AnimEnd (global)


Active.BeginState

simulated event BeginState ()

Overrides: Weapon.Active.BeginState


Active.EndState

simulated event EndState ()

Overrides: Weapon.Active.EndState


Active.PutDown

simulated function bool PutDown ()

Overrides: Weapon.Active.PutDown


AltFiring

Modifiers: simulated

Ignores: AltFire, Fire

AltFiring.BeginState

simulated event BeginState ()

Overrides: Object.BeginState (global)


AltFiring.EndState

simulated event EndState ()

Overrides: Object.EndState (global)


AltFiring.Reload

simulated function Reload ()

Overrides: Reload (global)


DownWeapon

Inherits from: Weapon.DownWeapon

Modifiers: simulated

Ignores: AltFire, Fire

DownWeapon.AnimEnd

simulated event AnimEnd (int Channel)

Overrides: AnimEnd (global)


DownWeapon.BeginState

simulated event BeginState ()

Overrides: Weapon.DownWeapon.BeginState


DownWeapon.EndState

simulated event EndState ()

Overrides: Object.EndState (global)


DownWeapon.CanFire

function bool CanFire ()

Overrides: Weapon.CanFire (global)


DownWeapon.PutDown

simulated function bool PutDown ()

Overrides: Weapon.DownWeapon.PutDown


Firing

Modifiers: simulated

Ignores: AltFire, Fire

Firing.BeginState

simulated event BeginState ()

Overrides: Object.BeginState (global)


Firing.EndState

simulated event EndState ()

Overrides: Object.EndState (global)


Firing.Reload

simulated function Reload ()

Overrides: Reload (global)


Idle

Modifiers: simulated

Idle.AnimEnd

simulated event AnimEnd (int Channel)

Overrides: AnimEnd (global)


Idle.PutDown

simulated function bool PutDown ()

Overrides: Weapon.PutDown (global)


Reloading

Modifiers: simulated

Ignores: AltFire, Fire, Reload

Reloading.BeginState

simulated event BeginState ()

Overrides: Object.BeginState (global)


Reloading.EndState

simulated event EndState ()

Overrides: Object.EndState (global)


Reloading.CanFire

function bool CanFire ()

Overrides: Weapon.CanFire (global)