WeaponClass

Classlabel: "weapon"

Class Tree: Entity->Weapon

Description:
Weapon Class is the root class for all Weapons. The ODF files for WeaponClass ODFs traditionally start with "g" for Gun.

ODF Properties:
  • [WeaponClass]

    altName = ""
    If this is specified, it is an Alternate WeaponClass, that is switched to when an object carrying this Weapon Deploys and triggers the switch with a switchMask. MorphTanks are the most common example of this.

    ordName = ""
    The ODF name for the OrdnanceClass that this weapon fires.

    fireSound = ""
    Sound file played when this weapon is fired.

    flashName = ""
    Render name for the Flash effect.

    flashTime = 0.0f
    Time for the flash effect to play on MP remote players, + 0.1 seconds.

    wpnName = ""
    Name text displayed in the HUD for this Weapon. This is passed through the Localization Table.

    wpnIcon = ""
    Texture filename for the weapon's Icon. Such as Jetpack uses.

    wpnReticle = ""
    Sprite Table name for this weapon's Reticle icon.

    wpnCategory = ""
    This is a 4 letter abbreviation for this weapon's Category type. This controls which Hard Points it can fit into on an object's weaponName Slots. Valid values are:
    • GUN
    • CANN
    • ROCK
    • MORT
    • SPEC
    • SHIE
    • HAND
    • PACK

    isAssault = false
    If this is true, this weapon can only fit into weapon Hard Points with weaponAssault set to true.

    isFlying = false
    If this is true, flags it as isFlying. If a PersonClass object is equipped with this weapon set as true, it will use "Assault Mode" animation (StandA, WalkA, CrouchA, JumpA, DeathA).

    needLOS = true
    If this is false, doesn't need line of sight for AI's AbleToHit to check return true.

    AllowAimHigh = true
    If false, won't allow high arching shots.

    canSelect = true
    If false, can't be selected when cycling through Weapon Slots.
    Note: ShieldUpgradeClass defaults to false.

    ShowShotsRemaining = true
    If this is false, won't show the shots left on a per-weapon basis.

    aiRange = ordnance Range.
    The range which AI will fire this weapon from, if their SubAttackClass is set to use Weapon Range. If this is not specified, it calculates it from the Ordnance class's lifespan*shotSpeed.
    Note: The Default for some Classes are: TorpedoLauncher: 120.0f, SpecialItemClass: 10.0f, RadarLauncherClass: 120.0f, MortarClass: 100.0f, DispenserClass: 50.0f
    Note: If there is a valid ordName, this property does not Inherit from classLabel ODF, it uses the ordnance lifetime instead of root ODF's property.

    localAmmo = 0
    This is a special amount of Ammo this weapon contains Locally. This is separate from an object's maxAmmo reserve.

    addLocalAmmo = 0
    Amount of Local Ammo generated per second.

    LeadPositionMinTime = 0.0f
    Minimum amount of time it will lead the shot.

    LeadPositionMaxTime = 60.0f
    Maximum amount of time it will lead the shot.

    MinOwnerLifetimeSeconds = -1.0f
    Minimum time in seconds the owner must be alive before weapon can trigger.

    MaxOwnerLifetimeSeconds = -1.0f
    Maximum time in seconds the owner can be alive before weapon cannot trigger.

    AllowedOwnerStateMask = 15
    Mask for what State the user has to be in to fire this weapon. Valid values are:
    • 1 = Undeployed
    • 2 = Deploying
    • 4 = Deployed
    • 8 = Undeploying

    CouldHit = true
    If this is false, AI won't try to use this weapon. Default is false for Class: ShieldUpgrade.

    AllowOffmapFiring = false
    If this is true, weapon can be fired from outside the map boundary.

    Weapon Visual Mesh.
    If this is specified, and there is a visualHard on the Weapon Hard point, this is the model that is attached there. Used by Pilot weapons for their external and cockpit geometry, but can be applied to any weapon.
    geometryName = ""
    This object's Model file name. Can be .XSI or .FBX.

    geometryScale = 1.0f
    This model's Scale.
    Note: Skinned meshes do not scale well.

    animCount = 0
    Number of Animations to load for this object.

    animName1 ... animName# = ""
    Name for Animation. Some classes play animations on their own. See list of supported AnimNames for each Class.

    animFile1 ... animFile# = ""
    Model file name for the specified Animation. Can be .XSI or .FBX
    Note: You can use .XSI files with a .FBX geometryName, as long as the hierarchy matches.

    cockpitName = ""
    Model file name for the Cockpit model. Can be .XSI or .FBX

    cockpitScale = 1.0
    Scale for Cockpit Model.

    animCountCockpit = 0
    Number of Animations to load for Cockpit model.

    animNameCockpit1 ... animNameCockpit# = ""
    Name for Animation. See list of supported AnimNames for each Class.

    animFileCockpit1 ... animFileCockpit# = ""
    Model file name for the specified Animation. Can be .XSI or .FBX
    Note: You can use .XSI files with a .FBX cockpitName, as long as the hierarchy matches.
On this page