Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

Engine.Weapon

Extends
Inventory
Modifiers
native abstract config ( game )

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

Core.Object
|   
+-- Engine.Actor
   |   
   +-- Engine.Inventory
      |   
      +-- Engine.Weapon

Direct Known Subclasses:

GameWeapon

Constants Summary
Inherited Contants from Engine.Actor
ACTORMAXSTEPHEIGHT, MINFLOORZ, RBSTATE_ANGVELSCALE, RBSTATE_LINVELSCALE, RB_NeedsUpdate, RB_None, RB_Sleeping, REP_RBLOCATION_ERROR_TOLERANCE_SQ, TRACEFLAG_Blocking, TRACEFLAG_Bullet, TRACEFLAG_PhysicsVolumes, TRACEFLAG_SkipMovers

Variables Summary
floatAIRating
boolbCanThrow
boolbInstantHit
boolbMeleeWeapon
boolbWeaponPutDown
floatCachedMaxRange
byteCurrentFireMode
Array<Name>FiringStatesArray
Array<class<DamageType>>InstantHitDamageTypes
floatPriority
array<byte>ShouldFireOnRelease
Array<EWeaponFireType>WeaponFireTypes
Array<class<Projectile>>WeaponProjectiles
Weapon
floatDefaultAnimSpeed
floatEquipTime
Array<float>FireInterval
vectorFireOffset
Array<float>InstantHitDamage
Array<float>InstantHitMomentum
MeshComponentMesh
floatPutDownTime
Array<float>Spread
floatWeaponRange
Inherited Variables from Engine.Inventory
bDelayedSpawn, bDropOnDeath, bPredictRespawns, bReceiveOwnerEvents, bRenderOverlays, DroppedPickupClass, DroppedPickupMesh, DroppedPickupParticles, Inventory, InvManager, ItemName, MaxDesireability, PickupFactoryMesh, PickupForce, PickupMessage, PickupSound, RespawnTime
Inherited Variables from Engine.Actor
Acceleration, AllComponents, Attached, bAlwaysEncroachCheck, bAlwaysRelevant, bAlwaysTick, Base, BaseBoneName, BaseSkelComponent, bBlockActors, bBlocksNavigation, bBlocksTeleport, bBounce, bCanBeAdheredTo, bCanBeDamaged, bCanBeFrictionedTo, bCanTeleport, bClientDemoRecording, bCollideActors, bCollideComplex, bCollideWhenPlacing, bCollideWorld, bComponentOutsideWorld, bConsiderAllStaticMeshComponentsForStreaming, bDebug, bDeleteMe, bDemoOwner, bDemoRecording, bDestroyedByInterpActor, bDestroyInPainVolume, bEdShouldSnap, bExchangedRoles, bForceNetUpdate, bGameRelevant, bHardAttach, bHasAlternateTargetLocation, bHidden, bHiddenEd, bHiddenEdCustom, bHiddenEdGroup, bHurtEntry, bIgnoreBaseRotation, bIgnoreEncroachers, bIgnoreRigidBodyPawns, bIsMoving, bJustTeleported, bKillDuringLevelTransition, bLockLocation, BlockRigidBody, bMovable, bNetDirty, bNetInitial, bNetInitialRotation, bNetOwner, bNetTemporary, bNeverReplicateRotation, bNoDelete, bNoEncroachCheck, bOnlyDirtyReplication, bOnlyOwnerSee, bOnlyRelevantToOwner, bOrientOnSlope, bPathColliding, bPathTemp, bPendingDelete, bPendingNetUpdate, bPhysRigidBodyOutOfWorldCheck, bPostRenderIfNotVisible, bProjTarget, bPushedByEncroachers, bRepClientDemo, bReplicateInstigator, bReplicateMovement, bReplicateRigidBodyLocation, bRouteBeginPlayEvenIfStatic, bScriptInitialized, bShadowParented, bShouldBaseAtStartup, bSkipActorPropertyReplication, bStasis, bStatic, bTearOff, bTempEditor, bTicked, bUpdateSimulatedPosition, bWorldGeometry, Children, CollisionComponent, CollisionType, Components, CreationTime, CustomTimeDilation, DesiredRotation, DetachFence, DrawScale, DrawScale3D, GeneratedEvents, Group, InitialState, Instigator, LastNetUpdateTime, LastRenderTime, LatentActions, LatentFloat, LatentSeqNode, LifeSpan, Location, MessageClass, MinDistForNetRBCorrection, NetPriority, NetTag, NetUpdateFrequency, NetUpdateTime, OverlapTag, Owner, PendingTouch, Physics, PhysicsVolume, PrePivot, RelativeLocation, RelativeRotation, RemoteRole, Role, Rotation, RotationRate, SupportedEvents, Tag, TickGroup, Timers, Touching, Velocity, WorldInfo

Enumerations Summary
EWeaponFireType
EWFT_InstantHit, EWFT_Projectile, EWFT_Custom, EWFT_None
Inherited Enumerations from Engine.Actor
ECollisionType, EDoubleClickDir, EMoveDir, ENetRole, EPhysics, ETravelType

