CfgAmmo Config Reference: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Hitprobab - Sorry grammar messup)
(page sorely needed some attention, particularly since ArmaTokenNames refers to Arma as a "new game" ;-))
Line 1: Line 1:
{{Stub}}
{{Stub}}


=Introduction=
== Introduction ==


CfgAmmo, cfgMagazines, cfgWeapons and cfgVehicles are root classes defined in the engine's config.bin.
cfgAmmo, cfgMagazines, cfgWeapons and cfgVehicles are root classes defined in the engine's config.bin.  These classes can be subsequently added to by addons.


These classes can be subsequently added to by addons inherit in the game or provided by oem.
cfgAmmo defines the missile or projectile characteristics for ammunition held in a cfgMagazine which, in turn, is used by a cfgWeapon, which, in turn, is selected for use in a (series of) cfgVehicles or added as a portable weapon for a soldier. The same ammunition can be used by multiple magazines, and the same magazine can be used by multiple weapons. Generally, the same ammunition and the same magazine are used where possible, for consistency amongst weapons and to allow tweaks and changes to any single cfgAmmo to propagate naturally through all sources that use it.
 
CfgAmmo defines the missile characterstics for ammunition held in a cfgMagazine which, in turn, is used by a cfgWeapon, which, in turn, is selected for use in a (series of) cfgVehicles. The same ammunition can be, and generally is, used by multiple magazines. The same magazine, can be, and generally is, used by multiple weapons. And so on.
 
The default value is shown in the legend.


Note that engines accept integer values where a float would normally be expected.
Note that engines accept integer values where a float would normally be expected.


TokenNames marked '''[[ArmaTokenNames|ArmA]]''' were introduced from Xbox Elite and beyond.
=== OFP Legacy Behaviour ===
 
==Arma Enhancement==
 
Arma introduced a new root class, cfgMagazines.


In contrast, OFP uses a rather tedious construct in it's cfgWeapons class to distinguish between weapon and magazine paramaters.
All [[Real Virtuality]] games since ArmA use the root class cfgMagazines.  In contrast, OFP/Arma: Cold War Assault relies on constructs within its cfgWeapons class to distinguish between weapon and magazine parameters.


Regardless, there is no change in effect or construct or meaning to the cfgAmmo class in any engine.
The cfgAmmo class is similar across every game engine and aside from incremental additions of tokens with new game versions, the overall structure has not changed significantly.




Line 40: Line 32:


==airFriction==
==airFriction==
'''[[ArmaTokenNames|ArmA]]'''
'''[[ArmA]]'''
<br>[[TokenNameValueTypes|Float]]
<br>[[TokenNameValueTypes|Float]]
<br>'''Description:''' As implied, how much the air friction slows down the projectile. Negative values.
<br>'''Description:''' As implied, how much the air friction slows down the projectile. Negative values.


==animated==
==animated==
'''[[ArmaTokenNames|ArmA]]'''
'''[[ArmA]]'''


==audibleFire==
==audibleFire==
Line 77: Line 69:
==cost==
==cost==
[[TokenNameValueTypes|Integer]]
[[TokenNameValueTypes|Integer]]
<br>'''Description:''' Cost-gain evaluation is performed to choose an appropriate weapon. Gain includes self-preservation,
<br>'''Description:''' Cost-gain evaluation is performed to choose an appropriate weapon. Gain includes self-preservation, cost includes time required to complete the attack.
cost includes time required to complete the attack.
 
As a result, weapons with high cost are unlikely to be used again common targets, esp. when low cost weapons are available. Still, there may be situation where AI may decide to use high cost weapon, esp. when it thinks it has little chance of survival and needs to attempt destroying enemy quickly.


As a result, weapons with high cost are unlikely to be used again common targets,
Generally, cost is assigned to vague equivalents to real-world currency.
esp. when low cost weapons are available. Still, there may be situation where AI may
decide to use high cost weapon, esp. when it thinks it has little chance of survival
and needs to attempt destroying enemy quickly.


  cost=5000;
  cost=5000;
