UE3:UTWeap_Enforcer (UT3)

From Unreal Wiki, The Unreal Engine Documentation Site
UT3 Object >> Actor >> Inventory >> Weapon >> GameWeapon >> UTWeapon >> UTWeap_Enforcer
Package:
UTGame

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

Properties

Property group 'UTWeap_Enforcer'

AkimboTime

Type: float

How long transition to akimbo takes

Default value: 0.35

LeftMesh

Type: UTSkeletalMeshComponent

Modifiers: editinline

The Left Handed Mesh

Internal variables

ArmBurstFireAnimName

Type: name


Default value: 'weaponfireburst'

ArmDualEquipAnim

Type: name


Default value: 'WeaponEquiplFancy'

ArmReloadAnim

Type: name


Default value: 'WeaponEquipFirst'

bAkimbo

Type: bool

Whether we are currently holding weapons to the side.

bForceReturnToActive

Type: bool

If we become a dual while firing, force return to the active state in order to properly re-initialize

bFullDualCoolDown

Type: bool


bLastFiredLeft

Type: bool

if the last shot was fired from the left enforcer

bLoaded

Type: bool

If true this weapon won't play the reload anim

BurstCnt

Type: int

How many shots have been fired in burst

BurstCoolDownTime

Type: float

How long to cool down

Default value: 0.97

BurstFireAnimName

Type: name

Name of the animation when bursting

Default value: 'weaponfireburst'

BurstMax

Type: int

How many shots max in burst before going to cool down

Default value: 3

DualEnforcerDamageType

Type: class<UTDamageType>

Damage type used with dual enforcers (for unique kill message)

Default value: Class'UTGame.UTDmgType_DualEnforcer'

DualEquiptime

Type: float

Amount of time it takes to equip the left gun

Default value: 1.0

DualIconCoordinates

Type: UIRoot.TextureCoordinates


Default value:

Member Value
U 600.0
UL 126.0
V 515.0
VL 75.0

DualMode

Type: EDualMode

Modifiers: repnotify

if true, we are a dual enforcer

EnforcerMuzzleFlashLight

Type: UTExplosionLight

Array size: 2

dynamic light

EnforcerMuzzleFlashPSC

Type: UTParticleSystemComponent

Array size: 2

Muzzle flash PSC and Templates

LastAkimboTransitionTime

Type: float

Time that last akimbo transition occured.

LastFireTime

Type: float

timeseconds when last fired

LastFiringState

Type: name

Holds the name of the last firing state. Used by reload to know where to go

LeftArmAnimSet

Type: AnimSet


Default value: AnimSet'WP_Enforcers.Anims.K_WP_Enforcers_1P_Arms'

LeftIdleAnim

Type: name

anim played for left mesh when idling

Default value: 'WeaponIdleB'

LeftWeaponMaterialInstance

Type: MaterialInstanceConstant


OverlayLeftMesh

Type: UTSkeletalMeshComponent

Modifiers: protected


ReloadTime

Type: float

Amount of time for the reload anim

Default value: 2.0

ShotCount

Type: int

Used internally to track which gun to fire

WeaponDualEqipAnim

Type: name


Default value: 'WeaponEquiplFancy'

WeaponMaterialInstance

Type: MaterialInstanceConstant


WeaponReloadAnim

Type: name

Name of the animation to play when reloading

Default value: 'weaponequipempty'

WeaponReloadSnd

Type: SoundCue

sound played when reloading

Default values