Structures Summary
Inherited Structures from Engine.Actor
AnimSlotDesc, AnimSlotInfo, AsyncLineCheckResult, CollisionImpactData, ImpactInfo, NavReference, ReplicatedHitImpulse, RigidBodyContactInfo, RigidBodyState, TimerData, TraceHitInfo

Functions Summary
function Activate ()))
function Activate ()))
Active
function Activate ()))
WeaponEquipping
functionint AddAmmo (int Amount)
functionrotator AddSpread (rotator BaseAim))
functionfloat AdjustFOVAngle (float FOVAngle))
function AttachWeaponTo (SkeletalMeshComponent MeshCpnt, optional Name SocketName)
function BeginFire (Byte FireModeNum))
function BeginFire (byte FireModeNum))
Active
event BeginState (Name PreviousStateName))
Active
event BeginState (Name PreviousStateName ))
Inactive
event BeginState (Name PreviousStateName))
PendingClientWeaponSet
event BeginState (Name PreviousStateName))
WeaponEquipping
event BeginState (Name PreviousStateName ))
WeaponFiring
event BeginState (Name PreviousStateName))
WeaponPuttingDown
functionImpactInfo CalcWeaponFire (vector StartTrace, vector EndTrace, optional out array<ImpactInfo> ImpactList))
functionbool CanAttack (Actor Other))
functionbool CanThrow ()))
function ClearFlashCount ()))
function ClearFlashLocation ()))
function ClearPendingFire (int FireMode))
function ClientWeaponSet (bool bOptionalSet))
function ClientWeaponThrown ()))
function ConsumeAmmo (byte FireModeNum)
function CustomFire ()
function DemoBeginFire (byte FireModeNum))
function DemoEndFire (byte FireModeNum))
functionbool DenyClientWeaponSet ()))
functionbool DenyPickupQuery (class<Inventory> ItemClass, Actor Pickup))
event Destroyed ()))
function DetachWeapon ()
function DisplayDebug (HUD HUD, out float out_YL, out float out_YPos))
functionbool DoOverrideNextWeapon ()))
functionbool DoOverridePrevWeapon ()))
function DropFrom (vector StartLocation, vector StartVelocity))
function DumpWeaponDebugToLog ()))
function EndFire (byte FireModeNum))
event EndState (Name NextStateName))
PendingClientWeaponSet
event EndState (Name NextStateName))
WeaponEquipping
event EndState (Name NextStateName ))
WeaponFiring
event EndState (Name NextStateName))
WeaponPuttingDown
function FireAmmunition ()))
function FireModeUpdated (byte FiringMode, bool bViaReplication)
functionbool FireOnRelease ()))
functionbool FocusOnLeader (bool bLeaderFiring))
function ForceEndFire ()))
functionRotator GetAdjustedAim (vector StartFireLoc ))
functionfloat GetAIRating ()))
functionfloat GetDamageRadius ()))
functionfloat GetFireInterval (byte FireModeNum ))
eventVector GetMuzzleLoc ()))
functionvector GetPhysicalFireStartLoc (optional vector AimDir))
functionclass<ProjectileGetProjectileClass ()))
functionActor GetTraceOwner ()))
functionfloat GetTraceRange ()))
function GetViewAxes (out vector XAxis, out vector YAxis, out vector ZAxis ))
functionAnimNodeSequence GetWeaponAnimNodeSeq ()))
function GetWeaponDebug (out Array DebugInfo ))
functionfloat GetWeaponRating ()))
function GivenTo (Pawn ThisPawn, optional bool bDoNotActivate))
functionbool HasAmmo (byte FireModeNum, optional int Amount ))
functionbool HasAnyAmmo ()))
function HolderDied ()))
function IncrementFlashCount ()))
function InstantFire ()))
functionbool IsActiveWeapon ()))
eventbool IsFiring ()))
eventbool IsFiring ()))
WeaponFiring
function ItemRemovedFromInvManager ()))
functionfloat MaxRange ()))
functionbool PassThroughDamage (Actor HitActor))
functionbool PendingFire (int FireMode))
function PendingWeaponSetTimer ()))
PendingClientWeaponSet
function PlayFireEffects (byte FireModeNum, optional vector HitLocation)
function PlayFiringSound ()
function PlayWeaponAnimation (Name Sequence, float fDesiredDuration, optional bool bLoop, optional SkeletalMeshComponent SkelMesh))
function ProcessInstantHit (byte FiringMode, ImpactInfo Impact ))
functionProjectile ProjectileFire ()))
function PutDownWeapon ()))
functionfloat RangedAttackTime ()))
functionbool ReadyToFire (bool bFinished))
Active
functionbool RecommendLongRangedAttack ()))
functionbool RecommendRangedAttack ()))
function RefireCheckTimer ()
function RefireCheckTimer ()))
WeaponFiring
functionfloat RelativeStrengthVersus (Pawn P, float Dist))
function SendToFiringState (byte FireModeNum))
function ServerStartFire (byte FireModeNum))
function ServerStartFire (byte FireModeNum ))
Inactive
function ServerStopFire (byte FireModeNum))
function ServerStopFire (byte FireModeNum ))
Inactive
function SetCurrentFireMode (byte FiringModeNum))
function SetFlashLocation (vector HitLocation ))
function SetPendingFire (int FireMode))
functionbool ShouldRefire ()))
function StartFire (byte FireModeNum))
function StartFire (byte FireModeNum)
Inactive
functionbool StillFiring (byte FireMode))
function StopFire (byte FireModeNum))
function StopFireEffects (byte FireModeNum)
function StopWeaponAnimation ()))
functionfloat SuggestAttackStyle ()))
functionfloat SuggestDefenseStyle ()))
function TimeWeaponEquipping ()))
function TimeWeaponFiring (byte FireModeNum ))
function TimeWeaponPutDown ()))
functionbool TryPutDown ()))
functionbool TryPutDown ()))
Active
functionbool TryPutDown ()))
Inactive
functionbool TryPutDown ()))
WeaponPuttingDown
function WeaponCalcCamera (float fDeltaTime, out vector out_CamLoc, out rotator out_CamRot)
function WeaponEmpty ()
function WeaponEquipped ()))
WeaponEquipping
function WeaponIsDown ()))
WeaponPuttingDown
function WeaponLog (coerce String Msg, coerce String FuncStr ))
function WeaponPlaySound (SoundCue Sound, optional float NoiseLoudness ))
Inherited Functions from Engine.Inventory
ActiveRenderOverlays, AnnouncePickup, BotDesireability, ClientGivenTo, DenyPickupQuery, Destroyed, DetourWeight, DropFrom, GetHumanReadableName, GetLocalString, GivenTo, GiveTo, ItemRemovedFromInvManager, OwnerEvent, RenderOverlays
Inherited Functions from Engine.Actor
ActivateEventClass, AllActors, AllOwnedComponents, Attach, AttachComponent, AutonomousPhysics, BaseChange, BasedActors, BecomeViewTarget, BeginAnimControl, BroadcastLocalizedMessage, BroadcastLocalizedTeamMessage, Bump, CalcCamera, CanSplash, ChartData, CheckForErrors, CheckHitInfo, CheckMaxEffectDistance, ChildActors, ClampRotation, ClearLatentAction, ClearTimer, Clock, CollidingActors, CollisionChanged, ComponentList, ConsoleCommand, ConstraintBrokenNotify, ContainsPoint, CreateAudioComponent, DebugFreezeGame, Destroy, Destroyed, Detach, DetachComponent, DisplayDebug, DoKismetAttachment, DrawDebugBox, DrawDebugCone, DrawDebugCoordinateSystem, DrawDebugCylinder, DrawDebugLine, DrawDebugSphere, DynamicActors, EffectIsRelevant, EncroachedBy, EncroachingOn, EndViewTarget, Falling, FastTrace, FellOutOfWorld, FindActorsOfClass, FindBase, FindEventsOfClass, FindGoodEndView, FindSpot, FinishAnim, FinishAnimControl, FlushPersistentDebugLines, ForceNetRelevant, ForceUpdateComponents, GainedChild, GetActorEyesViewPoint, GetActorFaceFXAsset, GetBaseMost, GetBoundingCylinder, GetComponentsBoundingBox, GetDebugName, GetDestination, GetFaceFXAudioComponent, GetGravityZ, GetHumanReadableName, GetItemName, GetLocalString, GetLocationStringFor, GetPackageGuid, GetPhysicsName, GetTargetLocation, GetTeamNum, GetTerminalVelocity, GetTimerCount, GetTimerRate, GetURLMap, GetUTFlag, HealDamage, HitWall, HurtRadius, InterpolationChanged, InterpolationFinished, InterpolationStarted, IsActorPlayingFaceFXAnim, IsBasedOn, IsInPain, IsInVolume, IsOverlapping, IsOwnedBy, IsPlayerOwned, IsStationary, IsTimerActive, KilledBy, Landed, LocalPlayerControllers, LostChild, MakeNoise, MatchStarting, ModifyHearSoundComponent, Move, MoveSmooth, MovingWhichWay, NativePostRenderFor, NotifyLocalPlayerTeamReceived, NotifySkelControlBeyondLimit, OnAnimEnd, OnAnimPlay, OnAttachToActor, OnCauseDamage, OnChangeCollision, OnDestroy, OnHealDamage, OnMakeNoise, OnRanOver, OnSetBlockRigidBody, OnSetPhysics, OnTeleport, OnToggleHidden, OutsideWorldBounds, OverlappingActors, OverRotated, PawnBaseDied, PhysicsVolumeChange, PickedUpBy, PlayActorFaceFXAnim, PlayerCanSeeMe, PlaySound, PlayTeleportEffect, PointCheckComponent, PostBeginPlay, PostInitAnimTree, PostRenderFor, PostTeleport, PostTouch, PreBeginPlay, PreTeleport, RanInto, ReplaceText, ReplicatedEvent, Reset, RigidBodyCollision, RootMotionExtracted, RootMotionModeChanged, ScriptGetTeamNum, SetAnimPosition, SetAnimWeights, SetBase, SetCollision, SetCollisionSize, SetDrawScale, SetDrawScale3D, SetForcedInitialReplicatedProperty, SetGRI, SetHardAttach, SetHidden, SetHUDLocation, SetInitialState, SetLocation, SetMorphWeight, SetNetUpdateTime, SetOnlyOwnerSee, SetOwner, SetPhysics, SetRelativeLocation, SetRelativeRotation, SetRotation, SetSkelControlScale, SetTickGroup, SetTimer, SetZone, ShutDown, Sleep, Spawn, SpawnedByKismet, SpecialHandling, StopActorFaceFXAnim, StopsProjectile, SuggestTossVelocity, TakeDamage, TakeRadiusDamage, Tick, Timer, TimeSince, TornOff, Touch, TouchingActors, Trace, TraceActors, TraceComponent, TriggerEventClass, UnClock, UnTouch, UsedBy, VisibleActors, VisibleCollidingActors

