I don't need to test my programs. I have an error-correcting modem.

UE3:UTWeapon (UDK)

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

Contents

Package: 
UTGame
Direct subclasses:
UTBeamWeapon, UTVehicleWeapon, UTWeap_Physicsgun, UTWeap_RocketLauncher, UTWeap_ShockRifleBase
This class in other games:
UT3


Properties[edit]

Property group 'Animations'[edit]

ArmFireAnim[edit]

Type: array<name>


Default value, index 0: 'WeaponFire'

Default value, index 1: 'WeaponFire'

ArmIdleAnims[edit]

Type: array<name>


Default value: 'WeaponIdle'

ArmsAnimSet[edit]

Type: AnimSet


ArmsEquipAnim[edit]

Type: name


Default value: 'WeaponEquip'

ArmsPutDownAnim[edit]

Type: name


Default value: 'WeaponPutDown'

bUsesOffhand[edit]

Type: bool


WeaponEquipAnim[edit]

Type: name

Animation to play when the weapon is Equipped

Default value: 'WeaponEquip'

WeaponFireAnim[edit]

Type: array<name>

Animation to play when the weapon is fired

Default value, index 0: 'WeaponFire'

Default value, index 1: 'WeaponFire'

WeaponIdleAnims[edit]

Type: array<name>


Default value: 'WeaponIdle'

WeaponPutDownAnim[edit]

Type: name

Animation to play when the weapon is Put Down

Default value: 'WeaponPutDown'

Property group 'FirstPerson'[edit]

PlayerViewOffset[edit]

Type: Object.Vector

Offset from view center

SmallWeaponsOffset[edit]

Type: Object.Vector

additional offset applied when using small weapons

Default value:

Member Value
X 16.0
Y 6.0
Z -6.0

WideScreenOffsetScaling[edit]

Type: float

additional offset applied when using small weapons

Default value: 0.8

Property group 'Sounds'[edit]

WeaponEquipSnd[edit]

Type: SoundCue

Sound to play when the weapon is Equipped

WeaponFireSnd[edit]

Type: array<SoundCue>

Sound to play when the weapon is fired

WeaponPutDownSnd[edit]

Type: SoundCue

Sound to play when the weapon is Put Down

Property group 'UTWeapon'[edit]

BobDamping[edit]

Type: float

How much to damp view bob

Default value: 0.85

bTargetAdhesionEnabled[edit]

Type: bool

Modifiers: config


bTargetFrictionEnabled[edit]

Type: bool

Modifiers: config

Target friction enabled?

JumpDamping[edit]

Type: float

How much to damp jump and land bob

Default value: 1.0

MuzzleFlashDuration[edit]

Type: float

How long the Muzzle Flash should be there

Default value: 0.33

TargetAdhesionAimDistY[edit]

Type: float

Modifiers: config

Max distance from edge of cylinder for adhesion to be valid

Default value: 128.0

TargetAdhesionAimDistZ[edit]

Type: float

Modifiers: config


Default value: 96.0

TargetAdhesionDistanceMax[edit]

Type: float

Modifiers: config

Max distance to allow adhesion to still kick in

Default value: 2000.0

TargetAdhesionPlayerVelocityMin[edit]

Type: float

Modifiers: config

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

TargetAdhesionScaleAmountMin[edit]

Type: float

Modifiers: config

Min amount to scale for adhesive purposes

TargetAdhesionScaleRange[edit]

Type: Object.Vector2D

Modifiers: config

Min/Max amount to scale for adhesive purposes

Default value:

Member Value
X 0.3
Y 2.85

TargetAdhesionTargetVelocityMin[edit]

Type: float

Modifiers: config

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

TargetAdhesionTimeMax[edit]

Type: float

Modifiers: config

Max time to attempt adhesion to the friction target

TargetAdhesionZoomedBoostValue[edit]

Type: float

Modifiers: config

Boost the Target Adhesion by this much when zoomed in *

Default value: 0.25

TargetFrictionDistanceCurve[edit]

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[edit]

Type: float

Modifiers: config

Max distance allow for friction

Default value: 3000.0

TargetFrictionDistanceMin[edit]

Type: float

Modifiers: config

Min distance for friction

Default value: 320.0

TargetFrictionDistancePeak[edit]

Type: float

Modifiers: config

Peak distance for friction

Default value: 1500.0

TargetFrictionMultiplierRange[edit]

Type: Object.Vector2D

Modifiers: config

Min/Max friction multiplier applied when target acquired

Default value:

Member Value
X 0.3
Y 0.4

TargetFrictionOffset[edit]

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[edit]

Type: float

Modifiers: config


Default value: 0.2

TargetFrictionPeakRadiusScale[edit]

Type: float

Modifiers: config

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

Default value: 1.0

TargetFrictionZoomedBoostValue[edit]

Type: float

Modifiers: config

