I search for solutions in this order: Past Code, Unreal Source, Wiki, BUF, groups.yahoo, google, screaming at monitor. – RegularX
UE3:Weapon (UT3)
- Package:
- Engine
- Direct subclass:
- GameWeapon
- This class in other games:
- RTNP, U1, UT, UE2Runtime, U2XMP, UT2004, U2, UT2003, UDK
Base Weapon implementation.
Properties
Property group 'Weapon'
DefaultAnimSpeed
Type: float
When no duration is specified, speed to play anims.
Default value: 1.0
EquipTime
Type: float
How long does it take to Equip this weapon
Default value: 0.33
FireInterval
Holds the amount of time a single shot takes
FireOffset
Type: Object.Vector
Holds an offest for spawning protectile effects.
InstantHitDamage
How much damage does a given instanthit shot do
InstantHitMomentum
momentum transfer scaling for instant hit damage
Mesh
Type: MeshComponent
Modifiers: editinline
Weapon Mesh
PutDownTime
Type: float
How long does it take to put this weapon down
Default value: 0.33
Spread
How much of a spread between shots
WeaponRange
Type: float
Range of Weapon, used for Traces (InstantFire, ProjectileFire, AdjustAim...)
Default value: 16384.0
Internal variables
AIRating
Type: float
Default value: 0.5
bCanThrow
Type: bool
Can player toss his weapon out? Typically false for default inventory.
Default value: True
bInstantHit
Type: bool
bMeleeWeapon
Type: bool
bWeaponPutDown
Type: bool
Set to put weapon down at the end of a state. Typically used to change weapons on state changes (weapon up, stopped firing...)
CachedMaxRange
Type: float
Cache MaxRange of weapon
CurrentFireMode
Type: byte
Current FireMode
FiringStatesArray
Array of firing states defining available firemodes
InstantHitDamageTypes
Type: array<class<DamageType> >
DamageTypes for Instant Hit Weapons
Priority
Type: float
Modifiers: databinding, config
Configurable weapon priority. Ties (mod weapons) are broken by GroupWeight
Default value: -1.0
ShouldFireOnRelease
AI Hints
WeaponFireTypes
Type: array<EWeaponFireType>
Defines the type of fire (see Enum above) for each mode
WeaponProjectiles
Type: array<class<Projectile> >
The Class of Projectile to spawn
Default values
Property | Value |
---|---|
bOnlyDirtyReplication | False |
bReplicateInstigator | True |
ItemName | "Weapon" |
RespawnTime | 30.0 |
Enums
EWeaponFireType
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
- EWFT_None
- No damage
Functions
Events
Destroyed
Overrides: Inventory.Destroyed
Event called when weapon actor is destroyed
GetMuzzleLoc
This function returns the world location for spawning the visual effects
IsFiring
Returns true if the weapon is firing, used by AI
Other instance functions
See Weapon instance functions.
States
Active
Modifiers: simulated
Active.BeginState
Overrides: Object.BeginState (global)
Initialize the weapon as being active and ready to go.
Active.Activate
Overrides: Activate (global)
Activate() ignored since already active
Active.BeginFire
Overrides: BeginFire (global)
Override BeginFire so that it will enter the firing state right away.
Active.ReadyToFire
ReadyToFire() called by NPC firing weapon. bFinished should only be true if called from the Finished() function
Active.TryPutDown
Overrides: TryPutDown (global)
Put the weapon down
Inactive
State Inactive Default state for a weapon. It is not active, cannot fire and resides in player inventory.
Modifiers: auto
Inactive.BeginState
Overrides: Object.BeginState (global)
Clear out the PendingFires
Inactive.ServerStartFire
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.
Inactive.ServerStopFire
Overrides: ServerStopFire (global)
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.
Inactive.StartFire
Overrides: StartFire (global)
do not allow firing in the inactive state
Inactive.TryPutDown
Overrides: TryPutDown (global)
can't put down an inactive weapon
PendingClientWeaponSet
PendingClientWeaponSet.BeginState
Overrides: Object.BeginState (global)
Event called when weapon enters this state
PendingClientWeaponSet.EndState
Overrides: Object.EndState (global)
Event called when weapon leaves this state
PendingClientWeaponSet.PendingWeaponSetTimer
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.
Modifiers: simulated
WeaponEquipping.BeginState
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).
WeaponEquipping.EndState
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.
WeaponEquipping.Activate
Overrides: Activate (global)
Activate() ignored since already becoming active
WeaponEquipping.WeaponEquipped
WeaponFiring
Modifiers: simulated
WeaponFiring.BeginState
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).
WeaponFiring.EndState
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.
WeaponFiring.IsFiring
Overrides: IsFiring (global)
Returns true if the weapon is firing, used by AI
WeaponFiring.RefireCheckTimer
Overrides: RefireCheckTimer (global)
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.
WeaponPuttingDown
Modifiers: simulated
WeaponPuttingDown.BeginState
Overrides: Object.BeginState (global)
Time the process and clear the Firing flags
WeaponPuttingDown.EndState
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.
WeaponPuttingDown.TryPutDown
Overrides: TryPutDown (global)
(Description copied from Weapon.TryPutDown)
Put Down current weapon Once the weapon is put down, the InventoryManager will switch to InvManager.PendingWeapon.
Returns:
- returns true if the weapon can be put down.
WeaponPuttingDown.WeaponIsDown
We are done putting the weapon away, remove the mesh/etc.