Property Value
AimError 600.0
AimingHelpRadius[1] 12.0
AIRating 0.4
AmmoCount 50
ArmsAnimSet AnimSet'WP_Enforcers.Anims.K_WP_Enforcers_1P_Arms'
AttachmentClass Class'UTGame.UTAttachment_Enforcer'
bFastRepeater True
bInstantHit True
bTargetAdhesionEnabled True
bTargetFrictionEnabled True
CrossHairCoordinates
Member Value
U 128.0
V 0.0
CurrentRating 0.4
DroppedPickupOffsetZ 12.0
EquipTime 0.2
FireInterval[0] 0.36
FireInterval[1] 0.12
FiringStatesArray[1] 'WeaponBursting'
GroupWeight 0.5
IconHeight 39
IconWidth 43
IconX 335
IconY 81
InstantHitDamage[0] 20.0
InstantHitDamage[1] 20.0
InstantHitDamageTypes[0] Class'UTGame.UTDmgType_Enforcer'
InstantHitDamageTypes[1] Class'UTGame.UTDmgType_Enforcer'
InstantHitMomentum[0] 1000.0
InstantHitMomentum[1] 1000.0
InventoryGroup 2
ItemName "Enforcer"
JumpDamping 1.5
LockerAmmoCount 50
MaxAmmoCount 100
MaxDesireability 0.4
MuzzleFlashLightClass Class'UTGame.UTEnforcerMuzzleFlashLight'
MuzzleFlashPSCTemplate ParticleSystem'WP_Enforcers.Effects.P_WP_Enforcers_MuzzleFlash'
PickupMessage "Enforcer"
PickupSound SoundCue'A_Pickups.Weapons.Cue.A_Pickup_Weapons_Enforcer_Cue'
PivotTranslation
Member Value
X 0.0
Y -10.0
Z 0.0
Priority 2.0
PutDownTime 0.2
QuickPickGroup 3
QuickPickWeight 0.2
SmallWeaponsOffset
Member Value
X 18.0
Y 6.0
Z -6.0
Spread[1] 0.03
WeaponEquipSnd SoundCue'A_Weapon_Enforcer.Cue.A_Weapon_Enforcer_Raise_Cue'
WeaponFireSnd[0] SoundCue'A_Weapon_Enforcer.Cue.A_Weapon_Enforcer_Fire_Cue'
WeaponFireSnd[1] SoundCue'A_Weapon_Enforcer.Cue.A_Weapon_Enforcer_Fire_Cue'
WeaponFireWaveForm ForceFeedbackWaveform'UTGame.Default__UTWeap_Enforcer:ForceFeedbackWaveformShooting1'
WeaponPutDownSnd SoundCue'A_Weapon_Enforcer.Cue.A_Weapon_Enforcer_Lower_Cue'

Subobjects

FirstPersonMesh

Class: UTGame.UTSkeletalMeshComponent

Inherits from: UTWeapon.FirstPersonMesh

Property Value
Animations AnimNodeSequence'UTGame.Default__UTWeap_Enforcer:MeshSequenceA'
AnimSets[0] AnimSet'WP_Enforcers.Anims.K_WP_Enforcers_1P_Base'
bForceUpdateAttachmentsInTick True
FOV 55.0
Materials[0] Material'WP_Enforcers.Materials.M_WP_Enforcers_01'
SkeletalMesh SkeletalMesh'WP_Enforcers.Mesh.SK_WP_Enforcers_1P'

PickupMesh

Class: Engine.SkeletalMeshComponent

Inherits from: UTWeapon.PickupMesh

Property Value
SkeletalMesh SkeletalMesh'WP_Enforcers.Mesh.SK_WP_Enforcer_3P_Mid'

Enums

EDualMode

EDM_SingleWeapon
EDM_DualEquipping
EDM_Dual
EDM_Max

Functions

Events

CauseMuzzleFlash

simulated event CauseMuzzleFlash ()

Overrides: UTWeapon.CauseMuzzleFlash

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

CauseMuzzleFlashLight

simulated event CauseMuzzleFlashLight ()

Overrides: UTWeapon.CauseMuzzleFlashLight

Causes the muzzle flashlight to turn on

MuzzleFlashOff

simulated event MuzzleFlashOff (int Index)

Turns the MuzzleFlashlight off

MuzzleFlashTimerLeft

simulated event MuzzleFlashTimerLeft ()


MuzzleFlashTimerRight

simulated event MuzzleFlashTimerRight ()


ReplicatedEvent

simulated event ReplicatedEvent (name VarName)

Overrides: UTWeapon.ReplicatedEvent

On a remote client, watch for a change in bDualMode and if it changes, signal this has become a dual weapon.

SetPosition

simulated event SetPosition (UTPawn Holder)

Overrides: UTWeapon.SetPosition

This function aligns the gun model in the world

StopMuzzleFlash

simulated event StopMuzzleFlash ()

Overrides: UTWeapon.StopMuzzleFlash


Other instance functions

AddSpread

simulated function Object.Rotator AddSpread (Object.Rotator BaseAim)