States Summary
Active Source code
simulated state Active
/********************************************************************************************* * State Active * A Weapon this is being held by a pawn should be in the active state. In this state, * a weapon should loop any number of idle animations, as well as check the PendingFire flags * to see if a shot has been fired. *********************************************************************************************/
Activate, BeginFire, BeginState, ReadyToFire, TryPutDown
Inactive Source code
auto state Inactive
/********************************************************************************************* * State Inactive * Default state for a weapon. It is not active, cannot fire and resides in player inventory. *********************************************************************************************/
BeginState, ServerStartFire, ServerStopFire, StartFire, TryPutDown
PendingClientWeaponSet Source code
state PendingClientWeaponSet
/********************************************************************************************* * State PendingClientWeaponSet * A weapon sets in this state on a remote client while it awaits full replication of all * properties. *********************************************************************************************/
BeginState, EndState, PendingWeaponSetTimer
WeaponEquipping Source code
simulated state 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. */
Activate, BeginState, EndState, WeaponEquipped
WeaponFiring Source code
simulated state WeaponFiring
/********************************************************************************************* * state WeaponFiring * This is the default Firing State. It's performed on both the client and the server. *********************************************************************************************/
BeginState, EndState, IsFiring, RefireCheckTimer
WeaponPuttingDown Source code
simulated state WeaponPuttingDown
/** * State WeaponPuttingDown * Putting down weapon in favor of a new one. * Weapon is transitioning to the Inactive state. */
BeginState, EndState, TryPutDown, WeaponIsDown


