CfgMagazines Config Reference: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (samename magazines)
m (Text replacement - "\[ *((f|ht)tps?:\/\/[^ ]+) *\]" to "{{Link|$1|link}}")
 
(37 intermediate revisions by 11 users not shown)
Line 1: Line 1:
{{Stub}}
{{ConfigPage|start}}
== Introduction ==
'''''cfgAmmo''''', '''''cfgMagazines''''', '''''cfgWeapons''''' and '''''cfgVehicles''''' are root classes defined in the engine's {{hl|config.bin}}


=Introduction=
These classes can be subsequently added to by addons inherent in the game or provided by ''oem''.


CfgAmmo, cfgMagazines, cfgWeapons and cfgVehicles are root classes defined in the engine's config.bin.
''cfgAmmo'' defines the missile 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''.


These classes can be subsequently added to by addons inherit in the game or provided by oem.  
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.


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.
''Default'' values are shown in the legend. They come from the derived class {{hl|CA_Magazine}} rather than the true {{hl|default{}}} since almost everything derives from this class.


Nearly all values are identical to their {{Name|ofp|short}} equivalent.


----
'''Note''' that engines will accept ''integer'' values (or math strings) where a ''float'' would normally be expected.
'Default' values are shown in the legend. They come from the derived class CA_Magazine rather than the true default{} since almost everything derives from this class. Nearly all values are identical to their ofp equivalent.


Note that engines will accept integer values (or math strings) where a float would normally be expected.
''TokenNames'' marked ''{{Name|arma1|short}}'' were introduced from {{Name|ofpe|short}} and beyond.


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


==Arma Enhancement==
The magazines it declares are selected for use by specific ''cfgWeapons''.


Arma introduced a new root class, cfgMagazines.
Any given magazine can (obviously) only hold a specific ''cfgAmmo'' class.


The magazines it declares are selected for use by specific cfgWeapons
In contrast, {{Name|ofp|short}} uses a rather tedious construct in it is ''cfgWeapons'' class to distinguish between weapon and magazine parameters.


Any given magazine can (obviously) only hold a specific cfgAmmo class.
The major alterations here are:
{| class="wikitable"
|-
! {{Name|ofp|short}}              !! {{Name|arma1|short}}
|-
| {{hl|c= ammo=}}                  || moved to ''cfgMagazines''
|-
| {{hl|c= displayNameMagazine=}}    || moved to ''cfgMagazines'' and renamed ''DisplayName'' (of course)
|-
| {{hl|c= magazines[] = {"this"};}} || {{hl|c= magazines[] = {};}}
|-
| {{hl|c= magazineType=}}          || moved to ''cfgMagazines'' and renamed ''Type''
|-
| {{hl|c= maxLeadSpeed=}}          || moved to ''cfgMagazines''
|-
| {{hl|c= scopeWeapon=}}            || renamed ''scope''
|-
| {{hl|c= scopeMagazine=}}          || moved to ''cfgMagazines'' and renamed ''scope''
|-
| {{hl|c= shortNameMagazine=}}      || moved to ''cfgMagazines'' and renamed ''descriptionShort''?
|}
 
=== Modifications ===
Unlike it is ''cfgAmmo'' and ''cfgWeapon'' cousins: all bets are off. There is, a default class (the substance of this document), but it, and all other classes in ''cfgMagazines'' are deletable/erasable/modifiable.
 
Caution should be exercised about 'expected' default values when inheriting. ANY added ''pbo'' can alter them substantially before your very eyes.
 
;Warning
:Unlike {{Name|ofp|short}}, you cannot have the '''same''' {{hl|cfgMagazines.ClassName}}
:If you specify a rifle, and it is magazine with the same classname, the in-game gear selection dialog get's mightily confused. It's a noisy, awful display to begin with. Don't, make it worse.
 
== Alphabetical Order ==
{{ConfigPage|abc}}
=== A ===
==== ammo="" ====
;Type: [[TokenNameValueTypes|String]]
;Description: Name of the ''cfgAmmo'' class which this magazine holds.
 
<syntaxhighlight lang="cpp">
ammo = B_30mm_HE; //eg
</syntaxhighlight>


=== C ===
==== class InventoryPlacements{} ====
{{Wiki|stub}}


In contrast, OFP uses a rather tedious construct in it's cfgWeapons class to distinguish between weapon and magazine paramaters.
==== class Library ====
<syntaxhighlight lang="cpp">
class Library
{
    libTextDesc = "";
};
</syntaxhighlight>


The major alterations here are:
==== count=30 ====
;Type: [[TokenNameValueTypes|Integer]]
;Description: The amount of ammo this magazine holds.
 
