CfgVehicles Config Reference

From Bohemia Interactive Community
Jump to navigation Jump to search

Introduction

Addon Command Reference

This article details the token-verbs available in Config.cpp for addons created in Operation Flashpoint, the Resistence upgrade, and Elite. If it is not closer determined where to use a command, you can use it in CfgVehicles.

Legend:

INTEGER: A signed value to 65k.

BOOLEAN: An Integer value of 0 or 1

ARRAY: An array []=

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;
accuracy

Integer:

accuracy = 0.500000;
armor

Float: A strength value of how much external damage can be taken before 'destruction'.

  armor = 1.400000; // a bee
  armor = 50; // a helicopter
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;
castGunnerShadow

Boolean: part of Turret class

   castGunnerShadow = 1;
castDriverShadow

Boolean:

   castDriverShadow = 1;
crew

String: Reflects wether vehicle is manned, and what.

    crew = "SoldierWPilot";
commanding

Integer: part of Turret class

    commanding = -1;
cost

Integer: This value reflects the attractiveness of the target to the enemu ai. _when_ all other considerations are equal. A soldier eg is not interested in Air, despite it's highly attractive cost values. On the other hand, he is interested in a medic, since a medic (in normal configs) has a (whiel small) a higher cost, than others in the group, including the officer.

    cost = 10000000;// an air vehicle is tyoically this value
cost = 8; // a medic;
cost = 1; // a grunt
cost = 4; // an officer
cost = 0; // most buildings;



D


dammageHalf

Array: of varable number of strings

 dammageHalf[] = {"\AnyAddon\AnyPAA.paa","\AnyAddon\AnyOtherPAA.paa", ...};

When 'vehicle' is considered at least half way to destruction, the series of pictures is applied to the model.

dammageFull

Array: of varable number of strings

 dammageFull[] = {"\AnyAddon\AnyPAA.paa","\AnyAddon\AnyOtherPAA.paa", ...};

see #dammageHalf for the self evident difference.

displayName

String: This value is used to select the unit in the Mission Editor, as well as when pointing your team to an object in the game.

Ordinaruly it is good practice to acess the stringtable.csv that accompanies the addont so that

  1. all names and labels are in one place
  2. for language differences
displayName = "$STR_DN_AH1Z";
driverAction

String:

 driverAction = "ManActTestDriver";


F


fired

String:

fired = "_this exec ""\AnyAddon\AnySQS.sqs"""; // note the ""
flySound

Used in: cfgNonAiVehicles

Array:

flySound[] = {"\AddonName\AnySound.wss",0.000000,1,1};

Note: String can be empty, eg. ""



G


gunnerAction

String:

   gunnerAction = "ManActAH1Gunner";
gunnerOpticsModel

String: part of NewTurret class

   gunnerOpticsModel = "\AnyAddon\AnyP3d(.p3d)";


I


icon

String:

This value us used exclusively by the map editor to show the building or vehicle when editing. It is not normally visible during game play.

The icon can be any jpg, paa, or pac file. paa is default.

 icon = "\AnyAddon\AnyPAA(.paa)";
init

String:

  init = "[(_this select 0)] exec ""\AnyAddon\AnySqs.sqs"""; // note the ""


K


killed

String:

  killed = "[(_this select 0),1,1,0,0] exec ""\AnyAddon\AnySQS.sqs""";// note the ""


L


laserscanner

Boolean: Determines if a vehicle has laser capability.

 laserScanner = true;
library

String: This TokenName is associated with the library class of a vehicle (if any). It is used to give a 'memo' style full screen info on the given object. Example of use:

 class Library
 {
  libTextDesc = "$STR_LIB_AH1Z";
 };


M


magazines

Array: variable strings

  magazines[] = {"750Rnd_M197_AH1","38Rnd_FFAR","8Rnd_Hellfire"};
material

Integer:

  material = 50;
mainRotorSpeed

Integer:

mainRotorSpeed = -1;
maxCargoAngleY

Integer: In Degrees. see #minCargoAngleY

 maxCargoAngleY = 120;
minCargoAngleY

Integer: In Degrees. see #maxCargoAngleY

 minCargoAngleY = -60;
maxElev

Integer: signed degrees max angle of elevation. See #minElec

   maxElev = 10;
maxHeight

Used in: cfgNonAiVehicles

Integer: max height above sea level. See #avgHeight , #minHeight

maxHeight = 50;
maxSpeed

Integer: In kph.

maxSpeed = 20;
maxTurn

Integer: signed degrees max angle of turning. See #minTurn

   maxTurn = 70;
minElev

Integer: Signed degrees see #maxElev

minElev = -60;
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
minTurn

Integer: signed degrees angle of turning. See #maxTurn

   minTurn= -70;
memoryPointsGetInGunner

String:

   memoryPointsGetInGunner = "pos gunner";
memoryPointsGetInGunnerDir

String:

   memoryPointsGetInGunnerDir = "pos gunner dir";
memoryPointsGetInDriver

String:

   memoryPointsGetInDriver = "pos_driver";
memoryPointsGetInDriverDir

String:

   memoryPointsGetInDriverDir = "pos_driver_dir";
memoryPointGun