Variables Detail

AIRating Source code

var float AIRating;

bCanThrow Source code

var bool bCanThrow;
Can player toss his weapon out? Typically false for default inventory.

bInstantHit Source code

var bool bInstantHit;

bMeleeWeapon Source code

var bool bMeleeWeapon;

bWeaponPutDown Source code

var bool bWeaponPutDown;
Set to put weapon down at the end of a state. Typically used to change weapons on state changes (weapon up, stopped firing...)

CachedMaxRange Source code

var float CachedMaxRange;
Cache MaxRange of weapon

CurrentFireMode Source code

var byte CurrentFireMode;
Current FireMode

FiringStatesArray Source code

var Array<Name> FiringStatesArray;
Array of firing states defining available firemodes

InstantHitDamageTypes Source code

var Array<class<DamageType>> InstantHitDamageTypes;
DamageTypes for Instant Hit Weapons

Priority Source code

var databinding config float Priority;
Configurable weapon priority. Ties (mod weapons) are broken by GroupWeight

ShouldFireOnRelease Source code

var array<byte> ShouldFireOnRelease;
AI Hints

WeaponFireTypes Source code

var Array<EWeaponFireType> WeaponFireTypes;
Defines the type of fire (see Enum above) for each mode

WeaponProjectiles Source code

var Array<class<Projectile>> WeaponProjectiles;
The Class of Projectile to spawn

Weapon

DefaultAnimSpeed Source code

var(Weapon) float DefaultAnimSpeed;
When no duration is specified, speed to play anims.

EquipTime Source code

var(Weapon) float EquipTime;
How long does it take to Equip this weapon

FireInterval Source code

var(Weapon) Array<float> FireInterval;
Holds the amount of time a single shot takes

FireOffset Source code

var(Weapon) vector FireOffset;
Holds an offest for spawning protectile effects.

InstantHitDamage Source code

var(Weapon) Array<float> InstantHitDamage;
How much damage does a given instanthit shot do

InstantHitMomentum Source code

var(Weapon) Array<float> InstantHitMomentum;
momentum transfer scaling for instant hit damage

Mesh Source code

var(Weapon) editinline MeshComponent Mesh;
Weapon Mesh

PutDownTime Source code

var(Weapon) float PutDownTime;
How long does it take to put this weapon down

Spread Source code

var(Weapon) Array<float> Spread;
How much of a spread between shots

WeaponRange Source code

var(Weapon) float WeaponRange;
Range of Weapon, used for Traces (InstantFire, ProjectileFire, AdjustAim...)


Enumerations Detail

EWeaponFireType Source code

enum EWeaponFireType
{
EWFT_InstantHit, EWFT_Projectile, EWFT_Custom, EWFT_None
};
This enum defines the firing type for the weapon. EWFT_InstantHit - The weapon traces a shot to determine a hit and immediately causes an effect EWFT_Projectile - The weapon spawns a new projectile pointed at the crosshair EWFT_Custom - Requires a custom fire sequence


Functions Detail