=== D ===
==== descriptionShort="" ====
;Type: [[TokenNameValueTypes|String]]
;Description: The descriptive Name of the ammunition.
 
<syntaxhighlight lang="cpp">
descriptionShort = "$STR_SN_MAVERICK";
descriptionShort = "Beretta Ammo";
</syntaxhighlight>
 
==== displayName="" ====
;Type: [[TokenNameValueTypes|String]]
;Description: The descriptive Name of the magazine. In {{Name|ofp|short}}, this was called ''DisplayNameMagazine''.
 
==== displayNameMFDFormat="" ====
;Type: [[TokenNameValueTypes|String]]
;Description: Custom MFD name used by "ammoFormat" source. Example: displayNameMFDFormat = "A%1C", %1 for ammo count, %2 remaining mags count, %3 total mags count, %4 mag capacity. Example displayNameMFDFormat  = "HEAT";
 
==== deleteIfEmpty=-1"" ====
;Type: [[TokenNameValueTypes|Integer]]
;Description: Decides if magazine is automatically removed from inventory when ammo capacity is 0. 0 - never remove, 1 - always remove, -1 default behavior (auto detect, removes magazine when magazine capacity is 1 [count = 1] & magazine is empty). Default value is -1.
 
=== I ===
==== initSpeed=900 ====
;Type: [[TokenNameValueTypes|Integer]]
;Description: Starting speed of missile.
 
=== M ===
==== maxLeadSpeed = 23; ====
;Type: [[TokenNameValueTypes|Integer]]
 
==== model="\ca\weapons\mag_univ[.p3d]" ====
;Type: [[TokenNameValueTypes|String]]
;Description: The mag model. Identical to {{Name|ofp|short}}.
 
==== modelSpecial="[.p3d]" ====
;Type: [[TokenNameValueTypes|String]]
 
==== modelSpecialIsProxy="1" ====
;Type: [[TokenNameValueTypes|Integer]]
;Description: Controls if modelSpecial is using magazine proxy tech.
 