==cmImmunity==
'''[[Arma 3]]'''
<br>[[TokenNameValueTypes|Float]]
<br>'''Description:''' Specifies a missile's resistance to countermeasures (such as chaff and flares).  Possible range is from 0.0 to 1.0.
cmImmunity = 0.9


==CraterEffects==
==CraterEffects==
'''[[ArmaTokenNames|ArmA]]'''
'''[[ArmA]]'''
<br>[[TokenNameValueTypes|String]]
<br>[[TokenNameValueTypes|String]]
<br>'''Description:''' Declares which crater effect to spawn on hit on ground.
<br>'''Description:''' Declares which crater effect to spawn on hit on ground.
Line 100: Line 97:


==deflecting==
==deflecting==
'''[[ArmaTokenNames|ArmA]]'''
'''[[ArmA]]'''
<br>[[TokenNameValueTypes|Integer]]
<br>[[TokenNameValueTypes|Integer]]
<br>'''Description:''' Declares if ammo is deflecting and thus deflection angle.
<br>'''Description:''' Declares if ammo is deflecting and thus deflection angle.
Line 111: Line 108:


==effectsFire==
==effectsFire==
'''[[ArmaTokenNames|ArmA]]'''
'''[[ArmA]]'''


==effectsMissile==
==effectsMissile==
'''[[ArmaTokenNames|ArmA]]'''
'''[[ArmA]]'''


==effectsSmoke==
==effectsSmoke==
'''[[ArmaTokenNames|ArmA]]'''
'''[[ArmA]]'''


==explosionEffects==
==explosionEffects==
'''[[ArmaTokenNames|ArmA]]'''
'''[[ArmA]]'''
<br>[[TokenNameValueTypes|String]]
<br>[[TokenNameValueTypes|String]]
<br>'''Description:''' Declares which explosion effect to spawn on hit.
<br>'''Description:''' Declares which explosion effect to spawn on hit.
Line 130: Line 127:


==explosionTime==
==explosionTime==
'''[[ArmaTokenNames|ArmA]]'''
'''[[ArmA]]'''
<br>[[TokenNameValueTypes|Integer]]
<br>[[TokenNameValueTypes|Integer]]
<br>'''Description:''' Declares after how many seconds ammo will explode (e.g. used on timed hand grenades).
<br>'''Description:''' Declares after how many seconds ammo will explode (e.g. used on timed hand grenades).
Line 145: Line 142:


==fuseDistance==
==fuseDistance==
'''[[ArmaTokenNames|ArmA]]'''
'''[[ArmA]]'''
[[TokenNameValueTypes|Float]]
[[TokenNameValueTypes|Float]]
<br>'''Description:''' The minimum distance any '''explosive''' projectile has to travel, before it becomes "armed" and thus explodes on impact. Missiles hitting below the given range still visually explode, causing no damage or shockwave effects. Grenades will stick into the ground for X amount of time and then disappear causing no damage, or (in case 'explosionTime=' is set) explode after X seconds, causing damage.
<br>'''Description:''' The minimum distance any '''explosive''' projectile has to travel, before it becomes "armed" and thus explodes on impact. Missiles hitting below the given range still visually explode, causing no damage or shockwave effects. Grenades will stick into the ground for X amount of time and then disappear causing no damage, or (in case 'explosionTime=' is set) explode after X seconds, causing damage.
Line 158: Line 155:


==HitEffects==
==HitEffects==
'''[[ArmaTokenNames|ArmA]]'''
'''[[ArmA]]'''


  class HitEffects
  class HitEffects
Line 183: Line 180:
===hitGlassArmored[]===
===hitGlassArmored[]===
'''[[ArmaTokenNames|ArmA]]'''
'''[[ArmaTokenNames|ArmA]]'''
 
===hitGround[]===
==hitGround[]==
OFP (only)
ofp only
 
===hitGroundHard[]===
===hitGroundHard[]===
'''[[ArmaTokenNames|ArmA]]'''
'''[[ArmaTokenNames|ArmA]]'''
Line 360: Line 355:


==supersonicCrackNear[]==
==supersonicCrackNear[]==
'''[[ArmaTokenNames|ArmA]]'''
'''[[ArmA]]'''
<br>[[TokenNameValueTypes|Array]]
<br>[[TokenNameValueTypes|Array]]
<br>'''Description:''' Declares sound and volume of the supersonic crack (near the player). Supersonic crack will only occur if ammo is flying with supersonic speed.
<br>'''Description:''' Declares sound and volume of the supersonic crack (near the player). Supersonic crack will only occur if ammo is flying with supersonic speed.
Line 367: Line 362:


==supersonicCrackFar[]==
==supersonicCrackFar[]==
'''[[ArmaTokenNames|ArmA]]'''
'''[[ArmA]]'''
<br>[[TokenNameValueTypes|Array]]
<br>[[TokenNameValueTypes|Array]]
<br>'''Description:''' Declares sound and volume of the supersonic crack (far). Supersonic crack will only occur if ammo is flying with supersonic speed.
<br>'''Description:''' Declares sound and volume of the supersonic crack (far). Supersonic crack will only occur if ammo is flying with supersonic speed.
Line 388: Line 383:


==timeToLive==
==timeToLive==
'''[[ArmaTokenNames|ArmA]]'''[[TokenNameValueTypes|Integer]]
'''[[ArmA]]'''
<br>[[TokenNameValueTypes|Integer]]
<br>'''Description:''' Time before the ammo vanishes, used as optimization to avoid having to simulate stray bullets. Note that this parameter has no effect in OFP where timeToLive is predefined by simulation.
<br>'''Description:''' Time before the ammo vanishes, used as optimization to avoid having to simulate stray bullets. Note that this parameter has no effect in OFP where timeToLive is predefined by simulation.


Line 402: Line 398:


==trackLead==
==trackLead==
'''[[ArmaTokenNames|ArmA]]'''
'''[[ArmA]]'''
<br>[[TokenNameValueTypes|Float]]
<br>[[TokenNameValueTypes|Float]]
<br>'''Description:''' The amount of lead a guided weapon will use when tracking a target.
<br>'''Description:''' The amount of lead a guided weapon will use when tracking a target.


==trackOversteer==
==trackOversteer==
'''[[ArmaTokenNames|ArmA]]'''
'''[[ArmA]]'''
<br>[[TokenNameValueTypes|Float]]
<br>[[TokenNameValueTypes|Float]]
<br>'''Description:''' The factor at which a guided weapon will steer to meet TrackLead.
<br>'''Description:''' The factor at which a guided weapon will steer to meet TrackLead.


==typicalSpeed==
==typicalSpeed==
'''[[ArmaTokenNames|ArmA]]'''
'''[[ArmA]]'''
<br>[[TokenNameValueTypes|Integer]]
<br>[[TokenNameValueTypes|Integer]]
<br>'''Description:''' hit value is valid when projectile moves at this speed. With lower speed the hit caused by the ammo is lower as well.
<br>'''Description:''' hit value is valid when projectile moves at this speed. With lower speed the hit caused by the ammo is lower as well.
Line 435: Line 431:


=W=
=W=
==weaponLockSystem==
'''[[Arma 3]]'''
<br>[[TokenNameValueTypes|Integer]] or [[TokenNameValueTypes|String]]
<br>'''Description:''' For countermeasures, defines the types of enemy countermeasures that it is effective against.  This can be either an integer by itself, or a string containing a mathmatical expression, normally a series of flags added together.
{|
|-
! Flag
!
|-
| 2
| Infrared
|-
| 8
| Radar-Guided
|-
|}
weaponLockSystem = 2 //effective against infrared guidance
weaponLockSystem = "2 + 8" //effective against infrared and radar guided


==whistleDist==
==whistleDist==
'''[[ArmaTokenNames|ArmA]]'''
'''[[ArmA]]'''


==whistleOnFire==
==whistleOnFire==
'''[[ArmaTokenNames|ArmA]]'''
'''[[ArmA]]'''


[[category:Operation Flashpoint: Editing]]
[[category:Operation Flashpoint: Editing]]
[[Category:ArmA: Addon Configuration]]
[[Category:ArmA: Addon Configuration]]

Revision as of 12:40, 28 September 2013

Template:Stub

Introduction

