| Home Page | Recent Changes

Weapon (UT)

Actor >> Inventory (UT) >> Weapon

The thing you use to shoot stuff and kill monsters and other players with.

Sometimes you can hurt yourself very badly with it too ...use with caution.

Remember: Guns don't kill people. Bullets do.

Wormbo:Usually this is true. But in Unreal/UT some weapons don't use projectiles, so here really the guns kill the people. ;)

Properties

float MaxTargetRange
Maximum distance to target. (not used?)
class<Ammo (UT)> AmmoName
Type of ammo used.
byte ReloadCount
Amount of ammo depletion before reloading. 0 if no reloading is done. (not used)
int PickupAmmoCount
Amount of ammo initially in pick-up item.
Ammo (UT) AmmoType [travel, replicated to owning client]
Inventory Ammo being used.
bool bCanThrow
if true, player can toss this weapon out
bool bWeaponStay
The weapon stays on the map after it has been picked up, but players can't pick it up again if they already have it.
bool bOwnsCrosshair
This weapon is responsible for drawing its own crosshair (in its PostRender function). The default crosshair is not drawn when this is true.
bool bSpecialIcon
The weapon's icon should always be drawn.
bool bHideWeapon
If true, weapon is not rendered. Set automatically when player configured hidden weapon. (PlayerPawn.Handedness=2)
bool bMeleeWeapon
Weapon is only a melee weapon.
bool bRapidFire
Used by human animations in determining firing animation (for still firing)
float FiringSpeed
Used by human animations in determining firing speed
vector FireOffset
Offset from drawing location for projectile/trace start
class<Projectile (UT)> ProjectileClass
Projectile used for primary firing mode when not bInstantHit.
class<Projectile (UT)> AltProjectileClass
Projectile used for secondary firing mode when not bAltInstantHit.
bool bInstantHit
If true, instant hit rather than projectile firing weapon for primary firing mode.
bool bAltInstantHit
If true, instant hit rather than projectile firing weapon for secondary firing mode.
name MyDamageType
Damage type for instant hit primary mode.
name AltDamageType
Damage type for instant hit secondary mode.
float ProjectileSpeed
Speed of ProjectileClass.
float AltProjectileSpeed
Speed of AltProjectileClass.
bool bWeaponUp
Used in Active State
bool bChangeWeapon
True, when the the player wants to change the weapon.
bool bLockedOn
Used e.g. by the rocket launcher to indicate a target lock.
bool bPointing
Indicates weapon is being pointed. Used by the AI.
bool bWarnTarget
When firing projectile, warn the target.
bool bAltWarnTarget
When firing alternate projectile, warn the target.
bool bSplashDamage
Used by bot AI
bool bRecommendSplashDamage
If true, bot preferentially tries to use splash damage rather than direct hits.
bool bRecommendAltSplashDamage
If true, bot preferentially tries to use splash damage rather than direct hits.
float AimError
Aim error for bots. (note this value doubled if instant hit weapon)
float AIRating
Base weapon rating for switching priority.
float RefireRate
Chance that bot continues to hold the fire button.
float AltRefireRate
Chance that bot continues to hold the alt-fire button.
rotator AdjustedAim
float ShakeMag
float ShakeTime
float ShakeVert

Sounds

sound FireSound
sound AltFireSound
sound CockingSound
sound SelectSound
sound Misc1Sound
sound Misc2Sound
sound Misc3Sound

HUD Messages

string MessageNoAmmo [localized]
This is displayed when the player wants to switch to this weapon while it has no ammo. This will be prefixed with the weapon's ItemName.
string DeathMessage [localized]
Default message to display when the player kills another player while holding this weapon. (also see Taking Damage)
Color NameColor
Used when drawing name on HUD when the HUD is reduced and the weapon change is indicated by text.

Muzzle Flash

bool bSetFlashTime
Used internally when drawing the 1st person muzzle flash.
bool bDrawMuzzleFlash
Should the 1st person muzzle flash be drawn?
byte bMuzzleFlash
The weapon is responsible for setting and clearing bMuzzleFlash whenever it wants the MFTexture drawn on the Canvas. Usually bMuzzleFlash++; is enough.
float FlashTime
float MuzzleScale
Scales the MFTexture when drawing it. This value is relative to a screen resolution of 640x480 and will be scaled for other resolutions.
float FlashO
This is responsible for the horizontal positioning of the MFTexture. (multiplied by the weapon's default FireOffset.Y and Canvas.ClipX/2, also multiplied by -0.2 when Handedness=0 or multiplied with Handedness in all other cases)
float FlashY, FlashC
Responsible for the vertical positioning of the MFTexture. FlashC is only used for Handedness=0. In this case it is added to FlashY. Finally the value is multiplied by Canvas.ClipY/2.
float FlashLength
Time to display the MFTexture until bMuzzleFlash is cleared automatically.
int FlashS
Specifies the size of the MFTexture/2.
texture MFTexture
1st person muzzle flash texture. Height and width of this texture should be equal.
texture MuzzleFlare
float FlareOffset

Known Subclasses

Related Topics

See also Default Properties For Weapons.

Should the above page be moved to a subpage of this one?

Wormbo:The information of that page should be moved to the respective classes. e.g. DoubleName is a property of the Enforcer class and not available in any other weapon class.


Category Class (UT)

The Unreal Engine Documentation Site

Wiki Community

Topic Categories

Recent Changes

Offline Wiki

Unreal Engine

Console Commands

Terminology

FAQs

Help Desk

Mapping Topics

Mapping Lessons

UnrealEd Interface

UnrealScript Topics

UnrealScript Lessons

Making Mods

Class Tree

Modeling Topics

Chongqing Page

Log In