Cogito, ergo sum

UE3:UTWeapon (UT3)

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
UT3 Object >> Actor >> Inventory >> Weapon >> GameWeapon >> UTWeapon

Contents

Package: 
UTGame
Direct subclasses:
UTWeap_InstagibRifle, UTWeap_Translocator, UTWeap_RocketLauncher, UTWeap_Physicsgun, UTWeap_Stinger, UTWeap_Redeemer, UTWeap_ShockRifle, UTBeamWeapon, UTDeployable, UTVehicleWeapon, UTWeap_Avril, UTWeap_BioRifle, UTWeap_BioRifle_Content, UTWeap_Enforcer, UTWeap_FlakCannon, UTWeap_ImpactHammer, UTWeap_SniperRifle
This class in other games:
UDK

Copyright 1998-2007 Epic Games, Inc. All Rights Reserved.

Properties

Property group 'Animations'

ArmFireAnim

Type: array<name>


Default value, index 0: 'WeaponFire'

Default value, index 1: 'WeaponFire'

ArmIdleAnims

Type: array<name>


Default value: 'WeaponIdle'

ArmsAnimSet

Type: AnimSet


ArmsEquipAnim

Type: name


Default value: 'WeaponEquip'

ArmsPutDownAnim

Type: name


Default value: 'WeaponPutDown'

bUsesOffhand

Type: bool


WeaponEquipAnim

Type: name

Animation to play when the weapon is Equipped

Default value: 'WeaponEquip'

WeaponFireAnim

Type: array<name>

Animation to play when the weapon is fired

Default value, index 0: 'WeaponFire'

Default value, index 1: 'WeaponFire'

WeaponIdleAnims

Type: array<name>


Default value: 'WeaponIdle'

WeaponPutDownAnim

Type: name

Animation to play when the weapon is Put Down

Default value: 'WeaponPutDown'

Property group 'FirstPerson'

PlayerViewOffset

Type: Object.Vector

Offset from view center

SmallWeaponsOffset

Type: Object.Vector

additional offset applied when using small weapons

Default value:

Member Value
X 16.0
Y 6.0
Z -6.0

WideScreenOffsetScaling

Type: float

additional offset applied when using small weapons

Default value: 0.8

Property group 'Sounds'

WeaponEquipSnd

Type: SoundCue

Sound to play when the weapon is Equipped

WeaponFireSnd

Type: array<SoundCue>

Sound to play when the weapon is fired

WeaponPutDownSnd

Type: SoundCue

Sound to play when the weapon is Put Down

Property group 'UTWeapon'

BobDamping

Type: float

How much to damp view bob

Default value: 0.85

bTargetAdhesionEnabled

Type: bool

Modifiers: config


bTargetFrictionEnabled

Type: bool

Modifiers: config

Target friction enabled?

JumpDamping

Type: float

How much to damp jump and land bob

Default value: 1.0

MuzzleFlashDuration

Type: float

How long the Muzzle Flash should be there

Default value: 0.33

TargetAdhesionAimDistY

Type: float

Modifiers: config

Max distance from edge of cylinder for adhesion to be valid

Default value: 128.0

TargetAdhesionAimDistZ

Type: float

Modifiers: config


Default value: 96.0

TargetAdhesionDistanceMax

Type: float

Modifiers: config

Max distance to allow adhesion to still kick in

Default value: 2000.0

TargetAdhesionPlayerVelocityMin

Type: float

Modifiers: config

Require the player to be moving for adhesion to kick in?

TargetAdhesionScaleAmountMin

Type: float

Modifiers: config

Min amount to scale for adhesive purposes

TargetAdhesionScaleRange

Type: Object.Vector2D

Modifiers: config

Min/Max amount to scale for adhesive purposes

Default value:

Member Value
X 0.3
Y 2.85

TargetAdhesionTargetVelocityMin

Type: float

Modifiers: config

Require the target to be moving for adhesion to kick in?

TargetAdhesionTimeMax

Type: float

Modifiers: config

Max time to attempt adhesion to the friction target

TargetAdhesionZoomedBoostValue

Type: float

Modifiers: config

Boost the Target Adhesion by this much when zoomed in *

Default value: 0.25

TargetFrictionDistanceCurve