cfgAmmo, cfgMagazines, cfgWeapons and cfgVehicles are root classes defined in the engine's config.bin. These classes can be subsequently added to by addons.

cfgAmmo defines the missile or projectile characteristics for ammunition held in a cfgMagazine which, in turn, is used by a cfgWeapon, which, in turn, is selected for use in a (series of) cfgVehicles or added as a portable weapon for a soldier. The same ammunition can be used by multiple magazines, and the same magazine can be used by multiple weapons. Generally, the same ammunition and the same magazine are used where possible, for consistency amongst weapons and to allow tweaks and changes to any single cfgAmmo to propagate naturally through all sources that use it.

Note that engines accept integer values where a float would normally be expected.

OFP Legacy Behaviour

All Real Virtuality games since ArmA use the root class cfgMagazines. In contrast, OFP/Arma: Cold War Assault relies on constructs within its cfgWeapons class to distinguish between weapon and magazine parameters.

The cfgAmmo class is similar across every game engine and aside from incremental additions of tokens with new game versions, the overall structure has not changed significantly.


Modifications

access=1;
  • Ammunition classes can be added.
  • Existing classes can (sometimes) be altered.

The default class for cfgAmmo specifies access=3; Almost all subsequent classes inherit this value, which means they cannot be altered in any way.

To allow YOUR addon to subsequently modify YOUR ammunition (should you wish to with other addons), you must change the access= in YOUR ammunition.


A

airFriction

ArmA
Float
Description: As implied, how much the air friction slows down the projectile. Negative values.

animated

ArmA

audibleFire

Float
Description: How much can AI hear when given weapon is fired.

audibleFire=5.0;

airLock

Boolean
Description: Declares if ammo can lock on air targets. Also makes AI to decide whether to engage air units with the particular ammo.

C

canLock

Integer
Description: Declares if ammo is able to lock (necessary for airLock, irLock & laserLock)
Possible values:

  • 0 = false
  • 1 = cadet mode only
  • 2 = always.
canLock=0;

cartridge

String
Description: Declares the path to the cartridge P3D model, which may be ejected on each shot. Like all model specifications, .p3d is inferred.

cartridge="FxCartridge[.p3d]";

cost

Integer
Description: Cost-gain evaluation is performed to choose an appropriate weapon. Gain includes self-preservation, cost includes time required to complete the attack.

As a result, weapons with high cost are unlikely to be used again common targets, esp. when low cost weapons are available. Still, there may be situation where AI may decide to use high cost weapon, esp. when it thinks it has little chance of survival and needs to attempt destroying enemy quickly.

Generally, cost is assigned to vague equivalents to real-world currency.

cost=5000;

cmImmunity

Arma 3
Float
Description: Specifies a missile's resistance to countermeasures (such as chaff and flares). Possible range is from 0.0 to 1.0.

cmImmunity = 0.9

CraterEffects

ArmA
String
Description: Declares which crater effect to spawn on hit on ground.
Possible values: BombCrater, ExploAmmoCrater, GrenadeCrater, ImpactEffectsBig, MissileCrater, ShellCrater

CraterEffects="ExploAmmoCrater";


D

deflecting

ArmA
Integer
Description: Declares if ammo is deflecting and thus deflection angle.

deflecting=10;


E

effectsFire

ArmA

effectsMissile

ArmA

effectsSmoke

ArmA

explosionEffects

ArmA
String
Description: Declares which explosion effect to spawn on hit.
Possible values:

  • BombExplosion
  • ExploAmmoExplosion
  • ExplosionEffects
  • GrenadeExplosion

explosionTime

ArmA
Integer
Description: Declares after how many seconds ammo will explode (e.g. used on timed hand grenades).

explosionTime=5;

explosive

Float
Description: Declares if ammo is explosive, and if it is, how much (What part of the damage is done using explosion, the rest is assumed to be caused by kinetic impact, given as a ratio - 1 means fully explosive, 0 means fully kinetic)


F

fuseDistance

ArmA Float
Description: The minimum distance any explosive projectile has to travel, before it becomes "armed" and thus explodes on impact. Missiles hitting below the given range still visually explode, causing no damage or shockwave effects. Grenades will stick into the ground for X amount of time and then disappear causing no damage, or (in case 'explosionTime=' is set) explode after X seconds, causing damage.