Overrides: Weapon.AddSpread

Adds any fire spread offset to the passed in rotator

Parameters:

  • BaseAim - the base aim direction

Returns:

the adjusted aim direction

AdjustWeaponTimingForConsole

simulated function AdjustWeaponTimingForConsole ()

Overrides: UTWeapon.AdjustWeaponTimingForConsole

Adjust weapon equip and fire timings so they match between PC and console This is important so the sounds match up.

AkimboCheck

simulated function AkimboCheck ()

Function that determines whether or not to hold guns sideways.

AkimboDelay

simulated function AkimboDelay ()

Used to delay starting the check for Akimbo mode.

AttachMuzzleFlash

simulated function AttachMuzzleFlash ()

Overrides: UTWeapon.AttachMuzzleFlash

Extend support to allow for multiple muzzle flashes

AttachWeaponTo

simulated function AttachWeaponTo (SkeletalMeshComponent MeshCpnt, optional name SocketName)

Overrides: UTWeapon.AttachWeaponTo

(Description copied from UTWeapon.AttachWeaponTo)
Attach Weapon Mesh, Weapon MuzzleFlash and Muzzle Flash Dynamic Light to a SkeletalMesh

Parameters:

  • who - is the pawn to attach to

BecomeDual

simulated function BecomeDual ()

Become a dual firing weapon. Right now this isn't important unless the instigator is the local client. If it is, then show the second mesh and play any needed "Equipping" animations

BestMode

function byte BestMode ()

Overrides: UTWeapon.BestMode

BestMode() choose between regular or alt-fire

ChangeVisibility

simulated function ChangeVisibility (bool bIsVisible)

Overrides: UTWeapon.ChangeVisibility

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

CreateOverlayMesh

simulated function CreateOverlayMesh ()

Overrides: UTWeapon.CreateOverlayMesh


DelayedBecomeDual

function DelayedBecomeDual ()

Delay becoming dual if currently bringing up enforcer (for animation reasons)

DenyPickupQuery

function bool DenyPickupQuery (class<InventoryItemClass, Actor Pickup)

Overrides: UTWeapon.DenyPickupQuery

Detect that we are trying to pickup another enforcer and switch in to dual mode.

DetachMuzzleFlash

simulated function DetachMuzzleFlash ()

Overrides: UTWeapon.DetachMuzzleFlash

Detach weapon from skeletal mesh

Parameters:

  • SkeletalMeshComponent - weapon is attached to.

DetachWeapon

simulated function DetachWeapon ()

Overrides: UTWeapon.DetachWeapon

(Description copied from UTWeapon.DetachWeapon)
Detach weapon from skeletal mesh

Parameters:

  • SkeletalMeshComponent - weapon is attached to.

DualEquipDone

simulated function DualEquipDone ()

The equip animation is done, notify the weapon and become usuable

FullyCooled

simulated function FullyCooled ()


GetEffectLocation

simulated function Object.Vector GetEffectLocation ()

Overrides: UTWeapon.GetEffectLocation

(Description copied from UTWeapon.GetEffectLocation)


Returns:

the location + offset from which to spawn effects (primarily tracers)

GetEquipTime

simulated function float GetEquipTime ()

Overrides: UTWeapon.GetEquipTime


GetFireAnim

simulated function name GetFireAnim (int FireModeNum)

Returns the name of the firing animation

GetFireInterval

simulated function float GetFireInterval (byte FireModeNum)

Overrides: UTWeapon.GetFireInterval

Returns the rate at which the weapon fires. If in dual mode, 1/2 the rate

See: Weapon.GetFireInterval()

InstantFire

simulated function InstantFire ()

Overrides: UTWeapon.InstantFire

Performs an 'Instant Hit' shot. Also, sets up replication for remote clients, and processes all the impacts to deal proper damage and play effects.

Network: Local Player and Server

PlayFireEffects

simulated function PlayFireEffects (byte FireModeNum, optional Object.Vector HitLocation)

Overrides: UTWeapon.PlayFireEffects

We override PlayFireEffects to reoffset the animation rate. When in dual mode, all firing speeds are 1/2 but we want the animations to play as normal.

See: PlayFireEffects

PlayWeaponEquip

simulated function PlayWeaponEquip ()

