SetPrimaryAmmoBar Property

Usage:
   ObjectTemplate.SetPrimaryAmmoBar name

Argument values:

argument 1:    ABAmmoBar, ABAmmoBarHeatBar, ABAmmoBarOnly, ABAmmoBarReloadBar, ABHeatBarOnly, ABIconOnly, ABNone, ABReloadBarOnly; most commonly ABNone

Description: This is one of a few related properties. These are:

  ObjectTemplate.SetNumberOfWeaponIcons #
  ObjectTemplate.SetPrimaryAmmoIcon "Ammo/Icon_*.tga"
  ObjectTemplate.SetPrimaryAmmoBar ABTypeName
  ObjectTemplate.SetSecondaryAmmoIcon "Ammo/Icon_*.tga"
  ObjectTemplate.SetSecondaryAmmoBar ABTypeName

These all have to do with the ammunition/overheating status display for each weapon, the primary (left mouse fire) and secondary (right mouse), if any. SetNumberOfWeaponIcons specifies the number of weapons that have a display on the HUD, a value from 0 to 2. SetPrimaryAmmoBar sets the type of display needed for the weapon, similar to how handweapons use this value in SetHudAmmoType. Note that the defined names are different, though, starting with AB instead of AT. Here are the values used for vehicle weapons:

ABNone - for positions that have no weapons; set for vehicles without weapons
ABAmmoBar - for weapons with no reload wait time but can run out of ammo, like fighter plane guns
ABAmmoBarHeatBar - for weapons that overheat and run out of ammo, like machineguns on tanks
ABAmmoBarReloadBar - for weapons that need time to reload, like tank or ship guns
ABHeatBarOnly - for weapons that overheat but never run out of ammo, like stationary MGs
ABReloadBarOnly - never runs out of ammo but wait to reload, e.g. destroyer and battleship guns
ABIconOnly - never overheats, never runs out of ammo, never needs to reload, e.g. flak guns

If SetPrimaryAmmoBar is any setting except for ABNone, the SetPrimaryAmmoIcon property is set, to define an image of the type of ammo used (bullet, rocket, etc).

See the HUD Icon Tutorial for more details and examples.

Related properties: SetNumberOfWeaponIcons, SetPrimaryAmmoIcon, SetSecondaryAmmoIcon, SetSecondaryAmmoBar

Used in object types (and how often in each type): PlayerControlObject (65%)

Used in a total of 90 .con files: Objects.con

Parent directories of these .con files: objects/Vehicles, objects/Stationary_Weapons, Bf1942/Levels

Example: (from objects/Vehicles/Sea/Daihatsu/Objects.con)
   rem *** Daihatsu ***
   ObjectTemplate.Create PlayerControlObject Daihatsu
   ObjectTemplate.SetNetworkableInfo DaihatsuBodyInfo
   ObjectTemplate.SaveInSeparateFile 1
   ObjectTemplate.HasMobilePhysics 1
   ObjectTemplate.Drag 0.42
   ObjectTemplate.Mass 30000
   ObjectTemplate.HasCollisionPhysics 1
   ObjectTemplate.HasResponsePhysics 1
   ObjectTemplate.HasArmor 1
   ObjectTemplate.Hitpoints 150
   ObjectTemplate.Maxhitpoints 150
   ObjectTemplate.Material 45
   ObjectTemplate.CriticalDamage 50
   ObjectTemplate.HpLostWhileCriticalDamage 1.5
   ObjectTemplate.ExplosionForceMod 20
   ObjectTemplate.HpLostWhileUpSideDown 10
   ObjectTemplate.AddArmorEffect 80 em_DaiHatsuDamage 0/0/0
   ObjectTemplate.AiTemplate Daihatsu
   rem -------------------------------------
   ObjectTemplate.AddTemplate e_waterfront
   ObjectTemplate.SetPosition 0/-2/4
   ObjectTemplate.AddTemplate e_waterbacksmall
   ObjectTemplate.SetPosition 0/-2/-4
   ObjectTemplate.AddTemplate lodDaihatsu
   ObjectTemplate.AddTemplate DaihatsuFloater
   ObjectTemplate.SetPosition 1.2/-0.099/-1.999
   ObjectTemplate.AddTemplate DaihatsuFloater
   ObjectTemplate.SetPosition -1.199/-0.099/-1.999
   ObjectTemplate.AddTemplate DaihatsuFloater
   ObjectTemplate.SetPosition 1.2/-0.099/2.5
   ObjectTemplate.AddTemplate DaihatsuFloater
   ObjectTemplate.SetPosition -1.199/-0.099/2.5
   ObjectTemplate.AddTemplate DaihatsuPassangerPCO3
   ObjectTemplate.SetPosition 1/0.3/1
   ObjectTemplate.AddTemplate DaihatsuPassangerPCO4
   ObjectTemplate.SetPosition 1/0.3/2
   ObjectTemplate.AddTemplate DaihatsuPassangerPCO5
   ObjectTemplate.SetPosition -1/0.3/1
   ObjectTemplate.AddTemplate DaihatsuPassangerPCO6
   ObjectTemplate.SetPosition -1/0.3/2
   rem -------------------------------------
   ObjectTemplate.SetPcoId 0
   ObjectTemplate.SetSoldierExitLocation 0/0.1/5 0/0/0
   ObjectTemplate.GUIIndex 65
   ObjectTemplate.SetVehicleIcon "Vehicle/Icon_dai-hatsu.tga"
   ObjectTemplate.SetVehicleIconPos 26/48
   ObjectTemplate.SetPrimaryAmmoBar ABNone
   ObjectTemplate.SetCrossHairType CHTNone
   ObjectTemplate.SetVehicleCategory VCSea
   ObjectTemplate.SetVehicleType VTLcvp
   ObjectTemplate.SetToolTipType TTLcvp
   ObjectTemplate.ExitTimer -0.5
   ObjectTemplate.ExitSpeedMod 0


Go to the ObjectTemplate properties list page, ObjectTemplate page, All Properties list, or Main scripting page.