H

hit

Float
Description: Damage on hit. In OFP total damage is calculated as: Total damage = Hit damage - Indirect damage (while hit value bigger then Indirecthit)

hit=8;

HitEffects

ArmA

class HitEffects
{
 vehicle = "ImpactMetal";
 object = "ImpactConcrete";
};

hit...[]


Description: All array values are defaulted to

hitBuilding[] = {"soundHit",1};

hitArmor[]

hitBuilding[]

hitConcrete[]

ArmA

hitDefault[]

ArmA

hitFoliage[]

ArmA

hitGlass[]

ArmA

hitGlassArmored[]

ArmA

hitGround[]

OFP (only)

hitGroundHard[]

ArmA

hitGroundSoft[]

ArmA

hitIron[]

ArmA

hitMan[]

hitMetal[]

ArmA

hitMetalplate[]

ArmA

hitPlastic[]

ArmA

hitRubber[]

ArmA

hitWood[]

ArmA


I

indirectHit

Float
Description: Damage in indirectHitRange.

indirectHit=8;

indirectHitRange

Float
Description: Radius in metres where indirectHit damage is caused.

indirectHitRange=75;

initTime

Float
Description: How long (in seconds) the projectile waits before starting it's motor.

initTime=0.2;

irLock

Boolean
Description: Declares if ammo can lock on IR-targets.


L

laserLock

Boolean
Description: Declares if ammo can lock on laser designator.

lightColor[]

Array
Description: Declares color of light (e.g. on flares).

lightColor[]={1,1,1,0};


M

maneuvrability

Float
Description: Declares maneuvrability of guided missiles. Higher values than 30-33 cause the Missile (when locked on) to spin wildly and rarely hit the target; tweaking sideairfriction and simulationstep makes the missile track and hit it's target, but esp. in Multiplayer from other Players fov, the missile will spin out of control, whilst from the shooters own pov, it will still fly straight and hit it's target.

manueuvrability=30;

manualControl

Boolean
Description: Declares if ammo can be controlled by the player during flight (?).

manualControl=0;

maxControlRange

Float
Description: Declares in which distance to player ammo can be controlled during flight. Using this on handheld Launchers causes the Missile to 'time-out' after approximately 1.5km, loosing all control of the warhead, which causes the Missile to spin around/take off into random directions (until it self-destructs, 'timetolive'), making higher Values useless.

Using this on any VEHICLE mounted Launchers (like the TOW, Hellfire or Maverick) allows the warhead to track AND turn/follow it's target even if said target is behind the player vehicle (and possibly AI-controlled ones too), which requires a high maneuverability value on the missile. That way, one can simply lock on, then pass the locked Target and shoot a missile, which will follow the target even without direct line of sight. NOTE that the missile follows the target regardless of obstacles, init-time or initspeed, meaning the missile might crash into the ground, esp. at lower heights.

maxControlRange=5000;

maxSpeed

Float
Description: Declares the maximum speed (m/s).

maxSpeed=241;

model

String
Description: Declares path to model.

model="\ca\weapons\bullet[.p3d]"

min/MaxRange...


Description: These tokens are present in ofp only. They were badly classed in ofp, causing all weapons using this specific 'bullet' to exhibit this behaviour rather than the behaviour of the 'rifle'. As such they were transferred to ArmA's cfgWeapons. Above statement is not (!!!!) true; EVEN IN ARMA 2 and OA, these values STILL exist AND affect the AI (AND ONLY THE AI!!!) in the following ways: (The tokens are found/put on each weapons "firing modes", or on the gun itself, if it has no seperate firing modes)

minRange

Float
Description: Minimum engagement range for the AI. Below given values, the AI WON'T engage but just "stare them down", even if they get shot at, and -most likely- killed.

Minrange = 5;

minRangeProbab

Float
Description:Probability declaring how high the chance is that the AI will engage a target at "MINRANGE" using this (current) firing mode. Values are 0.0 - 1.0 [NO chance -> 100% chance].

minRangeProbab=0.02;

midRange

Float
Description: Mid-Range engagement range for AI's using this (current) firing mode.