Type: Object.InterpCurveFloat

Modifiers: config

Interp curve that allows for piece wise functions for the TargetFrictionDistance amount at different ranges *

Default value:

Member Value
Points
  1. No value definitions.
Member Value
InVal 320.0
Member Value
InVal 1500.0
OutVal 1.0
Member Value
InVal 3000.0
OutVal 0.3
Member Value
InVal 7000.0

TargetFrictionDistanceMax

Type: float

Modifiers: config

Max distance allow for friction

Default value: 3000.0

TargetFrictionDistanceMin

Type: float

Modifiers: config

Min distance for friction

Default value: 320.0

TargetFrictionDistancePeak

Type: float

Modifiers: config

Peak distance for friction

Default value: 1500.0

TargetFrictionMultiplierRange

Type: Object.Vector2D

Modifiers: config

Min/Max friction multiplier applied when target acquired

Default value:

Member Value
X 0.3
Y 0.4

TargetFrictionOffset

Type: Object.Vector

Modifiers: config

Offset to apply to friction target location (aim for the chest, etc)

Default value:

Member Value
X 0.0
Y 0.0
Z 32.0

TargetFrictionPeakHeightScale

Type: float

Modifiers: config


Default value: 0.2

TargetFrictionPeakRadiusScale

Type: float

Modifiers: config

Amount of additional radius/height given to target cylinder when at peak distance

Default value: 1.0

TargetFrictionZoomedBoostValue

Type: float

Modifiers: config

Boost the Target Friction by this much when zoomed in *

Default value: 0.25

ZoomedTurnSpeedScalePct

Type: float

Modifiers: config

When the weapon is zoomed in then the turn speed is reduced by this much *

Default value: 0.85

Internal variables

See UTWeapon internal variables.

Default values

Property Value
DefaultAnimSpeed 0.9
DroppedPickupClass Class'UTGame.UTDroppedPickup'
DroppedPickupMesh SkeletalMeshComponent'PickupMesh'
EquipTime 0.45
FireInterval[0] 1.0
FireInterval[1] 1.0
FiringStatesArray[0] 'WeaponFiring'
FiringStatesArray[1] 'WeaponFiring'
InstantHitDamageTypes[0] Class'Engine.DamageType'
InstantHitDamageTypes[1] Class'Engine.DamageType'
MaxDesireability 0.5
Mesh UTSkeletalMeshComponent'FirstPersonMesh'
MessageClass Class'UTGame.UTPickupMessage'
PickupFactoryMesh SkeletalMeshComponent'PickupMesh'
WeaponRange 22000.0

Subobjects

FirstPersonMesh

Class: UTGame.UTSkeletalMeshComponent

Property Value
bOnlyOwnerSee True
bOverrideAttachmentOwnerVisibility True
CastShadow False
DepthPriorityGroup SDPG_Foreground

PickupMesh

Class: Engine.SkeletalMeshComponent

Property Value
bCastDynamicShadow False
bForceDirectLightMap True
bForceRefpose 1
bIgnoreControllersWhenNotRendered True
bUpdateSkelWhenNotRendered False
bUseAsOccluder False
CachedCullDistance 6000.0
CastShadow False
CullDistance 6000.0

Enums

AmmoWidgetDisplayStyle

EAWDS_Numeric 
EAWDS_BarGraph 
EAWDS_Both 
EAWDS_None 

EZoomState

Are we zoomed

ZST_NotZoomed 
ZST_ZoomingOut 
ZST_ZoomingIn 
ZST_Zoomed 

Functions

Static functions

BotDesireability

static function float BotDesireability (Actor PickupHolder, Pawn P, Controller C)

Overrides: Inventory.BotDesireability

tell the bot how much it wants this weapon pickup called when the bot is trying to decide which inventory pickup to go after next

DetourWeight

static function float DetourWeight (Pawn Other, float PathWeight)

Overrides: Inventory.DetourWeight


DrawKillIcon

simulated static function DrawKillIcon (Canvas Canvas, float ScreenX, float ScreenY, float HUDScaleX, float HUDScaleY)


Native functions

EnsureWeaponOverlayComponentLast

native function EnsureWeaponOverlayComponentLast ()


Events

CauseMuzzleFlash

