CfgVehicles Config Reference: Difference between revisions
No edit summary |
No edit summary |
||
Line 5: | Line 5: | ||
This article details the token-verbs available in [[Config.cpp]] for addons created in Operation FlashPoint, the Resistence upgrade, and of course, Elite. | This article details the token-verbs available in [[Config.cpp]] for addons created in Operation FlashPoint, the Resistence upgrade, and of course, Elite. | ||
<u>Legend:</u> | <u>Legend:</u> | ||
Line 20: | Line 19: | ||
------- | ------- | ||
=== | ===General=== | ||
<hr> | <hr> | ||
====A==== | ====A==== | ||
=====airFriction===== | =====airFriction===== | ||
Used in: cfg'''Non'''AiVehicles | |||
''[[Array|ARRAY]]:'' 3 separate tokens, airFriction0[],airFriction1[],airFriction2[] that define the X Y and Z component respectively. | ''[[Array|ARRAY]]:'' 3 separate tokens, airFriction0[],airFriction1[],airFriction2[] that define the X Y and Z component respectively. | ||
airFriction2[] = {25,12,2.500000}; | airFriction2[] = {25,12,2.500000}; | ||
=====acceleration===== | |||
Used in: cfg'''Non'''AiVehicles | |||
''[[Number|INTEGER]]:'' metres per second | ''[[Number|INTEGER]]:'' metres per second | ||
acceleration = 7; | acceleration = 7; | ||
=====avgHeight===== | =====avgHeight===== | ||
Used in: cfg'''Non'''AiVehicles | |||
''[[Number|INTEGER]]: ''height in metres above sealevel. See [[#minHeight]] , [[#maxHeight]] | ''[[Number|INTEGER]]: ''height in metres above sealevel. See [[#minHeight]] , [[#maxHeight]] | ||
avgHeight = 10; | avgHeight = 10; | ||
<hr> | |||
====B==== | ====B==== | ||
<hr> | <hr> | ||
====C==== | ====C==== | ||
=====canBeShot===== | =====canBeShot===== | ||
Used in: cfg'''Non'''AiVehicles | |||
''[[Boolean|BOOLEAN]]:'' Declares whether bullets have any effect | ''[[Boolean|BOOLEAN]]:'' Declares whether bullets have any effect | ||
canBeShot = 1; | canBeShot = 1; | ||
Line 46: | Line 50: | ||
====F==== | ====F==== | ||
=====flySound===== | =====flySound===== | ||
Used in: cfg'''Non'''AiVehicles | |||
'''[[Array|ARRAY]]:''' | '''[[Array|ARRAY]]:''' | ||
flySound[] = {"\AddonName\AnySound.wss",0.000000,1,1}; | flySound[] = {"\AddonName\AnySound.wss",0.000000,1,1}; | ||
Line 55: | Line 61: | ||
<hr> | <hr> | ||
=====maxHeight===== | =====maxHeight===== | ||
Used in: cfg'''Non'''AiVehicles | |||
''[[Number|INTEGER]]:'' max height above sea level. See [[#avgHeight]] , [[#minHeight]] | ''[[Number|INTEGER]]:'' max height above sea level. See [[#avgHeight]] , [[#minHeight]] | ||
maxHeight = 50; | maxHeight = 50; | ||
=====maxSpeed===== | |||
Used in: cfg'''Non'''AiVehicles | |||
''[[Number|INTEGER]]:'' In kph. | ''[[Number|INTEGER]]:'' In kph. | ||
maxSpeed = 20; | maxSpeed = 20; | ||
=====minHeight===== | =====minHeight===== | ||
Used in: cfg'''Non'''AiVehicles | |||
''[[Number|INTEGER]]:'' Min height in metres above sealevel. See [[#avgHeight]] , [[#maxHeight]] | ''[[Number|INTEGER]]:'' Min height in metres above sealevel. See [[#avgHeight]] , [[#maxHeight]] | ||
minHeight = 5; | minHeight = 5; | ||
=====minSpeed===== | |||
Used in: cfg'''Non'''AiVehicles | |||
''[[Number|INTEGER]]:'' In Kph. | ''[[Number|INTEGER]]:'' In Kph. | ||
minSpeed = -0.500000; range 0->1 | minSpeed = -0.500000; range 0->1 | ||
=====model===== | =====model===== | ||
Used in: cfg'''Non'''AiVehicles | |||
''[[String|STRING]]:'' Location in the addon where the p3d model resides. Can be subfolder | ''[[String|STRING]]:'' Location in the addon where the p3d model resides. Can be subfolder | ||
model = "\AddonName\anyp3d"; // can be "" | model = "\AddonName\anyp3d"; // can be "" | ||
<hr> | <hr> | ||
====R==== | |||
<hr> | |||
Used in: cfg'''Non'''AiVehicles | |||
''[[Boolean|BOOLEAN]]:'' Normally, models ARE reversed with respect to how they present on the screen after editing with tools like oxygen (eg) This overrides the default. See [[#model]] | ''[[Boolean|BOOLEAN]]:'' Normally, models ARE reversed with respect to how they present on the screen after editing with tools like oxygen (eg) This overrides the default. See [[#model]] | ||
reversed = 0; | reversed = 0; | ||
<hr> | <hr> | ||
====S==== | ====S==== | ||
<hr> | <hr> | ||
=====scope===== | =====scope===== | ||
Used in: cfg'''Non'''AiVehicles | |||
''[[Number|INTEGER]]:'' | ''[[Number|INTEGER]]:'' | ||
Line 130: | Line 146: | ||
Any classes declared public are CamCreateabale, '''and''' selectable via the Editor. | Any classes declared public are CamCreateabale, '''and''' selectable via the Editor. | ||
<hr> | <hr> | ||
=====simulation===== | =====simulation===== | ||
Used in: cfg'''Non'''AiVehicles | |||
''[[String|STRING]]: '' The engine behaviour with this [[#model]]. | ''[[String|STRING]]: '' The engine behaviour with this [[#model]]. | ||
simulation = "SeaGull";// campfire,house, etc | simulation = "SeaGull";// campfire,house, etc | ||
=====singSound===== | =====singSound===== | ||
Used in: cfg'''Non'''AiVehicles | |||
''[[Array|ARRAY]]:'' normally for a bird | ''[[Array|ARRAY]]:'' normally for a bird | ||
singSound[] = {"\AddonName\SoundFile.ogg",0.031623,1,1}; | singSound[] = {"\AddonName\SoundFile.ogg",0.031623,1,1}; | ||
=====straightDistance===== | |||
Used in: cfg'''Non'''AiVehicles | |||
''[[Number|INTEGER]]:'' | ''[[Number|INTEGER]]:'' | ||
straightDistance = 50; | straightDistance = 50; | ||
<hr> | <hr> | ||
====T==== | ====T==== | ||
=====turning===== | =====turning===== | ||
Used in: cfg'''Non'''AiVehicles | |||
''[[Boolean|BOOLEAN]]:'' (i think) | ''[[Boolean|BOOLEAN]]:'' (i think) | ||
turning = 1; | turning = 1; | ||
<hr> | <hr> |
Revision as of 10:05, 30 June 2006
Introduction
Addon Command Reference
This article details the token-verbs available in Config.cpp for addons created in Operation FlashPoint, the Resistence upgrade, and of course, Elite.
Legend:
INTEGER: A signed, value to 65k.
BOOLEAN: An Integer value of 0, or 1
ARRAY: An arrey[]=
STRING: Any string value. ALL STRINGS MUST BE ENCLOSED IN QUOTES for Elite. These strings are misinterpreted as #defines otherwise.
Notes: For Models and other items using p3d files, the .p3d extension is not reguired. Similar comment for pac/paa files, and wss (sound) files where appropriate
General
A
airFriction
Used in: cfgNonAiVehicles
ARRAY: 3 separate tokens, airFriction0[],airFriction1[],airFriction2[] that define the X Y and Z component respectively.
airFriction2[] = {25,12,2.500000};
acceleration
Used in: cfgNonAiVehicles
INTEGER: metres per second
acceleration = 7;
avgHeight
Used in: cfgNonAiVehicles
INTEGER: height in metres above sealevel. See #minHeight , #maxHeight
avgHeight = 10;
B
C
canBeShot
Used in: cfgNonAiVehicles
BOOLEAN: Declares whether bullets have any effect
canBeShot = 1;
F
flySound
Used in: cfgNonAiVehicles
flySound[] = {"\AddonName\AnySound.wss",0.000000,1,1};
Note: String can be empty, eg. ""
M
maxHeight
Used in: cfgNonAiVehicles
INTEGER: max height above sea level. See #avgHeight , #minHeight
maxHeight = 50;
maxSpeed
Used in: cfgNonAiVehicles
INTEGER: In kph.
maxSpeed = 20;
minHeight
Used in: cfgNonAiVehicles
INTEGER: Min height in metres above sealevel. See #avgHeight , #maxHeight
minHeight = 5;
minSpeed
Used in: cfgNonAiVehicles
INTEGER: In Kph.
minSpeed = -0.500000; range 0->1
model
Used in: cfgNonAiVehicles
STRING: Location in the addon where the p3d model resides. Can be subfolder
model = "\AddonName\anyp3d"; // can be ""
R
Used in: cfgNonAiVehicles
BOOLEAN: Normally, models ARE reversed with respect to how they present on the screen after editing with tools like oxygen (eg) This overrides the default. See #model
reversed = 0;
S
scope
Used in: cfgNonAiVehicles
scope = public;
Scope in concept is the same as the C++ reserved words of public, protected and private.
defines normally exist at the top of a well written config.cpp to make meanings clearer.
#define private 0 #define protected 1 #define public 2
The meaning of each is as follows
private:
only other classes within the same config cpp can access, or 'inherit' this class.
protected:
Identical to public, except the class will not be listed in the mission editor. A very common form of use for this is
class vegetables { scope=protected; VehicleClass="Vegetables. namesound= whatever; icon= "vegetableIcon.paa"; /// put any other common characteristics in here }; class GreenOnions : vegetables { scope = public; name="Green Onion; } class PurpleOnion : vegetables { ....
The effect here is to reduce (considerably) not only the amount of tyoing, but memory storage too. It is only the public classes that are listed in the editor, and this, you would expect, that each one of these has a separate name=, wheras, they are ALL grouped' in the Editor's 'Vegetables'
Protected classes are CamCreatble in the mission.sqm.
Protected classes are immensely useful to 'hide' obsolete models that are still required to maintain compatibility with older missions.
public:
Any classes declared public are CamCreateabale, and selectable via the Editor.
simulation
Used in: cfgNonAiVehicles
STRING: The engine behaviour with this #model.
simulation = "SeaGull";// campfire,house, etc
singSound
Used in: cfgNonAiVehicles
ARRAY: normally for a bird
singSound[] = {"\AddonName\SoundFile.ogg",0.031623,1,1};
straightDistance
Used in: cfgNonAiVehicles
straightDistance = 50;
T
turning
Used in: cfgNonAiVehicles
BOOLEAN: (i think)
turning = 1;