midRange=150;

midRangeProbab

Float
Description:Probability declaring how high the chance is that the AI will engage a target at "MIDRANGE". Values are 0.0 - 1.0

midRangeProbab=0.7;

maxRange

Float
Description:MAXIMUM range possible for the AI. Although AI's MAY engage targets slightly beyond MAXRANGE, this is how far the AI will try to shoot at targets. Targets definetly beyond MAXRANGE are ignored.

maxRange=500;

maxRangeProbab

Float
Description:How high the chance is that the AI will engage targets at MAXRANGE or slightly below. Values are 0.0 - 1.0

maxRangeProbab=0.51;

P

proxyShape

String
Description: Declares the model of this weapon used in proxies on vehicles. Note that proxies can be used only with air units.

proxyShape="\ca\air\sidewinder_proxy";


S

sideAirFriction

Float
Description: Adjusts the drag of a projectile. Lower values decrease drag, higher values increase drag. When used with guided projectiles, higher values make it easier for the projectile to turn while lower values make it more difficult to turn.

sideAirFriction=0.5;

simulation

String
Description: Declares simulation type. Also affects the behavior the projectile causes to the shooter/object hit; changing "shotShell" to "shotBullet" makes a tank shell pass through more trees rather than being stopped by them, and also removes the recoil which usually affects the tank/vehicle the cannon is mounted to. Changing "shotBullet" to "shotSpread" (OA only) causes the changed ammo to behave like it is buckshot (again, OA only).
Possible values: refer to Models & Classnames: Simulation Types for a list of all supported simulation types.

simulation="shotShell";

simulationStep

Float
Description: ?

shadow

ArmA

sound...[]

soundFly[]

soundEngine[]

soundHit[]

supersonicCrackNear[]

ArmA
Array
Description: Declares sound and volume of the supersonic crack (near the player). Supersonic crack will only occur if ammo is flying with supersonic speed.

supersonicCrackNear[]={"\ca\Weapons\Data\Sound\supersonic_crack_close.wss",1,1};

supersonicCrackFar[]

ArmA
Array
Description: Declares sound and volume of the supersonic crack (far). Supersonic crack will only occur if ammo is flying with supersonic speed.

supersonicCrackFar[]={"\ca\Weapons\Data\Sound\supersonic_crack_50meters.wss",1,1};


T

thrust

Float
Description: Engine power for missiles and rockets.

thrustTime

Float
Description: Engine burn time for missiles and rockets.

thrustTime=0.200000;

timeToLive

ArmA
Integer
Description: Time before the ammo vanishes, used as optimization to avoid having to simulate stray bullets. Note that this parameter has no effect in OFP where timeToLive is predefined by simulation.

timeToLive=4;

tracerColor[]

Array
Description: Declares tracer colour with "easy" settings (tracers enabled), format is {Red, Green, Blue, Transparency}.

tracerColorR[]

Array
Description: Declares tracer colour with "realistic" settings (tracers disabled), format is {Red, Green, Blue, Transparency}.

trackLead

ArmA
Float
Description: The amount of lead a guided weapon will use when tracking a target.

trackOversteer

ArmA
Float
Description: The factor at which a guided weapon will steer to meet TrackLead.

typicalSpeed

ArmA
Integer
Description: hit value is valid when projectile moves at this speed. With lower speed the hit caused by the ammo is lower as well.


V

visibleFire

Float
Description: how much does AI see a unit firing this weapon

visibleFire=18;

visibleFireTime

Integer
Description: How long is one shot assumed to be noticeable by the AI. Values under 5 should be avoided, as AI can performs is cycles with 5s of no testing in between.

visibleFireTime=18;


W

weaponLockSystem

Arma 3
Integer or String
Description: For countermeasures, defines the types of enemy countermeasures that it is effective against. This can be either an integer by itself, or a string containing a mathmatical expression, normally a series of flags added together.

Flag
2 Infrared
8 Radar-Guided
weaponLockSystem = 2 //effective against infrared guidance
weaponLockSystem = "2 + 8" //effective against infrared and radar guided

whistleDist

ArmA

whistleOnFire

ArmA