Activate Source code

simulated function Activate ( ) )
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.

Activate Active Source code

simulated function Activate ( ) )
Activate() ignored since already active

Activate WeaponEquipping Source code

simulated function Activate ( ) )
Activate() ignored since already becoming active

AddAmmo Source code

function int AddAmmo ( int Amount )
Add ammo to weapon
@param Amount to add.
@return Amount actually added. (In case magazine is already full and some ammo is left Subclass me to define ammo addition rules.

AddSpread Source code

simulated function rotator AddSpread ( rotator BaseAim) )
Adds any fire spread offset to the passed in rotator
@param Aim the base aim direction
@return the adjusted aim direction

AdjustFOVAngle Source code

simulated function float AdjustFOVAngle ( float FOVAngle) )
This function can be used by a weapon to override a playercontroller's FOVAngle. It should be overriden in a subclass.

AttachWeaponTo Source code

simulated function AttachWeaponTo ( SkeletalMeshComponent MeshCpnt, optional Name SocketName )
AttachWeaponTo is called when it's time to attach the weapon's mesh to a location. it should be subclassed.

BeginFire Source code

simulated function BeginFire ( Byte FireModeNum) )
BeginFire is the point at which the server and client sync up their code path. It's job is to set the weapon in to the firing state. Network: LocalPlayer and Server

BeginFire Active Source code

simulated function BeginFire ( byte FireModeNum) )
Override BeginFire so that it will enter the firing state right away.

BeginState Active Source code

simulated event BeginState ( Name PreviousStateName) )
Initialize the weapon as being active and ready to go.

BeginState Inactive Source code

simulated event BeginState ( Name PreviousStateName ) )
Clear out the PendingFires

BeginState PendingClientWeaponSet Source code

simulated event BeginState ( Name PreviousStateName) )
Event called when weapon enters this state

BeginState WeaponEquipping Source code

simulated event BeginState ( Name PreviousStateName) )

BeginState WeaponFiring Source code

simulated event BeginState ( Name PreviousStateName ) )

BeginState WeaponPuttingDown Source code

simulated event BeginState ( Name PreviousStateName) )
Time the process and clear the Firing flags

CalcWeaponFire Source code

simulated function ImpactInfo CalcWeaponFire ( vector StartTrace, vector EndTrace, optional out array<ImpactInfo> ImpactList) )
CalcWeaponFire: Simulate an instant hit shot. This doesn't deal any damage nor trigger any effect. It just simulates a shot and returns the hit information, to be post-processed later. ImpactList returns a list of ImpactInfo containing all listed impacts during the simulation. CalcWeaponFire however returns one impact (return variable) being the first geometry impact straight, with no direction change. If you were to do refraction, reflection, bullet penetration or something like that, this would return exactly when the crosshair sees: The first 'real geometry' impact, skipping invisible triggers and volumes.
@param StartTrace world location to start trace from
@param EndTrace world location to end trace at
@output ImpactList list of all impacts that occured during simulation
@return first 'real geometry' impact that occured.
@note if an impact didn't occur, and impact is still returned, with its HitLocation being the EndTrace value.

CanAttack Source code

function bool CanAttack ( Actor Other) )

CanThrow Source code

simulated function bool CanThrow ( ) )
Returns true if this item can be thrown out.

ClearFlashCount Source code

simulated function ClearFlashCount ( ) )
Clear flashCount variable on Pawn. and call WeaponStoppedFiring event. Call this on the server and local player. Network: Server or Local Player

ClearFlashLocation Source code

function ClearFlashLocation ( ) )
Reset flash location variable. and call stop firing. Network: Server only

ClearPendingFire Source code

simulated function ClearPendingFire ( int FireMode) )

ClientWeaponSet Source code

reliable client function ClientWeaponSet ( bool bOptionalSet) )
is called by the server to tell the client about potential weapon changes after the player runs over a weapon (the client decides whether to actually switch weapons or not. Network: LocalPlayer
@param bOptionalSet. Set to true if the switch is optional. (simple weapon pickup and weight against current weapon).

ClientWeaponThrown Source code

reliable client function ClientWeaponThrown ( ) )
This function is called when the client needs to discard the weapon

ConsumeAmmo Source code

function ConsumeAmmo ( byte FireModeNum )
Consumes ammunition when firing a shot. Subclass me to define weapon ammunition consumption.

CustomFire Source code

simulated function CustomFire ( )
If the weapon isn't an instant hit, or a simple projectile, it should use the tyoe EWFT_Custom. In those cases this function will be called. It should be subclassed by the custom weapon.

DemoBeginFire Source code

reliable demorecording function DemoBeginFire ( byte FireModeNum) )
Passes on BeginFire calls to demos

DemoEndFire Source code

reliable demorecording function DemoEndFire ( byte FireModeNum) )
Passes on EndFire calls to demos

DenyClientWeaponSet Source code

simulated function bool DenyClientWeaponSet ( ) )
Returns true if this weapon wants to deny a ClientWeaponSwitch call

DenyPickupQuery Source code

function bool DenyPickupQuery ( class<Inventory> ItemClass, Actor Pickup) )
When you pickup an weapon, the inventory system has a chance to restrict the pickup.