simulated event CauseMuzzleFlash ()

Causes the muzzle flash to turn on and setup a time to turn it back off again.

CauseMuzzleFlashLight

simulated event CauseMuzzleFlashLight ()

Causes the muzzle flashlight to turn on

Destroyed

simulated event Destroyed ()

Overrides: Weapon.Destroyed

Event called when weapon actor is destroyed

GetPowerPerc

simulated event float GetPowerPerc ()

This function is meant to be overridden in children. It turns the current power percentage for a weapon. It's called mostly from the hud

Returns:

the percentage of power ( 1.0 - 0.0 )

MuzzleFlashTimer

simulated event MuzzleFlashTimer ()

Turns the MuzzleFlashlight off

PostBeginPlay

simulated event PostBeginPlay ()

Overrides: Actor.PostBeginPlay

Initialize the weapon

ReplicatedEvent

simulated event ReplicatedEvent (name VarName)

Overrides: Actor.ReplicatedEvent


SetPosition

simulated event SetPosition (UTPawn Holder)

This function aligns the gun model in the world

StopMuzzleFlash

simulated event StopMuzzleFlash ()


Other instance functions

See UTWeapon instance functions.

States

Active

Inherits from: Weapon.Active

Modifiers: simulated

Active.BeginState

simulated event BeginState (name PreviousStateName)

Overrides: Weapon.Active.BeginState

Initialize the weapon as being active and ready to go.

Active.EndState

simulated event EndState (name NextStateName)

Overrides: Object.EndState (global)

Called immediately before going out of the current state, while within the GotoState() call that caused the state change, and before BeginState() is called within the new state.

Active.OnAnimEnd

simulated event OnAnimEnd (optional AnimNodeSequence SeqNode, optional float PlayedTime, optional float ExcessTime)

Overrides: Actor.OnAnimEnd (global)