==== muzzleImpulseFactor[]={1.0,1.0} ====
;Type: [[TokenNameValueTypes|Float]] or [[TokenNameValueTypes|Array]]
;Description: Coefficient to recoil force (only on vehicles), which is calculated from ammo hit value & speed defined in magazine. Default value is 1. Can be defined as a float or an array (torque, force) {{Link|https://forums.bistudio.com/forums/topic/140837-development-branch-changelog/?do{{=}}findComment&comment{{=}}3241029|link}}.
muzzle Impulse applied when shooting is calculated by:  ''p = 0.25kg * (hit/13) * initSpeed * muzzleImpulseFactor[0] // initspeed in m/s, rest unitless.
 
=== N ===
==== nameSound="magazine" ====
;Type: [[TokenNameValueTypes|String]]
Category for radio protocol. (Use Missiles, Cannon etc.)


          OFP          ARMA
=== P ===
ammo=                 moved to cfgMagazines
==== picture="[\][[.pac]" ====
displayNameMagazine=   moved to cfgMagazines and renamed DisplayName (of course)
;Type: [[TokenNameValueTypes|String]]
magazines[] = {"this"};magazines[] = {};
;Description: Picture shown in gear for this mag. See ''cfgAmmo'' for warnings about picture paths.
magazineType=         moved to cfgMagazines and rennamed Type
maxLeadSpeed=         moved to cfgMagazines
minRange =             moved FROM cfgAmmo
minRangeProbab =
midRange =
midRangeProbab =
maxRange =  
maxRangeProbab =  
scopeWeapon=         renamed scope
scopeMagazine=        moved to cfgMagazines and rennamed scope
shortNameMagazine=    moved to cfgMagazines and rennamed descriptionShort?


=== R ===
==== reloadAction="ManActReloadMagazine" ====
;Type: [[TokenNameValueTypes|String]]


==Modifications==
=== S ===
==== scope=protected ====
;Type: [[TokenNameValueTypes|Integer]]
;Description: {{Name|ofp|short}} name was ''ScopeMagazine''.
Values: {{hl|private}}, {{hl|protected}}, {{hl|public}}.


unlike it's cfgAmmo and cfgWeapon cousins: all bets are off. There is, a default class (the substance of this document), but it, and all other classes in cfgMagazines are deleteable/erasable/modifiable.
==== selectionFireAnim="zasleh" ====
;Type: [[TokenNameValueTypes|String]]


Caution should be excercised about 'expected' default values when inheriting. ANY added pbo can alter them substantially beofre your very eyes.
==== simulation="ProxyMagazines" ====
;Type: [[TokenNameValueTypes|String]]


===Warning===
=== T ===
==== type=256 ====
;Type: [[TokenNameValueTypes|Integer]]
;Description: {{Name|ofp|short}} name was ''MagazineType''. See ''cfgWeapons'' for the CHANGES between {{Name|ofp|short}} and {{Name|arma1|short}} for this value.


Unlike OFP, you cannot have the '''same''' cfgMagazines.ClassName
=== U ===
==== useAction=0 ====
;Type: [[TokenNameValueTypes|Integer]]


If you specify a rifle, and it's magazine with the same classname, the in-game gear selection dialog get's mightily confused. It's a noisy, awful display to begin with. Don't, make it worse.
==== useActionTitle="" ====
;Type: [[TokenNameValueTypes|String]]


=== V ===
==== value=1 ====
;Type: [[TokenNameValueTypes|Integer]]
;Description: Formerly known as ''ValueMagazine'' in {{Name|ofp|short}}.


=Alphabetic Order=
=== W ===
==== weight=0 ====
;Type: [[TokenNameValueTypes|Integer]]


==ammo=""==
== Additional Values ==
[[TokenNameValueTypes|String]]Name of the cfgAmmo class which this magazine holds
Because just about anything can be added to these classes it is not overly useful to attempt to define most of them. For whatever reason, and unlike other root classes, the engine doesn't need these tokens declared in {{hl|default{}}}.


ammo=B_30mm_HE; //eg
==== lastRoundsTracer=4 ====
==class InventoryPlacements{}==
{{Wiki|stub}}
==class Library==
  class Library
  {
  libTextDesc = "";
  };
==count=30==
[[TokenNameValueTypes|Integer]]: the amount of ammo this magazine holds
==descriptionShort=""==
[[TokenNameValueTypes|String]]: The descriptive Name of the ammunition
descriptionShort=$STR_SN_MAVERICK;
descriptionShort="Beretta Ammo";


==displayName=""==
==== tracersEvery=4 ====
[[TokenNameValueTypes|String]]: The descriptive Name of the magzine.
;Type: [[TokenNameValueTypes|Integer]]
In ofp, this was called DisplayNameMagazine.
;Description: Sets the interval between tracers.
==initSpeed=900==
[[TokenNameValueTypes|Integer]]: Starting speed of missile
==maxLeadSpeed = 23;
[[TokenNameValueTypes|Integer]]:
==model="\ca\weapons\mag_univ[.p3d]"==
[[TokenNameValueTypes|String]]: The mag model
identical to ofp
==modelSpecial="[.p3d]"==
[[TokenNameValueTypes|String]]:
==nameSound="magazine"==
[[TokenNameValueTypes|String]]:
==picture="[\][[.pac]"==
[[TokenNameValueTypes|String]]: picture shown in gear for this mag. See cfgAmmo for warnings about picture paths
==reloadAction="ManActReloadMagazine"==
[[TokenNameValueTypes|String]]:  
==scope=protected==
[[TokenNameValueTypes|Integer]]:
values
private
protected
public
Ofp name was ScopeMagazine
selectionFireAnim="zasleh"==
[[TokenNameValueTypes|String]]:  
==simulation="ProxyMagazines"==
[[TokenNameValueTypes|String]]:
==type=256==
[[TokenNameValueTypes|Integer]]:
OFP name was MagazineType
See cfgWeapons for the CHANGES between ofp and arma for this value
==useAction=0==
[[TokenNameValueTypes|Integer]]:
==useActionTitle=""==
[[TokenNameValueTypes|String]]:
==value=1==
[[TokenNameValueTypes|Integer]]:
Formerly known as ValueMagzine in ofp
==weight=0==
[[TokenNameValueTypes|Integer]]:


=additonal values=


because just about anything can be added to these classes it is not overly useful to attempt to define most of them of them. Fro whatver reason, and unlike other root classes, the engine doesn't need these tokens declared in default{}
{{ConfigPage|end}}


==tracersEvery=4==
==lastRoundsTracer=4==


[[category:Operation Flashpoint: Editing]]
{{GameCategory|ofp|Editing}}
[[Category:ArmA: Addon Configuration]]
{{GameCategory|arma1|Addon Configuration}}

Latest revision as of 18:20, 28 April 2023

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 inherent in the game or provided by oem.

cfgAmmo defines the missile 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.

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.

Default values are shown in the legend. They come from the derived class CA_Magazine rather than the true default{} since almost everything derives from this class.

Nearly all values are identical to their OFP equivalent.

Note that engines will accept integer values (or math strings) where a float would normally be expected.

TokenNames marked ArmA were introduced from OFP:E and beyond.

Arma Enhancement

Arma introduced a new root class, cfgMagazines.

The magazines it declares are selected for use by specific cfgWeapons.

Any given magazine can (obviously) only hold a specific cfgAmmo class.

In contrast, OFP uses a rather tedious construct in it is cfgWeapons class to distinguish between weapon and magazine parameters.

The major alterations here are:

OFP ArmA
ammo= moved to cfgMagazines
displayNameMagazine= moved to cfgMagazines and renamed DisplayName (of course)
magazines[] = {"this"}; magazines[] = {};
magazineType= moved to cfgMagazines and renamed Type
maxLeadSpeed= moved to cfgMagazines
scopeWeapon= renamed scope
scopeMagazine= moved to cfgMagazines and renamed scope
shortNameMagazine= moved to cfgMagazines and renamed descriptionShort?

Modifications

Unlike it is cfgAmmo and cfgWeapon cousins: all bets are off. There is, a default class (the substance of this document), but it, and all other classes in cfgMagazines are deletable/erasable/modifiable.

Caution should be exercised about 'expected' default values when inheriting. ANY added pbo can alter them substantially before your very eyes.

Warning
Unlike OFP, you cannot have the same cfgMagazines.ClassName
If you specify a rifle, and it is magazine with the same classname, the in-game gear selection dialog get's mightily confused. It's a noisy, awful display to begin with. Don't, make it worse.

Alphabetical Order

A

ammo=""

Type
String
Description
Name of the cfgAmmo class which this magazine holds.
ammo = B_30mm_HE; //eg

C

class InventoryPlacements{}

class Library

class Library
{
    libTextDesc = "";
};

count=30

Type
Integer
Description
The amount of ammo this magazine holds.

D

descriptionShort=""

Type
String
Description
The descriptive Name of the ammunition.
descriptionShort = "$STR_SN_MAVERICK";
descriptionShort = "Beretta Ammo";

displayName=""

Type
String
Description
The descriptive Name of the magazine. In OFP, this was called DisplayNameMagazine.

displayNameMFDFormat=""

Type
String
Description
Custom MFD name used by "ammoFormat" source. Example: displayNameMFDFormat = "A%1C", %1 for ammo count, %2 remaining mags count, %3 total mags count, %4 mag capacity. Example displayNameMFDFormat = "HEAT";

deleteIfEmpty=-1""

Type
Integer
Description
Decides if magazine is automatically removed from inventory when ammo capacity is 0. 0 - never remove, 1 - always remove, -1 default behavior (auto detect, removes magazine when magazine capacity is 1 [count = 1] & magazine is empty). Default value is -1.

I

initSpeed=900

Type
Integer
Description
Starting speed of missile.

M

maxLeadSpeed = 23;

Type
Integer

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

Type
String
Description
The mag model. Identical to OFP.

modelSpecial="[.p3d]"

Type
String

modelSpecialIsProxy="1"

Type
Integer
Description
Controls if modelSpecial is using magazine proxy tech.

muzzleImpulseFactor[]={1.0,1.0}

Type
Float or Array
Description
Coefficient to recoil force (only on vehicles), which is calculated from ammo hit value & speed defined in magazine. Default value is 1. Can be defined as a float or an array (torque, force) link.

muzzle Impulse applied when shooting is calculated by: p = 0.25kg * (hit/13) * initSpeed * muzzleImpulseFactor[0] // initspeed in m/s, rest unitless.

N

nameSound="magazine"

Type
String

Category for radio protocol. (Use Missiles, Cannon etc.)

P

picture="[\][[.pac]"

Type
String
Description
Picture shown in gear for this mag. See cfgAmmo for warnings about picture paths.

R

reloadAction="ManActReloadMagazine"

Type
String

S

scope=protected

Type
Integer
Description
OFP name was ScopeMagazine.

Values: private, protected, public.

selectionFireAnim="zasleh"

Type
String

simulation="ProxyMagazines"

Type
String

T

type=256

Type
Integer
Description
OFP name was MagazineType. See cfgWeapons for the CHANGES between OFP and ArmA for this value.

U

useAction=0

Type
Integer

useActionTitle=""

Type
String

V

value=1

Type
Integer
Description
Formerly known as ValueMagazine in OFP.

W

weight=0

Type
Integer

Additional Values

Because just about anything can be added to these classes it is not overly useful to attempt to define most of them. For whatever reason, and unlike other root classes, the engine doesn't need these tokens declared in default{}.

lastRoundsTracer=4

tracersEvery=4

Type
Integer
Description
Sets the interval between tracers.