Usage:
ObjectTemplate.SetHudAmmoType
name
Argument values:
argument 1: | ATAmmoBar, ATIcon, ATIconAndHeatBar, ATIconAndReloadBar, ATIconAndStrengthBar, ATNone; most commonly ATAmmoBar |
Description: This property sets the type of ammo that is to be displayed. Argument 1 specifies the format. This type is also used by vehicles' HUD displays. Here are the values and what they mean:
ATNone - for weapons that have no ammo, e.g. knives
ATAmmoBar - for weapons that use a sliding full and empty icon for their ammo bar.
ATIcon - for weapons with an icon that does not change, e.g. bazooka, landmine.
ATIconAndHeatBar - for the medpack, as the "heat" bar shows the healing level left.
ATIconAndReloadBar - for the engineer repair pack, with the "reload" bar showing repair level left.
ATIconAndStrengthBar - for grenades, as the right mouse button can vary the strength of the throw.
If the format set by SetHudAmmoType is ATAmmoBar, then these properties are set:
ObjectTemplate.SetAmmoBar "Ingame/*_empty_32x64.dds" ObjectTemplate.SetAmmoBarFill "Ingame/*_full_32x64.dds" ObjectTemplate.SetAmmoBarSize #
SetAmmoBar and SetAmmoBarFill are used to show how full the ammo clip is, using images of the clip itself. The SetAmmoBarSize is the height of the useful area of the ammo bar. All textures have to be a power of 2 along their edges, and all ammo bars are 32 or 64 pixels wide, but the useful height varies. If SetHudAmmoType is set to any of the ATIcon* types, then this property is set:
ObjectTemplate.SetAmmoIcon "Ammo/Icon_*.tga"
See the HUD Icon Tutorial for details.
Related properties: SetAmmoBar, SetAmmoBarFill, SetAmmoBarSize
Used in object types (and how often in each type): HandFireArms (96%)
Used in a total of 89 .con files: Objects.con
Parent directory of these .con files: objects/HandWeapons
Example: (from objects/HandWeapons/Gewehr42/Objects.con)
ObjectTemplate.Create HandFireArms Gewehr42
ObjectTemplate.ItemIndex 3
ObjectTemplate.NetworkableInfo HandFireArmsInfo
ObjectTemplate.ProjectileTemplate sg44Projectile
rem ObjectTemplate.setTracerTemplate Tracer_Projectile CRD_UNIFORM/2/4/0
ObjectTemplate.ProjectilePosition 0/0/0
ObjectTemplate.MagSize 30
ObjectTemplate.NumOfMag 5
ObjectTemplate.MagType 0
ObjectTemplate.Reloadtime 4.6
ObjectTemplate.RoundOfFire 9
ObjectTemplate.AiTemplate Gewehr42AI
ObjectTemplate.HasDynamicShadow 1
ObjectTemplate.ZoomFov 0.6
ObjectTemplate.AltFireOnce 1
ObjectTemplate.SoldierZoomFov 0.6
ObjectTemplate.SoldierZoomPosition -0.02/-0.05/-0.01
ObjectTemplate.SoldierCameraPosition -0.01/-0.0275/0.1
ObjectTemplate.AddRootSpeed 0
ObjectTemplate.AmmoType 1
ObjectTemplate.GUIIndex 3
ObjectTemplate.SetHudAmmoType ATAmmoBar
ObjectTemplate.SetAmmoBar "Ingame/Magbar_Bar_empty_32x64.tga"
ObjectTemplate.SetAmmoBarFill "Ingame/Magbar_Bar_full_32x64.tga"
ObjectTemplate.SetAmmoBarSize 48
ObjectTemplate.SetAmomBarPosX 5
ObjectTemplate.SetAmomBarPosY -11
ObjectTemplate.SetCrossHairType CHTCrossHair
Rem *** Deviation Begin *****
ObjectTemplate.Velocity 1000
ObjectTemplate.SetRecoilForceUp CRD_UNIFORM/0.28/0.32/0
ObjectTemplate.SetRecoilForceLeftRight CRD_UNIFORM/-0.2/0.2/0
ObjectTemplate.SetHasRecoilForce 1
ObjectTemplate.SetGoBackOnRecoil 1
rem ** FireDev harge large a reticule/how quickly it expands/how quickly it returns
rem ** setDevMod(float devModStand, float devModCrouch, float devModLie)
rem ** Mindev sets the size of the reticule/deviation of bullets **
rem ** Turndev setTurnDev(float max, float addPitch, float addYaw, float sub);
rem ** SpeedDev setSpeedDev(float max, float addForward, float addStrafe, float sub);
rem ** MiscDev setMiscDev(float max, float addJump, float sub);
ObjectTemplate.SetFireDev 3.0 0.4 0.06
ObjectTemplate.SetDevMod 0.9 0.5 0.3
ObjectTemplate.SetMinDev 0.75
ObjectTemplate.SetTurnDev 0 0 0 0
ObjectTemplate.SetSpeedDev 2.2 0.2 0.2 0.1
ObjectTemplate.SetMiscDev 2.5 2.5 0.1
Rem *** Deviation End *****
ObjectTemplate.FireInCameraDof 1
ObjectTemplate.LoadSoundScript Sounds/sg44.ssc
ObjectTemplate.CreateSkeleton animations/Gewehr42.ske
ObjectTemplate.UseSkeletonPartAsMain Base
rem *** LodObject must be located as first child to work on handweapons.
ObjectTemplate.AddTemplate Gewehr42Lod
ObjectTemplate.AddTemplate e_MuzzSG44
rem ObjectTemplate.setInputId -1
ObjectTemplate.SetStartOnEffects 0
ObjectTemplate.SetPosition 0/0.055/0.5
ObjectTemplate.SetRotation 0/0/0
ObjectTemplate.AddTemplate e_shell792mm
rem ObjectTemplate.setInputId -1
ObjectTemplate.SetStartOnEffects 1
ObjectTemplate.SetPosition 0/0.04/0.13
ObjectTemplate.SetRotation 0/0/0
Go to the ObjectTemplate properties list page, ObjectTemplate page, All Properties list, or Main scripting page.