Boost the Target Friction by this much when zoomed in *

Default value: 0.25

ZoomedTurnSpeedScalePct[edit]

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[edit]

See UTWeapon internal variables.

Default values[edit]

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[edit]

FirstPersonMesh[edit]

Class: UTGame.UTSkeletalMeshComponent

Property Value
bAllowAmbientOcclusion False
bOnlyOwnerSee True
bOverrideAttachmentOwnerVisibility True
CastShadow False
DepthPriorityGroup SDPG_Foreground
ReplacementPrimitive None

PickupMesh[edit]

Class: Engine.SkeletalMeshComponent

Property Value
bAllowAmbientOcclusion False
bCastDynamicShadow False
bForceDirectLightMap True
bForceRefpose 1
bIgnoreControllersWhenNotRendered True
bUpdateSkelWhenNotRendered False
bUseAsOccluder False
CachedMaxDrawDistance 6000.0
CastShadow False
MaxDrawDistance 6000.0
ReplacementPrimitive None

Enums[edit]

AmmoWidgetDisplayStyle[edit]

EAWDS_Numeric 
EAWDS_BarGraph 
EAWDS_Both 
EAWDS_None 

EZoomState[edit]

Are we zoomed

ZST_NotZoomed 
ZST_ZoomingOut 
ZST_ZoomingIn 
ZST_Zoomed 

Functions[edit]

Static functions[edit]

BotDesireability[edit]

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[edit]

static function float DetourWeight (Pawn Other, float PathWeight)

Overrides: Inventory.DetourWeight


DrawKillIcon[edit]

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


Native functions[edit]

EnsureWeaponOverlayComponentLast[edit]

native function EnsureWeaponOverlayComponentLast ()


Events[edit]

CauseMuzzleFlash[edit]

simulated event CauseMuzzleFlash ()

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

CauseMuzzleFlashLight[edit]

simulated event CauseMuzzleFlashLight ()

Causes the muzzle flashlight to turn on

Destroyed[edit]

simulated event Destroyed ()

Overrides: Weapon.Destroyed

Event called when weapon actor is destroyed

GetPhysicalFireStartLoc[edit]

simulated event Object.Vector GetPhysicalFireStartLoc (optional Object.Vector AimDir)

Overrides: Weapon.GetPhysicalFireStartLoc

This function returns the world location for spawning the projectile, pulled in to the Pawn's collision along the AimDir direction.

GetPowerPerc[edit]

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[edit]

simulated event MuzzleFlashTimer ()

Turns the MuzzleFlashlight off

PostBeginPlay[edit]

simulated event PostBeginPlay ()

Overrides: Actor.PostBeginPlay

Initialize the weapon

ReplicatedEvent[edit]

simulated event ReplicatedEvent (name VarName)

Overrides: Actor.ReplicatedEvent


SetPosition[edit]

simulated event SetPosition (UTPawn Holder)

This function aligns the gun model in the world

StopMuzzleFlash[edit]

simulated event StopMuzzleFlash ()


Other instance functions[edit]

See UTWeapon instance functions.

States[edit]

Active[edit]

Inherits from: Weapon.Active

Modifiers: simulated

Active.BeginState[edit]

simulated event BeginState (name PreviousStateName)

Overrides: Weapon.Active.BeginState

Initialize the weapon as being active and ready to go.

Active.EndState[edit]

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[edit]

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[edit]

simulated function BeginFire (byte FireModeNum)

Overrides: Weapon.Active.BeginFire

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

Active.ChangeVisibility[edit]

simulated function ChangeVisibility (bool bIsVisible)

Overrides: ChangeVisibility (global)

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

Active.PlayWeaponAnimation[edit]

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[edit]

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[edit]

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[edit]

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[edit]

simulated event BeginState (name PreviousStateName)

Overrides: Weapon.Inactive.BeginState

Clear out the PendingFires

Inactive.EndState[edit]

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[edit]

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[edit]

Modifiers: simulated

WeaponAbortEquip.BeginState[edit]

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[edit]

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[edit]

simulated function WeaponEquipAborted ()


WeaponEquipping[edit]

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[edit]

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[edit]

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[edit]

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[edit]

Inherits from: Weapon.WeaponFiring

Modifiers: simulated

WeaponFiring.BeginState[edit]

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[edit]

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[edit]

simulated event ReplicatedEvent (name VarName)

Overrides: ReplicatedEvent (global)


WeaponFiring.BeginFire[edit]

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[edit]

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[edit]

Inherits from: Weapon.WeaponPuttingDown

Modifiers: simulated

WeaponPuttingDown.BeginState[edit]

simulated event BeginState (name PreviousStateName)

Overrides: Weapon.WeaponPuttingDown.BeginState

Time the process and clear the Firing flags

WeaponPuttingDown.EndState[edit]

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[edit]

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[edit]

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.