(Description copied from Actor.OnAnimEnd)
Event called when an AnimNodeSequence (in the animation tree of one of this Actor's SkeletalMeshComponents) reaches the end and stops. Will not get called if bLooping is 'true' on the AnimNodeSequence. bCauseActorAnimEnd must be set 'true' on the AnimNodeSequence for this event to get generated.

Parameters:

  • SeqNode - Node that finished playing. You can get to the SkeletalMeshComponent by looking at SeqNode->SkelComponent
  • PlayedTime - Time played on this animation. (play rate independant).
  • ExcessTime - how much time overlapped beyond end of animation. (play rate independant).

Active.BeginFire

simulated function BeginFire (byte FireModeNum)

Overrides: Weapon.Active.BeginFire

We override BeginFire() so that we can check for zooming

Active.ChangeVisibility

simulated function ChangeVisibility (bool bIsVisible)

Overrides: ChangeVisibility (global)

This function is called from the pawn when the visibility of the weapon changes

Active.PlayWeaponAnimation

simulated function PlayWeaponAnimation (name Sequence, float fDesiredDuration, optional bool bLoop, optional SkeletalMeshComponent SkelMesh)

Overrides: PlayWeaponAnimation (global)

(Description copied from Weapon.PlayWeaponAnimation)
Play an animation on the weapon mesh Network: Local Player and clients

Parameters:

  • Anim - Sequence to play on weapon skeletal mesh
  • desired - duration, in seconds, animation should be played

Active.ServerStartFire

reliable server function ServerStartFire (byte FireModeNum)

Overrides: ServerStartFire (global)

When StartFire() is called on a client, it replicates the start by calling ServerStartFire. This begins the event on server. Server side actors (such as bots) should not call ServerStartFire directly and should instead call StartFire().

Network: Dedicated Server only, or Listen Server for remote clients.

Active.ShouldLagRot

simulated function bool ShouldLagRot ()

Overrides: ShouldLagRot (global)

(Description copied from UTWeapon.ShouldLagRot)


Returns:

whether the weapon's rotation is allowed to lag behind the holder's rotation

Inactive

state Inactive This state is the default state. It needs to make sure Zooming is reset when entering/leaving

Inherits from: Weapon.Inactive

Modifiers: auto, simulated

Inactive.BeginState

simulated event BeginState (name PreviousStateName)

Overrides: Weapon.Inactive.BeginState

Clear out the PendingFires

Inactive.EndState

simulated event EndState (name NextStateName)

Overrides: Object.EndState (global)

Called immediately before going out of the current state, while within the GotoState() call that caused the state change, and before BeginState() is called within the new state.

Inactive.bReadyToFire

simulated function bool bReadyToFire ()

Overrides: bReadyToFire (global)

Returns:

false if the weapon isn't ready to be fired. For example, if it's in the Inactive/WeaponPuttingDown states.

WeaponAbortEquip

Modifiers: simulated

WeaponAbortEquip.BeginState

simulated event BeginState (name PrevStateName)

Overrides: Object.BeginState (global)

Called immediately when entering a state, while within the GotoState() call that caused the state change (before any state code is executed).

WeaponAbortEquip.EndState

simulated event EndState (name NextStateName)

Overrides: Object.EndState (global)

Called immediately before going out of the current state, while within the GotoState() call that caused the state change, and before BeginState() is called within the new state.

WeaponAbortEquip.WeaponEquipAborted

simulated function WeaponEquipAborted ()


WeaponEquipping

State WeaponEquipping The Weapon is in this state while transitioning from Inactive to Active state. Typically, the weapon will remain in this state while its selection animation is being played. While in this state, the weapon cannot be fired.

Inherits from: Weapon.WeaponEquipping

Modifiers: simulated

WeaponEquipping.BeginState

simulated event BeginState (name PreviousStateName)

Overrides: Weapon.WeaponEquipping.BeginState

We want to being this state by setting up the timing and then notifying the pawn that the weapon has changed.

WeaponEquipping.EndState

simulated event EndState (name NextStateName)

Overrides: Weapon.WeaponEquipping.EndState

Called immediately before going out of the current state, while within the GotoState() call that caused the state change, and before BeginState() is called within the new state.

WeaponEquipping.TryPutDown

simulated function bool TryPutDown ()

Overrides: TryPutDown (global)

When attempting to put the weapon down, look to see if our MinReloadPct has been met. If so just put it down

WeaponFiring

Inherits from: Weapon.WeaponFiring

Modifiers: simulated

WeaponFiring.BeginState

simulated event BeginState (name PrevStateName)

Overrides: Weapon.WeaponFiring.BeginState

Called immediately when entering a state, while within the GotoState() call that caused the state change (before any state code is executed).

WeaponFiring.EndState

simulated event EndState (name NextStateName)

Overrides: Weapon.WeaponFiring.EndState

Called immediately before going out of the current state, while within the GotoState() call that caused the state change, and before BeginState() is called within the new state.

WeaponFiring.ReplicatedEvent

simulated event ReplicatedEvent (name VarName)

Overrides: ReplicatedEvent (global)


WeaponFiring.BeginFire

simulated function BeginFire (byte FireModeNum)

Overrides: Weapon.BeginFire (global)

We override BeginFire() so that we can check for zooming and/or empty weapons

WeaponFiring.DenyClientWeaponSet

simulated function bool DenyClientWeaponSet ()

Overrides: Weapon.DenyClientWeaponSet (global)

When we are in the firing state, don't allow for a pickup to switch the weapon

WeaponPuttingDown

Inherits from: Weapon.WeaponPuttingDown

Modifiers: simulated

WeaponPuttingDown.BeginState

simulated event BeginState (name PreviousStateName)

Overrides: Weapon.WeaponPuttingDown.BeginState

Time the process and clear the Firing flags

WeaponPuttingDown.EndState

simulated event EndState (name NextStateName)

Overrides: Weapon.WeaponPuttingDown.EndState

Called immediately before going out of the current state, while within the GotoState() call that caused the state change, and before BeginState() is called within the new state.

WeaponPuttingDown.Activate

simulated function Activate ()

Overrides: Activate (global)

All inventory use the Activate() function when an item is selected for use. For weapons, this function starts the Equipping process. If the weapon is the inactive state, it will go to the 'WeaponEquipping' followed by 'Active' state, and ready to be fired.

WeaponPuttingDown.bReadyToFire

simulated function bool bReadyToFire ()

Overrides: bReadyToFire (global)

Returns:

false if the weapon isn't ready to be fired. For example, if it's in the Inactive/WeaponPuttingDown states.