String:

   memoryPointGun = "machinegun";
memoryPointGunnerOptics

String:

   memoryPointGunnerOptics = "gunnerview";
memoryPointLMissile

String:

   memoryPointLMissile = "Missile_1";
memoryPointRMissile

String:

   memoryPointRMissile = "Missile_2";
memoryPointLRocket

String:

   memoryPointLRocket = "Rocket_1";
memoryPointRRocket

String:

   memoryPointRRocket = "Rocket_2";
model

String: Location in the addon where the p3d model resides. Can be subfolder

model = "\AddonName\anyp3d(.p3d)"; // can be ""




N


name

String:

  name = "motor";

nameSound

String: Namesound is used by the AI audio to indicate verbally where to go, what 'vehicle' to attack. This the audio speech "move to 'rock' 3 o'clock' is derived from the namesound.

nameSound = "rock";

typically, a collection of buildings (eg) will be configured as follows

class GenBuilding : NonStrategic
{
  scope=private; // internal use only
  VehicleClass="Some Editor Group Name";
  namesound="house";
};
class YellowBuilding: GenBuilding
{
  scope=public;
  name="YellowBuilding";
  model="Some yellow building.p3d";
};




O


outGunnerMayFire

Boolean: partof NewTurrent class

 outGunnerMayFire = 1;


P


passThrough

Boolean:

 passThrough = 1;
picture

String: I think this is for briefing Information icon click

 picture = "\AnyAddon\AnyPAA(.paa)";
primary

Boolean: For models that can have, (but don't necessarily do have) multiple internal objects of the same type (turrets eg). One of them, is declated the main, or primary turret. There may indeed be only one 'turret'.

  primary = true;


R


reversed

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;
rotorBig

String:

 rotorBig = "vrtule_velka";
rotorBigBlend

String:

 rotorBigBlend = "vrtule_velka_bl";
rotorSmall

String:

 rotorSmall = "vrtule_mala";
rotorSmallBlend

String:

 rotorSmallBlend = "vrtule_mala_bl";

S


scope

Used in: cfgNonAiVehicles

INTEGER:

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.


selectionFireAnim=

String:

selectionFireAnim = "muzzleflash";
selectionHRotorStill=

String:

selectionHRotorStill= "mainRotorStatic";
selectionHRotorMove=

String:

selectionHRotorMove = "mainRotorBlurred";
selectionVRotorStill=

String:

selectionVRotorStill = "tailRotorStatic";
selectionVRotorMove=

String:

selectionVRotorMove = "tailRotorBlurred";
side

Integer: The side, when declared, sets the 'vehicle' on east west resistance civilian. The effect differs according to the 'vehicle' itself. Eg soldiers, versus hospitals or repair trucks that can only be used by same side, if specifically sided.

Well written missions (and configs) use defines at top of file to make this more legible.

#define WEST 0
#define EAST 1
#define CIVILIAN 2
#define NOSIDE 3
etc...
 side = EAST;
simulation

STRING: The engine behaviour with this #model.

simulation = "SeaGull";// campfire,house, etc
soundEngine

Array:

 soundEngine[] = {"\AnyAddon\AnySound(.wss)",5.623414,1};
soundEnviron

Array:

 soundEnviron[] = {"\AnyAddon\AnySound(.wss)",0.100000,1.000000};
soundCrash

Array:

 soundCrash[] = {"\AnyAddon\AnySound(.wss)",0.010000,1};
soundDammage

Array:

 soundDammage[] = {"\AnyAddon\AnySound(.wss)",0.010000,1};
soundGetOut

Array:

 soundGetOut[] = {"\AnyAddon\AnySound(.wss)",0.010000,1};
soundLandCrash

Array:

 soundLandCrash[] = {"\AnyAddon\AnySound(.wss)",0.010000,1};
soundServo

Array:

 soundServo[] = {"\AnyAddon\AnySound(.wss)",0.100000,1.000000};
soundWaterCrash

Array:

 soundWaterCrash[] = {"\AnyAddon\AnySound(.wss)",0.010000,1};
source

String: found in animationSources

   source = "reload";
singSound

Used in: cfgNonAiVehicles

ARRAY: normally for a bird

singSound[] = {"\AddonName\SoundFile.ogg",0.031623,1,1};
straightDistance

Used in: cfgNonAiVehicles

INTEGER:

straightDistance = 50;


T


turning

Used in: cfgNonAiVehicles

BOOLEAN: (i think)

turning = 1;
threat

Array: This three element array reperesents the threat this 'vehicle' has to the enemy ai.

The 3 components of the 'threat' are land threat, air threat, sea threat. In the exampe below for a cobra. It is not too dangerous for land 'vehicles' (men and machines) bit deadly against other air vehicles and nasty to boats.

The ai for this model selects targets of opportunity, based on these values.

 threat[] = {0.300000,1,0.800000};
type

Integer:

 type = 2;


V


viewGunnerShadow

Boolean: part of Turret class

  viewGunnerShadow = 1;


W


weapon

String: found in animationSources

   weapon = "M197";
weapons[]

Array: an array of selectable weaponry for the given 'vehicle'

  weapons[] = {"FFARLauncher","TwinM134"};