Usage:
ObjectTemplate.ChangeWeaponWhenNoAmmo
boolean
Argument values:
argument 1: | 1; most commonly 1 |
Description: When a weapon runs out of ammo, it will automatically switch to another weapon when the boolean is 1. This property is 0 by default, i.e. the weapon does not change. It is set to 1 in BF 1942 for grenades, landmines, and exppacks, i.e. when you run out of these, you switch to your main weapon.
Related properties: CantSelectWhenNoAmmo, FireInCameraDof
Used in object types (and how often in each type): HandFireArms (24%)
Used in a total of 23 .con files: Objects.con
Parent directory of these .con files: objects/HandWeapons
Example: (from objects/HandWeapons/CommandoKnife/Objects.con)
ObjectTemplate.Create HandFireArms CommandoKnife
ObjectTemplate.ItemIndex 1
ObjectTemplate.NetworkableInfo HandFireArmsInfo
ObjectTemplate.ProjectileTemplate CommandoKnifeThrowProjectile
ObjectTemplate.ProjectilePosition 0/0/0
ObjectTemplate.MagSize 5
ObjectTemplate.NumOfMag 1
ObjectTemplate.MagType 0
ObjectTemplate.FireDelay 0.43
ObjectTemplate.Reloadtime 1
ObjectTemplate.RoundOfFire 2
ObjectTemplate.FireOnce c_True
ObjectTemplate.AltFireOnce c_True
ObjectTemplate.GUIIndex 82
ObjectTemplate.AutoReload 1
ObjectTemplate.SetHudAmmoType ATIcon
ObjectTemplate.SetAmmoIcon "Ammo/Ammobar_icon_CommandoKnife_64x32.tga"
ObjectTemplate.SetCrossHairType CHTIcon
ObjectTemplate.SetHasMag 0
ObjectTemplate.FireInCameraDof 1
ObjectTemplate.LoadSoundScript Sounds/knife.ssc
ObjectTemplate.SoldierCameraPosition 0/-0.03/0.1
ObjectTemplate.AiTemplate CommandoKnifeThrowAI
ObjectTemplate.RotationalSpeed 8/0/0
ObjectTemplate.Velocity 30
ObjectTemplate.CantSelectWhenNoAmmo 1
ObjectTemplate.ChangeWeaponWhenNoAmmo 1
ObjectTemplate.Hitpoints 10000
ObjectTemplate.Maxhitpoints 10000
ObjectTemplate.AmmoType 2
rem -------------------------------------
ObjectTemplate.CreateSkeleton animations/CommandoKnife.ske
ObjectTemplate.UseSkeletonPartAsMain Base
ObjectTemplate.AddTemplate CommandoKnifeLod
rem -------------------------------------
rem *** Used for Alternative fire stabing!
ObjectTemplate.AddTemplate CommandoKnifeStab
Go to the ObjectTemplate properties list page, ObjectTemplate page, All Properties list, or Main scripting page.