Overrides: UTWeapon.PlayWeaponEquip

Look to see if bLoaded (ie: has been brought up once) is true and decide which animation to play

PlayWeaponPutDown

simulated function PlayWeaponPutDown ()

Overrides: UTWeapon.PlayWeaponPutDown

Added support for handling the 2nd gun

SetAkimbo

simulated function SetAkimbo (bool bNewAkimbo, bool bPlayTransitionAnim)


SetSkin

simulated function SetSkin (Material NewMaterial)

Overrides: UTWeapon.SetSkin

Setup the overlay skins

SetWeaponOverlayFlags

simulated function SetWeaponOverlayFlags (UTPawn OwnerPawn)

Overrides: UTWeapon.SetWeaponOverlayFlags

When the Pawn's WeaponOverlay flag changes, handle it here

TrackShotCount

simulated function TrackShotCount ()

By default, we track each shot so that the 2nd weapon will work. Bursting overrides this function

UseLeftBarrel

simulated function bool UseLeftBarrel ()

Determine which gun to use

States

Active

Inherits from: UTWeapon.Active

Modifiers: simulated

Active.BeginState

simulated event BeginState (name PreviousStateName)

Overrides: UTWeapon.Active.BeginState

Initialize the weapon as being active and ready to go.

Active.OnAnimEnd

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

Overrides: UTWeapon.Active.OnAnimEnd

(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.LagRot

simulated function int LagRot (int NewValue, int LastValue, float MaxDiff, int Index)

Overrides: UTWeapon.LagRot (global)


Active.ShouldLagRot

simulated function bool ShouldLagRot ()

Overrides: UTWeapon.Active.ShouldLagRot

(Description copied from UTWeapon.ShouldLagRot)


Returns:

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

WeaponBurstCoolDown

Modifiers: simulated

WeaponBurstCoolDown.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).

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

WeaponBurstCoolDown.WeaponReady

simulated function WeaponReady ()


WeaponBursting

Extends: WeaponFiring

Modifiers: simulated

WeaponBursting.BeginState

simulated event BeginState (name PrevStateName)

Overrides: UTWeapon.WeaponFiring.BeginState

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

WeaponBursting.EndState

simulated event EndState (name NextStateName)

Overrides: 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.

WeaponBursting.GetFireAnim

simulated function name GetFireAnim (int FireModeNum)

Overrides: GetFireAnim (global)

Returns the name of the firing animation

WeaponBursting.PlayArmAnimation

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

Overrides: UTWeapon.PlayArmAnimation (global)


WeaponBursting.PlayWeaponAnimation

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

Overrides: UTWeapon.PlayWeaponAnimation (global)

We only play the animation once.

See: Weapon.PlayWeaponAnimation

WeaponBursting.RefireCheckTimer

simulated function RefireCheckTimer ()

Overrides: WeaponFiring.RefireCheckTimer

We poll the PendingFire in RefireCheckTimer() to insure the switch to Burst Firing respects the current shot timings

WeaponBursting.TrackShotCount

simulated function TrackShotCount ()

Overrides: TrackShotCount (global)

CoolDown tracks the shots

WeaponBursting.TryPutDown

simulated function bool TryPutDown ()

Overrides: UTWeapon.TryPutDown (global)

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

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: UTWeapon.WeaponEquipping

Modifiers: simulated

WeaponEquipping.EndState

simulated event EndState (name NextStateName)

Overrides: UTWeapon.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.WeaponEquipped

simulated function WeaponEquipped ()

Overrides: Weapon.WeaponEquipping.WeaponEquipped


WeaponFiring

Inherits from: UTWeapon.WeaponFiring

Modifiers: simulated

WeaponFiring.EndState

simulated event EndState (name NextStateName)

Overrides: UTWeapon.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.BecomeDual

simulated function BecomeDual ()

Overrides: BecomeDual (global)

Become a dual firing weapon. Right now this isn't important unless the instigator is the local client. If it is, then show the second mesh and play any needed "Equipping" animations

WeaponFiring.RefireCheckTimer

simulated function RefireCheckTimer ()

Overrides: Weapon.WeaponFiring.RefireCheckTimer

We poll the PendingFire in RefireCheckTimer() to insure the switch to Burst Firing respects the current shot timings