Destroyed Source code

simulated event Destroyed ( ) )
Event called when weapon actor is destroyed

DetachWeapon Source code

simulated function DetachWeapon ( )
Detach weapon components from instigator. Perform any clean up. Should be subclassed.

DisplayDebug Source code

simulated function DisplayDebug ( HUD HUD, out float out_YL, out float out_YPos) )
list important Weapon variables on canvas. HUD will call DisplayDebug() on the current ViewTarget when the ShowDebug exec is used
@param HUD - HUD with canvas to draw on
@input out_YL - Height of the current font
@input out_YPos - Y position on Canvas. out_YPos += out_YL, gives position to draw text for next debug line.

DoOverrideNextWeapon Source code

simulated function bool DoOverrideNextWeapon ( ) )
hook to override Next weapon call. For example the physics gun uses it to have mouse wheel change the distance of the held object. Warning: only use in firing state, otherwise it breaks weapon switching

DoOverridePrevWeapon Source code

simulated function bool DoOverridePrevWeapon ( ) )
hook to override Previous weapon call.

DropFrom Source code

function DropFrom ( vector StartLocation, vector StartVelocity) )
Drop this weapon out in to the world
@param StartLocation - The World Location to drop this item from
@param StartVelocity - The initial velocity for the item when dropped

DumpWeaponDebugToLog Source code

simulated function DumpWeaponDebugToLog ( ) )
Dump debug information for this weapon to log file.

EndFire Source code

simulated function EndFire ( byte FireModeNum) )
Like BeginFire, this function puts a client and the server in sync and shuts down the firing sequence on both. Network: LocalPlayer and Server

EndState PendingClientWeaponSet Source code

simulated event EndState ( Name NextStateName) )
Event called when weapon leaves this state

EndState WeaponEquipping Source code

simulated event EndState ( Name NextStateName) )

EndState WeaponFiring Source code

simulated event EndState ( Name NextStateName ) )

EndState WeaponPuttingDown Source code

simulated event EndState ( Name NextStateName) )

FireAmmunition Source code

simulated function FireAmmunition ( ) )
FireAmmunition: Perform all logic associated with firing a shot - Fires ammunition (instant hit or spawn projectile) - Consumes ammunition - Plays any associated effects (fire sound and whatnot) Network: LocalPlayer and Server

FireModeUpdated Source code

simulated function FireModeUpdated ( byte FiringMode, bool bViaReplication )
Event called when Pawn.FiringMode has been changed. bViaReplication indicates if this was the result of a replication call.

FireOnRelease Source code

function bool FireOnRelease ( ) )

FocusOnLeader Source code

function bool FocusOnLeader ( bool bLeaderFiring) )

ForceEndFire Source code

simulated function ForceEndFire ( ) )
Clear all pending fires. This is non replicated flag.

GetAdjustedAim Source code

simulated function Rotator GetAdjustedAim ( vector StartFireLoc ) )
GetAdjustedAim begins a chain of function class that allows the weapon, the pawn and the controller to make on the fly adjustments to where this weapon is pointing.

GetAIRating Source code

function float GetAIRating ( ) )
AI interface

GetDamageRadius Source code

function float GetDamageRadius ( ) )
Returns the DamageRadius of projectiles being shot

GetFireInterval Source code

simulated function float GetFireInterval ( byte FireModeNum ) )
Returns interval in seconds between each shot, for the firing state of FireModeNum firing mode.
@param FireModeNum fire mode
@return Period in seconds of firing mode

GetMuzzleLoc Source code

simulated event Vector GetMuzzleLoc ( ) )
This function returns the world location for spawning the visual effects

GetPhysicalFireStartLoc Source code

simulated function vector GetPhysicalFireStartLoc ( optional vector AimDir) )
This function returns the world location for spawning the projectile, pulled in to the Pawn's collision along the AimDir direction.

GetProjectileClass Source code

function class<Projectile> GetProjectileClass ( ) )
Returns the type of projectile to spawn. We use a function so subclasses can override it if needed (case in point, homing rockets).

GetTraceOwner Source code

simulated function Actor GetTraceOwner ( ) )

@return the actor that 'owns' this weapon's traces (i.e. can't be hit by them)

GetTraceRange Source code

simulated function float GetTraceRange ( ) )
Range of weapon Used for Traces (CalcWeaponFire, InstantFire, ProjectileFire, AdjustAim...) State scoped accessor function. Override in proper state
@return range of weapon, to be used mainly for traces.

GetViewAxes Source code

simulated function GetViewAxes ( out vector XAxis, out vector YAxis, out vector ZAxis ) )
Returns the base view aim of the weapon owner

GetWeaponAnimNodeSeq Source code

simulated function AnimNodeSequence GetWeaponAnimNodeSeq ( ) )
Returns the AnimNodeSequence the weapon is using to play animations.

GetWeaponDebug Source code

simulated function GetWeaponDebug ( out Array<String> DebugInfo ) )
Retrieves important weapon debug information as an array of strings. That can then be dumped or displayed on HUD.

GetWeaponRating Source code

simulated function float GetWeaponRating ( ) )
Returns a weight reflecting the desire to use the given weapon, used for AI and player best weapon selection.
@return weapon rating (range -1.f to 1.f)

