The three virtues of a programmer: Laziness, Impatience, and Hubris. – Larry Wall

UE2:Weapon (U2)

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
U2 Object >> Actor >> Inventory >> Weapon
Package: 
Engine
Direct subclasses:
Flamethrower, GrenadeLauncher, AssaultRifle, DeployableInventory, EnergyRifle, Pistol, RocketLauncher, Shotgun, SniperRifle, TurretWeapon
Known custom subclass:
ReloadableWeaponBase
This class in other games:
RTNP, U1, UT, UE2Runtime, U2XMP, UT2004, UT2003, UT3, UDK

Parent class of all weapons. FIXME - should bReplicateInstigator be true???

Constants

NUM_AMMO_TYPES

Value: 2


Properties

Property group 'Firing'

DownTime

Type: float


Default value: 0.533

DownUnloadedTime

Type: float


Default value: 0.533

ReloadTime

Type: float


Default value: 0.5

ReloadUnloadedTime

Type: float


Default value: 0.25

SelectTime

Type: float


Default value: 0.6

SelectUnloadedTime

Type: float


Default value: 0.6

Property group 'Weapon'

BloodEffect

Type: class<Actor>

Array size: 2 (NUM_AMMO_TYPES)


DirtEffect

Type: class<Actor>

Array size: 2 (NUM_AMMO_TYPES)


FireSkins

Type: array<Material>

The skin to show when we just fired, and want to make the gun appear brighter from the flash

FireSkinsTP

Type: array<Material>

The skin to show when we just fired, and want to make the gun appear brighter from the flash (thirdperson)

MessageNoAmmo

Type: string

Modifiers: localized


Default value: " has no ammo."

ReloadSound

Type: Sound


ReloadUnloadedSound

Type: Sound


SelectSound

Type: Sound


SparkEffect

Type: class<Actor>

Array size: 2 (NUM_AMMO_TYPES)


TargetableTypes

Type: array<name>

Types of classes we can target (for crosshair glows).

Default value: 'Pawn'

Internal variables

See Weapon internal variables.

Default values

Property Value
AttachmentClass Class'Engine.WeaponAttachment'
bReplicateInstigator True
DrawType DT_Mesh
Icon Texture'Engine.S_Weapon'
InventoryGroup 1
ItemName "Weapon"
PlayerViewOffset
Member Value
X 30.0
Z -5.0
TransientSoundRadius 120.0

Structs

TAmmoFlags

Modifiers: native

bool bAmbientFireSound 
bool bRecommendSplashDamage 
bool bWarnTarget 
bool bTossed 
bool bTrySplash 
bool bLeadTarget 
bool bInstantHit 
bool bSplashDamage 
bool bRepeatFire 
automatic refire support
bool bRapidFire 
used by pawn animations in determining firing animation, and for net replication (set for high rate of fire weapons)

Functions

Static functions

IsValidDefaultInventory

static function bool IsValidDefaultInventory (Pawn PlayerPawn)


Events

Destroyed

event Destroyed ()

Overrides: Inventory.Destroyed


PostNetBeginPlay

simulated event PostNetBeginPlay ()

Overrides: Actor.PostNetBeginPlay


PreBeginPlay

simulated event PreBeginPlay ()

Overrides: Actor.PreBeginPlay


RenderOverlays

simulated event RenderOverlays (Canvas Canvas)

Overrides: Inventory.RenderOverlays


Other instance functions

See Weapon instance functions.

States

Active

Modifiers: simulated

Ignores: AltFire, Fire

Active.BeginState

simulated event BeginState ()

Overrides: Object.BeginState (global)


Active.EndState

simulated event EndState ()

Overrides: Object.EndState (global)


Active.PutDown

simulated function bool PutDown ()

Overrides: PutDown (global)


DownWeapon

Modifiers: simulated

Ignores: AltFire, Fire

DownWeapon.BeginState

simulated event BeginState ()

Overrides: Object.BeginState (global)


DownWeapon.PutDown

simulated function bool PutDown ()

Overrides: PutDown (global)


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.PutDown

simulated function bool PutDown ()

Overrides: PutDown (global)


PendingClientWeaponSet

PendingClientWeaponSet.BeginState

simulated event BeginState ()

Overrides: Object.BeginState (global)


PendingClientWeaponSet.EndState

simulated event EndState ()

Overrides: Object.EndState (global)


PendingClientWeaponSet.Timer

simulated event Timer ()

Overrides: Actor.Timer (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 ()


Reloading.PutDown

simulated function bool PutDown ()

Overrides: PutDown (global)


Reloading.ServerFire

function ServerFire (optional bool bAltFire)

Overrides: ServerFire (global)