GivenTo Source code

function GivenTo ( Pawn ThisPawn, optional bool bDoNotActivate) )
This Weapon has just been given to this Pawn
@param thisPawn new weapon owner

HasAmmo Source code

simulated function bool HasAmmo ( byte FireModeNum, optional int Amount ) )
This function checks to see if the weapon has any ammo available for a given fire mode.
@param FireModeNum - The Fire Mode to Test For
@param Amount - [Optional] Check to see if this amount is available.
@return true if ammo is available for Firemode FireModeNum.

HasAnyAmmo Source code

simulated function bool HasAnyAmmo ( ) )
returns true if this weapon has any ammo left, regardless of the actual firing mode.

HolderDied Source code

function HolderDied ( ) )
Pawn holding this weapon as active weapon just died.

IncrementFlashCount Source code

simulated function IncrementFlashCount ( ) )
Increment Pawn's FlashCount variable. This is used to play weapon fire effects on remote clients. Call this on the server and local player. Network: Server and Local Player

InstantFire Source code

simulated function 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

IsActiveWeapon Source code

simulated function bool IsActiveWeapon ( ) )
Informs if this weapon is active for the player
@return true if this an active weapon for the player

IsFiring Source code

simulated event bool IsFiring ( ) )
Returns true if the weapon is firing, used by AI

IsFiring WeaponFiring Source code

simulated event bool IsFiring ( ) )

ItemRemovedFromInvManager Source code

function ItemRemovedFromInvManager ( ) )
A notification call when this weapon is removed from the Inventory of a pawn @see Inventory::ItemRemovedFromInvManager

MaxRange Source code

simulated function float MaxRange ( ) )
Returns the Maximum Range for this weapon

PassThroughDamage Source code

simulated function bool PassThroughDamage ( Actor HitActor) )
returns true if should pass trace through this hitactor

PendingFire Source code

simulated function bool PendingFire ( int FireMode) )
Pending Fire / Inv Manager

PendingWeaponSetTimer PendingClientWeaponSet Source code

simulated function PendingWeaponSetTimer ( ) )

PlayFireEffects Source code

simulated function PlayFireEffects ( byte FireModeNum, optional vector HitLocation )
PlayFireEffects Main function to play Weapon fire effects. This is called from Pawn::WeaponFired in the base implementation.

PlayFiringSound Source code

simulated function PlayFiringSound ( )
PlayFiringSound - Called after a shot is fired.

PlayWeaponAnimation Source code

simulated function PlayWeaponAnimation ( Name Sequence, float fDesiredDuration, optional bool bLoop, optional SkeletalMeshComponent SkelMesh) )
Play an animation on the weapon mesh Network: Local Player and clients
@param Anim Sequence to play on weapon skeletal mesh
@param desired duration, in seconds, animation should be played

ProcessInstantHit Source code

simulated function ProcessInstantHit ( byte FiringMode, ImpactInfo Impact ) )
Processes a successful 'Instant Hit' trace and eventually spawns any effects. Network: LocalPlayer and Server
@param HitActor Actor hit by trace
@param AimDir Aim direction of shot
@param HitLocation world location vector where HitActor was hit by trace
@param HitNormal hit normal vector
@param HitInto TraceHitInfo struct returning useful info like component hit, bone, material..

ProjectileFire Source code

simulated function Projectile ProjectileFire ( ) )
Fires a projectile. Spawns the projectile, but also increment the flash count for remote client effects. Network: Local Player and Server

PutDownWeapon Source code

simulated function PutDownWeapon ( ) )
This function is called to put a weapon down

RangedAttackTime Source code

function float RangedAttackTime ( ) )

ReadyToFire Active Source code

simulated function bool ReadyToFire ( bool bFinished) )
ReadyToFire() called by NPC firing weapon. bFinished should only be true if called from the Finished() function

RecommendLongRangedAttack Source code

function bool RecommendLongRangedAttack ( ) )

RecommendRangedAttack Source code

function bool RecommendRangedAttack ( ) )

RefireCheckTimer Source code

simulated function RefireCheckTimer ( )

RefireCheckTimer WeaponFiring Source code

simulated function RefireCheckTimer ( ) )
Timer event, call is set up in Weapon::TimeWeaponFiring(). The weapon is given a chance to evaluate if another shot should be fired. This event defines the weapon's rate of fire.

RelativeStrengthVersus Source code

function float RelativeStrengthVersus ( Pawn P, float Dist) )

SendToFiringState Source code

simulated function SendToFiringState ( byte FireModeNum) )
Send weapon to proper firing state Also sets the CurrentFireMode. Network: LocalPlayer and Server
@param FireModeNum Fire Mode.

ServerStartFire Source code

reliable server function ServerStartFire ( byte FireModeNum) )
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.

ServerStartFire Inactive Source code

reliable server function ServerStartFire ( byte FireModeNum ) )

ServerStopFire Source code

reliable server function ServerStopFire ( byte FireModeNum) )
When StopFire is called on a client, ServerStopFire is used to initiate the sequence on the server. Network: Dedicated Server only, or Listen Server for remote clients.

ServerStopFire Inactive Source code

reliable server function ServerStopFire ( byte FireModeNum ) )

SetCurrentFireMode Source code

simulated function SetCurrentFireMode ( byte FiringModeNum) )
Set current firing mode. Network: Local Player and Server.

SetFlashLocation Source code

function SetFlashLocation ( vector HitLocation ) )
This function sets up the Location of a hit to be replicated to all remote clients. Network: Server only

SetPendingFire Source code

simulated function SetPendingFire ( int FireMode) )

ShouldRefire Source code

simulated function bool ShouldRefire ( ) )
Check if current fire mode can/should keep on firing. This is called from a firing state after each shot is fired to decide if the weapon should fire again, or stop and go to the active state. The default behavior, implemented here, is keep on firing while player presses fire and there is enough ammo. (Auto Fire).
@return true to fire again, false to stop firing and return to Active State.

StartFire Source code

simulated function StartFire ( byte FireModeNum) )
Called on the LocalPlayer, Fire sends the shoot request to the server (ServerStartFire) and them simulates the firing effects locally. Call path: PlayerController::StartFire -> Pawn::StartFire -> InventoryManager::StartFire Network: LocalPlayer

StartFire Inactive Source code

simulated function StartFire ( byte FireModeNum )
do not allow firing in the inactive state

StillFiring Source code

simulated function bool StillFiring ( byte FireMode) )
This function returns true if the weapon is still firing in a given mode

StopFire Source code

simulated function StopFire ( byte FireModeNum) )
This initiates the shutdown of a weapon that is firing. Network: Local Player

StopFireEffects Source code

simulated function StopFireEffects ( byte FireModeNum )
StopFireEffects Main function to stop any active effects This is called from Pawn::WeaponStoppedFiring

StopWeaponAnimation Source code

simulated function StopWeaponAnimation ( ) )
Stops an animation on the weapon mesh Network: Local Player and clients

SuggestAttackStyle Source code

function float SuggestAttackStyle ( ) )

SuggestDefenseStyle Source code

function float SuggestDefenseStyle ( ) )

TimeWeaponEquipping Source code

simulated function TimeWeaponEquipping ( ) )
Sets the timing for equipping a weapon. The WeaponEquipped event is trigged when expired

TimeWeaponFiring Source code

simulated function TimeWeaponFiring ( byte FireModeNum ) )
Sets the timing for the firing state on server and local client. By default, a constant looping Rate Of Fire (ROF) is set up. When the delay has expired, the RefireCheckTimer event is triggered. Network: LocalPlayer and Server
@param FireModeNum Fire Mode.

TimeWeaponPutDown Source code

simulated function TimeWeaponPutDown ( ) )
Sets the timing for putting a weapon down. The WeaponIsDown event is trigged when expired

TryPutDown Source code

simulated function bool TryPutDown ( ) )
Put Down current weapon Once the weapon is put down, the InventoryManager will switch to InvManager.PendingWeapon.
@return returns true if the weapon can be put down.

TryPutDown Active Source code

simulated function bool TryPutDown ( ) )
Put the weapon down

TryPutDown Inactive Source code

simulated function bool TryPutDown ( ) )
can't put down an inactive weapon

TryPutDown WeaponPuttingDown Source code

simulated function bool TryPutDown ( ) )

WeaponCalcCamera Source code

simulated function WeaponCalcCamera ( float fDeltaTime, out vector out_CamLoc, out rotator out_CamRot )
WeaponCalcCamera allows a weapon to adjust the pawn's controller's camera. Should be subclassed

WeaponEmpty Source code

simulated function WeaponEmpty ( )
Called when the weapon runs out of ammo during firing

WeaponEquipped WeaponEquipping Source code

simulated function WeaponEquipped ( ) )

WeaponIsDown WeaponPuttingDown Source code

simulated function WeaponIsDown ( ) )
We are done putting the weapon away, remove the mesh/etc.

WeaponLog Source code

simulated function WeaponLog ( coerce String Msg, coerce String FuncStr ) )
Prints out weapon debug information to log file
@param Msg String to display
@param FuncStr String telling where the log came from (format: Class::Function)

WeaponPlaySound Source code

simulated function WeaponPlaySound ( SoundCue Sound, optional float NoiseLoudness ) )
This function handles playing sounds for weapons. How it plays the sound depends on the following: If we are a listen server, then this sound is played and replicated as normal If we are a remote client, but locally controlled (ie: we are on the client) we play the sound and don't replicate it If we are a dedicated server, play the sound and replicate it to everyone BUT the owner (he will play it locally).
@param SoundCue - The Source Cue to play


Defaultproperties

defaultproperties
{
   EquipTime=0.330000
   PutDownTime=0.330000
   bCanThrow=True
   WeaponRange=16384.000000
   DefaultAnimSpeed=1.000000
   Priority=-1.000000
   AIRating=0.500000
   ItemName="Weapon"
   RespawnTime=30.000000
   bReplicateInstigator=True
   bOnlyDirtyReplication=False
   Name="Default__Weapon"
   ObjectArchetype=Inventory'Engine.Default__Inventory'
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Creation time: sk 18-3-2018 10:01:03.157 - Created with UnCodeX