Model Config: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(added description of userPositionHashedInit animation source)
m (Text replacement - " it's" to " it is")
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
===Description===
{{SideTOC}}
 
The model configuration file (model cfg for short) is the interface between a (P3D) model and the program.<br>
The model configuration file (model cfg for short) is the interface between a (P3D) model and the program.<br />
It is a look-up table which is processed during the binarization process, to tell the program what the various sections of the model are, which skeleton it uses and how it is animated.
It is a look-up table which is processed during the binarization process, to tell the program what the various sections of the model are, which skeleton it uses and how it is animated.


This system is more flexible than the one previously used, because all the information is stored for the model and not for the object class in the main configuration file. This means that several object classes can use the same model and don't have to define the animations for this model seperately.
This system is more flexible than the one previously used, because all the information is stored for the model and not for the object class in the main configuration file. This means that several object classes can use the same model and don't have to define the animations for this model seperately.


A goal of the system is to seperate the configuration of models into a designer and an artist part.<br />
A goal of the system is to seperate the configuration of models into a designer and an artist part.<br>
This is done by the introduction of a class [[#AnimationSources|AnimationSources]] in the main configuration file (the designer part) and the continuing use of the class <i>Animations</i> in the model cfg (the artist part).
This is done by the introduction of a class [[#AnimationSources|AnimationSources]] in the main configuration file (the designer part) and the continuing use of the class ''Animations'' in the model cfg (the artist part).


Most models will be able to inherit definitions from basic definitions on higher levels in the data hierarchy. An example hierarchy is described and illustrated below.
Most models will be able to inherit definitions from basic definitions on higher levels in the data hierarchy. An example hierarchy is described and illustrated below.


<i>p:\ofp2\vehicles\model.cfg</i> - Defines a class <i>Default</i>.<br />
* <tt>p:\ofp2\vehicles\model.cfg</tt> - Defines a class <tt>Default</tt>.
<i>p:\ofp2\vehicles\land\wheeled\model.cfg</i> - Defines a class <i>Car</i>.<br />
* <tt>p:\ofp2\vehicles\land\wheeled\model.cfg</tt> - Defines a class <tt>Car</tt>.
<i>p:\ofp2\vehicles\land\wheeled\landrover\model.cfg</i> - Defines a class <i>LandRover</i>.<br /><br />
* <tt>p:\ofp2\vehicles\land\wheeled\landrover\model.cfg</tt> - Defines a class <tt>LandRover</tt>.


<i>p:\ofp2\vehicles\land\wheeled\landrover\lr6x6_3</i> - In the model is a property <i>config=LandRover</i> (this feature is not implemented and may never be).<br />
* <tt>p:\ofp2\vehicles\land\wheeled\landrover\lr6x6_3</tt> - In the model is a property <tt>config = LandRover</tt> (this feature is not implemented and may never be).
<i>p:\ofp2\vehicles\land\wheeled\landrover\lr6x6_mg240</i> - Has a <i>LR6x6_MG240.cfg</i>, which inherits from class <i>LandRover</i> and adds definitions for a turret.
* <tt>p:\ofp2\vehicles\land\wheeled\landrover\lr6x6_mg240</tt> - Has a <tt>LR6x6_MG240.cfg</tt>, which inherits from class <tt>LandRover</tt> and adds definitions for a turret.
 
[[Image:ModelCfg1.jpg|Sample tree hierarchy]]


=== Notes ===


[[Image:ModelCfg1.jpg|Sample tree hierarchy]]
At this stage the file is parsed during the binarization of a model and animations can be played in the program with user actions.
Eventually they can be previewed using the Buldozer viewer.


The model cfg follows a set of naming conventions.
There can be several model cfg files, named by default <tt>model.cfg</tt>, named after the folder name or named after a specific model.
In the case that both a <tt>model.cfg</tt> and <tt>&lt;foldername&gt;.cfg</tt> are present, only the latter is parsed.
The <tt>&lt;modelname&gt;.cfg</tt> is parsed alongside of the other model cfg files and therefore the model can be seen as an additional level in the hierarchy.


===Notes===
When we have an example folder called <tt>humr</tt> with a model called <tt>hmmwv.p3d</tt>, we can use the following names: <tt>model.cfg</tt> or <tt>humr.cfg</tt> and next to that a <tt>hmmwv.cfg</tt>.


At this stage the file is parsed during the binarization of a model and animations can be played in the program with user actions. Eventually they can be previewed using the Buldozer viewer.
In the future a model may support a named property called <tt>config</tt>, which tells the model which class in the model cfg to use.
There is some doubt whether this feature will be implemented though.


The model cfg follows a set of naming conventions. There can be several model cfg files, named by default <i>model.cfg</i>, named after the folder name or named after a specific model. In the case that both a <i>model.cfg</i> and <i>&lt;foldername&gt;.cfg</i> are present, only the latter is parsed. The <i>&lt;modelname&gt;.cfg</i> is parsed alongside of the other model cfg files and therefore the model can be seen as an additional level in the hierarchy.
There are model cfg files that do not relate directly to a specific model, but are used for the generic base class definitions, such as class <tt>Default</tt>.


When we have an example folder called <i>humr</i> with a model called <i>hmmwv.p3d</i>, we can use the following names: <i>model.cfg</i> or <i>humr.cfg</i> and next to that a <i>hmmwv.cfg</i>.
The functionality of the animations has been extended, allowing to do in scripting what was done before using RTM animations.
In addition, animation [[#Animation_sources|controllers]] were introduced, which allow for the control of different animations at the same time.
This opens up possibilities like having several turrets on a tank.


In the future a model may support a named property called <i>config</i>, which tells the model which class in the model cfg to use. There is some doubt whether this feature will be implemented though.
The model cfg and main configuration file (where classes <tt>[[#cfgModels|cfgModels]]</tt>, <tt>[[#cfgSkeletons|cfgSkeletons]]</tt> and <tt>[[#Animations|Animations]]</tt> were previously defined) operate together to smooth the change from the old to the new system.
When a model cfg and the main configuration file both define the same model, the model cfg takes precedence.


There are model cfg files that do not relate directly to a specific model, but are used for the generic base class definitions, such as class <i>Default</i>.
=== Segments ===
The functionality of the animations has been extended, allowing to do in scripting what was done before using RTM animations.
In addition, animation [[#Animation_sources|controllers]] were introduced, which allow for the control of different animations at the same time. This opens up possibilities like having several turrets on a tank.


The model cfg and main configuration file (where classes <i>[[#cfgModels|cfgModels]]</i>, <i>[[#cfgSkeletons|cfgSkeletons]]</i> and <i>[[#Animations|Animations]]</i> were previously defined) operate together to smooth the change from the old to the new system. When a model cfg and the main configuration file both define the same model, the model cfg takes precedence.
==== cfgModels ====
This segment defines all properties of each model. The class names correspond to the model name.<br>
Here you define which sections the model has, which skeleton it uses and its animations.
<syntaxhighlight lang="cpp">
// Declare base classes
class CarAnimations
{
class IndicatorSpeed;
};
</syntaxhighlight>


<syntaxhighlight lang="cpp">
class CfgModels
{
class Car; // Declare base class.


===Segments===
class Vodnik: Car
{
sectionsInherit = "Car"; // Inherit all sections from class Car.
// Add new section.
sections[] =
{
"section1"
};
skeletonName = "Vodnik"; // Use the Vodnik skeleton.


class Animations: CarAnimations // Inherit from generic animations.
====cfgModels====
{
class IndicatorSpeed: IndicatorSpeed // Redefine the maximum value
{ // for the speed indicator.
maxValue = 40;
};
};
};
};
</syntaxhighlight>


This segment defines all properties of each model. The class names correspond to the model name.<br />
==== cfgSkeletons ====
Here you define which sections the model has, which skeleton it uses and its animations.
This segment defines the skeleton for the model and the bones that it uses.
{{codecomment|//Declare base classes}}
 
class CarAnimations
<syntaxhighlight lang="cpp">
{
class CfgSkeletons
    class IndicatorSpeed;
{
};
class Car; // Define base class.
 
class CfgModels
class Vodnik: Car
{
{
    class Car; {{codecomment|//Declare base class.}}
skeletonInherit = "Car"; // Inherit all bones from class Car.
skeletonBones[] = // Add two new bones. The movement of bone2 is linked to bone1.
    class Vodnik: Car  
{ // or in other words - bone2 is child of bone1 / bone 1 is parent of bone2
    {
// "<newbone>", "<parentbone>" // leave <parentbone> empty if it has no parents
      sectionsInherit = "Car"; {{codecomment|//Inherit all sections from class Car.}}
"bone1", "",
                                {{codecomment|//Add new section.}}
"bone2", "bone1"
      sections[] =
};
      {
pivotsModel = ""; // Location of pivot points (local axes) for hierarchical animation. (A2 only)
          "section1"
isDiscrete = 1; // 1 stands for discrete skinning values (0 or 100 % for each vertex of every selection)
      };
// 0 stands for non-discrete (each vertex may have different skinning values for selections - animations have just partial effect on that vertex)
      skeletonName = "Vodnik"; {{codecomment|//Use the Vodnik skeleton.}}
};
};
      class Animations: CarAnimations {{codecomment|//Inherit from generic animations.}}
</syntaxhighlight>
      {
          class IndicatorSpeed: IndicatorSpeed {{codecomment|//Redefine the maximum value}}
          {                                    {{codecomment|//for the speed indicator.}}
            maxValue = 40;
          };
      };
    };
};


==== Animations ====
This segment is part of class <tt>[[#cfgModels|cfgModels]]</tt> and defines all animations used by the model.


====cfgSkeletons====
<syntaxhighlight lang="cpp">
class Animations
{
class FrontWheelR
{
type = "rotationX"; // The type of animation.
source = "wheel"; // The controller that provides input.
selection = "pravy predni"; // The name of the skeleton bone used.
axis = ""; // The name of the axis in the model.
memory = true; // Is the axis defined in the memory LOD of the model or not?
sourceAddress = "loop"; // Does the animation loop or not?


This segment defines the skeleton for the model and the bones that it uses.
minValue = 0; // The minimum value of the motion range.
// i.e. The controller input when animation phase is 0.


class CfgSkeletons
maxValue = 1; // The maximum value of the motion range.
{
// i.e. The controller input when animation phase is 1.
    class Car; {{codecomment|//Define base class.}}
    class Vodnik: Car
    {
      skeletonInherit = "Car"; {{codecomment|//Inherit all bones from class Car.}}
      skeletonBones[] =        {{codecomment|//Add two new bones. The movement of bone2 is linked to bone1.}}
      {                        {{codecomment|//or in other words - bone2 is child of bone1 / bone 1 is parent of bone2}}
          {{codecomment|//"<newbone>", "<parentbone>" // leave <parentbone> empty if it has no parents}}
          "bone1", "",
          "bone2", "bone1"
      };
      pivotsModel = ""; {{codecomment|// Location of pivot points (local axes) for hierarchical animation. (A2 only)}}
      isDiscrete = 1; /// 1 stands for discrete skinning values (0 or 100 % for each vertex of every selection), 0 stands for non-discrete (each vertex may have different skinning values for selections - animations have just partial effect on that vertex)
    };
};


====Animations====
angle0 = 0; // The starting angle of this animation, where the
// animation phase is minValue
This segment is part of class <i>[[#cfgModels|cfgModels]]</i> and defines all animations used by the model.
class Animations
{
    class FrontWheelR
    {
      type = "rotationX"; {{codecomment|//The [[#Animation_types|type]] of animation.}}
      source = "wheel";  {{codecomment|//The [[#Animation_sources|controller]] that provides input.}}
      selection = "pravy predni"; {{codecomment|//The name of the skeleton bone used.}}
      axis = "";                  {{codecomment|//The name of the axis in the model.}}
      memory = true; {{codecomment|//Is the axis defined in the memory LOD of the}}
                      {{codecomment|//model or not?}}
      sourceAddress = "loop"; {{codecomment|//Does the animation loop or not?}}
      minValue = 0; {{codecomment|//The minimum value of the motion range.}}
                    {{codecomment|//i.e. The controller input when animation phase is 0.}}
      maxValue = 1; {{codecomment|//The maximum value of the motion range.}}
                    {{codecomment|//i.e. The controller input when animation phase is 1.}}
      angle0 = 0;   {{codecomment|//The starting angle of this animation, where the}}
                    {{codecomment|//animation phase is minValue}}
      angle1 = "rad -360"; {{codecomment|//The ending angle of this animation,}}
    };                      {{codecomment|//where the animation phase is maxValue}}
};


angle1 = "rad -360"; // The ending angle of this animation,
}; // where the animation phase is maxValue
};
</syntaxhighlight>
See also [[#Animation_types|type]], [[#Animation_sources|controller]].


=====Animation sources=====
=====Animation sources=====
[[#source|source=]] is the controller that provides the data to the animation phase. It is declared in in cfgModels.ModelName.class Animations{...}. Inbuilt controllers are listed below. Custom controllers (source=user) can be constructed in config.cpp using cfgVehicles.ModelName.class AnimationSources{...} together with cfgVehicles.ModelName.class UserActions{...}
[[#source|source=]] is the controller that provides the data to the animation phase. It is declared in in cfgModels.ModelName.class Animations{...}. Inbuilt controllers are listed below. Custom controllers (source=user) can be constructed in config.cpp using cfgVehicles.ModelName.class AnimationSources{...} together with cfgVehicles.ModelName.class UserActions{...}


Line 133: Line 142:


Arma 3 Update 1.60 comes with a new way how to handle multiple muzzle animation sources for weapons:
Arma 3 Update 1.60 comes with a new way how to handle multiple muzzle animation sources for weapons:
* '''revolving''', '''ammo''', '''ammoRandom''', '''reload''', '''trigger''', '''reloadMagazine''', '''hasMagazine''', '''isEmptyNoReload''', '''isEmpty''', '''zeroing''', '''weaponMode''' may be used with indexes ranging from -1 to (number of muzzles - 1) in format "name.x" (e.g. reload.0)
* The following may be used with indexes ranging from -1 to (number of muzzles - 1) in format "name.x" (e.g. reload.0):
** revolving
** ammo
** ammoRandom
** reload
** trigger
** reloadMagazine
** hasMagazine
** isEmptyNoReload
** isEmpty
** zeroing
** weaponMode
* Index '''-1''' means currently selected muzzle, index 0 means first muzzle of given weapon, index 1 second and so on
* Index '''-1''' means currently selected muzzle, index 0 means first muzzle of given weapon, index 1 second and so on
* Animation sources without indexes should behave the same way as before
* Animation sources without indexes should behave the same way as before.


{| class="bikitable sortable"
{| class="bikitable sortable"
|-  
|-
! Name !! Description !! Simulation Classes
! Name !! Description !! Simulation Classes
|-  
|-
| altBaro
| altBaro
| The baro altitude.
| The baro altitude.
| Aircraft, Weapon
| Aircraft, Weapon
|-  
|-
| altRadar
| altRadar
| The radar altitude.
| The radar altitude.
| Aircraft
| Aircraft
|-  
|-
| altSurface(A3)
| altSurface(A3)
| Altitude above land surface (ignoring water). Usable for wavebreakers on amphibious vehicles or possibly water depth indicators for ships.
| Altitude above land surface (ignoring water). Usable for wavebreakers on amphibious vehicles or possibly water depth indicators for ships.
| CarX + ?
| CarX + ?
|-  
|-
| cyclicAside
| cyclicAside
| rotor mast machinery (or rotor) animations based on cyclic controls
| rotor mast machinery (or rotor) animations based on cyclic controls
| Helicopter
| Helicopter
|-  
|-
| cyclicForward  
| cyclicForward
| rotor mast machinery (or rotor) animations based on cyclic controls
| rotor mast machinery (or rotor) animations based on cyclic controls
| Helicopter
| Helicopter
|-  
|-
| gear
| gear
| The vehicle's gear.   0 when Gear is down(outside), 1 when Gear is up(folded)
| The vehicle's gear. 0 when Gear is down(outside), 1 when Gear is up(folded)
| Aircraft
| Aircraft
|-  
|-
| horizonBank
| horizonBank
| The banking angle of the vehicle.
| The banking angle of the vehicle.
| Aircraft
| Aircraft
|-  
|-
| horizonDive
| horizonDive
| The diving angle of the vehicle.
| The diving angle of the vehicle.
| Aircraft
| Aircraft
|-  
|-
| vertSpeed
| vertSpeed
| The vertical speed.
| The vertical speed.
| Aircraft
| Aircraft
|-  
|-
| aileron
| aileron
| The main aileron control surfaces.
| The main aileron control surfaces.
| Airplane
| Airplane
|-  
|-
| aileronB
| aileronB
| The bottom speed brake as opening ailerons.
| The bottom speed brake as opening ailerons.
| Airplane
| Airplane
|-  
|-
| aileronT
| aileronT
| The top speed brake as opening ailerons.
| The top speed brake as opening ailerons.
| Airplane
| Airplane
|-  
|-
| aoa
| aoa
| The Angle Of Attack.
| The Angle Of Attack.
| Airplane
| Airplane
|-  
|-
| elevator
| elevator
| The elevators. For missiles min & max values are calculated by reading maneuvrability attribute from cfgAmmo. Value is multiplied by +/-0.25
| The elevators. For missiles min & max values are calculated by reading maneuvrability attribute from cfgAmmo. Value is multiplied by +/-0.25
| Airplane, Missiles
| Airplane, Missiles
|-  
|-
| flap
| flap
| The flaps. 0 when disabled, 0.5 when half deployed, 1 when fully deployed
| The flaps. 0 when disabled, 0.5 when half deployed, 1 when fully deployed
| Airplane
| Airplane
|-  
|-
| rotor
| rotor
| The rotors.
| The rotors.
| Airplane
| Airplane
|-  
|-
| propeller
| propeller
| Animation of propeller in water. Activates only when in water. Dependant on travel direction of vehicle and thrust or speed.
| Animation of propeller in water. Activates only when in water. Dependant on travel direction of vehicle and thrust or speed.
| CarX, BoatX, TankX, + ?
| CarX, BoatX, TankX, + ?
|-  
|-
| rudder
| rudder
| The rudder controlls. For missiles min & max values are calculated by reading maneuvrability attribute from cfgAmmo. Value is multiplied by +/-0.25
| The rudder controlls. For missiles min & max values are calculated by reading maneuvrability attribute from cfgAmmo. Value is multiplied by +/-0.25
| Airplane, Missiles
| Airplane, Missiles
|-  
|-
| speedBrake
| speedBrake
| The speed brake.
| The speed brake.
| Airplane
| Airplane
|-  
|-
| thrustVector
| thrustVector
| For animating VTOL elements (e.g. Osprey Tilt rotors). 0 when in horizontal flight, 1 when in hover mode.
| For animating VTOL elements (e.g. Osprey Tilt rotors). 0 when in horizontal flight, 1 when in hover mode.
| Airplane
| Airplane
|-  
|-
| direction
| direction
| The orientation of the vehicle.
| The orientation of the vehicle.
| Any
| Any
|-  
|-
| waypointDirection
| waypointDirection
| direction to waypoint
| direction to waypoint
| Any
| Any
|-  
|-
| fuel
| fuel
| The fuel level. 0 when tank is empty, 1 when tank is full
| The fuel level. 0 when tank is empty, 1 when tank is full
| Any
| Any
|-  
|-
| oil
| oil
| IndicatorOilTemp [Does not work in A3]
| IndicatorOilTemp [Does not work in A3]
| ?
| ?
|-  
|-
| engineTemp
| engineTemp
| Temperature state of the vehicle engine [A3 post 1.66 only]
| Temperature state of the vehicle engine [A3 post 1.66 only]
| any ?
| any ?
|-  
|-
| wheelsTemp
| wheelsTemp
| Temperature state of the vehicles wheels [A3 post 1.66 only]
| Temperature state of the vehicles wheels [A3 post 1.66 only]
| any ?
| any ?
|-  
|-
| turretGunTemp
| turretGunTemp
| Temperature state of the vehicles primary gun [A3 post 1.66 only]
| Temperature state of the vehicles primary gun [A3 post 1.66 only]
| any ?
| any ?
|-  
|-
| exhaustIntensity
| exhaustIntensity
| ?
| ?
| Plane + ? (not tankX)
| Plane + ? (not tankX)
|-  
|-
| gmeter
| gmeter
| Total g-forces.
| Total g-forces.
| Any
| Any
|-  
|-
| gmeterx
| gmeterx
| g-force component in x direction.
| g-force component in x direction.
| Any
| Any
|-  
|-
| gmetery
| gmetery
| g-force component in y direction.
| g-force component in y direction.
| Any
| Any
|-  
|-
| gmeterz
| gmeterz
| g-force component in z direction.
| g-force component in z direction.
| Any
| Any
|-  
|-
| rpm
| rpm
| The rpm of the vehicle. Used in rpm indicators.
| The rpm of the vehicle. Used in rpm indicators.
| Any(except Ship)
| Any(except Ship)
|-  
|-
| speed
| speed
| The speed of the vehicle. Used in speed indicators. (WARNING: 'maxValue' and 'minValue' should be in meters per second)
| The speed of the vehicle. Used in speed indicators. (WARNING: 'maxValue' and 'minValue' should be in meters per second)
| Any
| Any
|-  
|-
| time
| time
| Timer-based input.
| Timer-based input.
| Any
| Any
|-  
|-
| timeRndOffset
| timeRndOffset
| Timer-based input + random offset (per object on spawn, offset constant)
| Timer-based input + random offset (per object on spawn, offset constant)
| Any
| Any
|-  
|-
| objRandom
| objRandom
| random value per object on spawn, constant value
| random value per object on spawn, constant value
| Any
| Any
|-  
|-
| <div id="clockHour">clockHour</div>
| <div id="clockHour">clockHour</div>
| The current time in hours.
| The current time in hours.
| Any (including e.g. Weapon)
| Any (including e.g. Weapon)
|-  
|-
| clockHour24
| clockHour24
| The current time in hours in 24h scale.
| The current time in hours in 24h scale.
| Any (including e.g. Weapon)
| Any (including e.g. Weapon)
|-  
|-
| clockMinute
| clockMinute
| The current time in minutes. Derived from [[#clockHour|clockHour]].
| The current time in minutes. Derived from [[#clockHour|clockHour]].
| Any (including e.g. Weapon)
| Any (including e.g. Weapon)
|-  
|-
| clockSecond
| clockSecond
| The current time in seconds. Moves discreetly every second and independently from [[#clockHour|clockHour]].
| The current time in seconds. Moves discreetly every second and independently from [[#clockHour|clockHour]].
| Any (including e.g. Weapon)
| Any (including e.g. Weapon)
|-  
|-
| damage
| damage
| Current damage level (0=healthy, 1=destroyed)
| Current damage level (0=healthy, 1=destroyed)
| Any
| Any
|-  
|-
| user
| user
| User defined (script driven) animation
| User defined (script driven) animation
| Any
| Any
|-  
|-
| userPositionHashedInit
| userPositionHashedInit
| Randomized user defined (script driven) animation. This source is utilized on i.e. Tanoa gates and it's using initPhaseArray[]   = {0.5, 0.75, 1}; to randomize initial state
| Randomized user defined (script driven) animation. This source is utilized on i.e. Tanoa gates and it is using initPhaseArray[] = {0.5, 0.75, 1}; to randomize initial state
| Any
| Any
|-  
|-
| direct
| direct
| Like user, but immediate, no smooth transition.
| Like user, but immediate, no smooth transition.
| Any
| Any
|-  
|-
| pedals
| pedals
| The pedals.
| The pedals.
| Bicycle
| Bicycle
|-  
|-
| damper
| damper
| The suspension of the vehicle. Currently only works with type [[#translationY|translationY]].
| The suspension of the vehicle. Currently only works with type [[#translationY|translationY]].
| Car, Tank, Aircraft, Motorcycle
| Car, Tank, Aircraft, Motorcycle
|-  
|-
| FrontDamper
| FrontDamper
| The suspension of the front wheels of the vehicle.
| The suspension of the front wheels of the vehicle.
| Car?
| Car?
|-  
|-
| BackDamper
| BackDamper
| The suspension of the back wheels of the vehicle.
| The suspension of the back wheels of the vehicle.
| Car?
| Car?
|-  
|-
| drivingWheel
| drivingWheel
| The orientation of the steering wheel. Used for the steering wheel and steered wheels.
| The orientation of the steering wheel. Used for the steering wheel and steered wheels.
| Car, Ship, Motorcycle, Tank
| Car, Ship, Motorcycle, Tank
|-  
|-
| *mainGun
| *mainGun
| The main gun. *Alternatively defined with ''animationSourceGun'' in the turret config.
| The main gun. *Alternatively defined with ''animationSourceGun'' in the turret config.
| Car, Tank, Helicopter, Ship
| Car, Tank, Helicopter, Ship
|-  
|-
| *mainTurret
| *mainTurret
| The main turret. *Alternatively defined with ''animationSourceBody'' in turret config.
| The main turret. *Alternatively defined with ''animationSourceBody'' in turret config.
| Car, Tank, Helicopter, Ship
| Car, Tank, Helicopter, Ship
|-  
|-
| wheel
| wheel
| Normal wheels that turn based on moving forward.
| Normal wheels that turn based on moving forward.
| Car, Airplane, Motorcycle
| Car, Airplane, Motorcycle
|-  
|-
| noseWheelTurn
| noseWheelTurn
|  
|
| Airplane
| Airplane
|-  
|-
| compassArrow
| compassArrow
| The arrow.
| The arrow.
| Compass
| Compass
|-  
|-
| compassCover
| compassCover
| The cover.
| The cover. No longer works in Arma 3 and always return 1.
| Compass
| Compass
|-  
|-
| compassPointer
| compassPointer
| The pointer.
| The pointer.
| Compass
| Compass
|-  
|-
| rotorH
| rotorH
| The 'horizontal' rotor.
| The 'horizontal' rotor.
| Helicopter
| Helicopter
|-  
|-
| rotorV
| rotorV
| The 'vertical' rotor.
| The 'vertical' rotor.
| Helicopter
| Helicopter
|-  
|-
| rotorHDive
| rotorHDive
| Tilt of the 'horizontal' rotor.
| Tilt of the 'horizontal' rotor.
| Helicopter
| Helicopter
|-  
|-
| rotorVDive
| rotorVDive
| Tilt of the 'vertical' rotor.
| Tilt of the 'vertical' rotor.
| Helicopter
| Helicopter
|-  
|-
| support
| support
| The support stand.
| The support stand.
| Motorcycle
| Motorcycle
|-  
|-
| *hatchCommander
| *hatchCommander
| The commander hatch. *Alternatively defined with ''animationSourceHatch'' in the turret config.
| The commander hatch. *Alternatively defined with ''animationSourceHatch'' in the turret config.
| Tank
| Tank
|-  
|-
| hatchDriver
| hatchDriver
| The driver hatch.
| The driver hatch.
| Tank
| Tank
|-  
|-
| *hatchGunner
| *hatchGunner
| The gunner hatch. *Alternatively defined with ''animationSourceHatch'' in the turret config.
| The gunner hatch. *Alternatively defined with ''animationSourceHatch'' in the turret config.
| Tank
| Tank
|-  
|-
| *obsGun
| *obsGun
| The observer or commander gun. *Alternatively defined with ''animationSourceGun'' in the turret config.
| The observer or commander gun. *Alternatively defined with ''animationSourceGun'' in the turret config.
| Tank
| Tank
|-  
|-
| *obsTurret
| *obsTurret
| The observer or commander turret. *Alternatively defined with ''animationSourceBody'' in the turret config.
| The observer or commander turret. *Alternatively defined with ''animationSourceBody'' in the turret config.
| Tank
| Tank
|-  
|-
| reload
| reload
| The movement when reloading. Source is 1 as soon as shot is fired and returns to 0 within in reload time.
| The movement when reloading. Source is 1 as soon as shot is fired and returns to 0 within in reload time.
| Weapon
| Weapon
|-  
|-
| revolving
| revolving
| Source is 1.0 at full magazine and 0 at empty magazine. After each shot, the source will reduce by a fraction (1/magazincapacity) within the reloadTime from the weapon, i.e. a smooth transition.
| Source is 1.0 at full magazine and 0 at empty magazine. After each shot, the source will reduce by a fraction (1/magazincapacity) within the reloadTime from the weapon, i.e. a smooth transition.
| Weapon
| Weapon
|-  
|-
| isempty
| isempty
| The animation to hold the bolt open when the weapon is empty.
| The animation to hold the bolt open when the weapon is empty.
| Weapon
| Weapon
|-  
|-
| turretDir
| turretDir
| The orientation of the turret.
| The orientation of the turret.
| Tank
| Tank
|-  
|-
| wheelL
| wheelL
| The left track wheels.
| The left track wheels.
| Tank
| Tank
|-  
|-
| wheelR
| wheelR
| The right track wheels.
| The right track wheels.
| Tank
| Tank
|-  
|-
| scudLauncher
| scudLauncher
| Phase of scudlaunch.
| Phase of scudlaunch.
| Scud
| Scud
|-  
|-
| flag
| flag
| Runs from 0 to 1 as flag is taken from flagpole.
| Runs from 0 to 1 as flag is taken from flagpole.
| Flagcarrier
| Flagcarrier
|-  
|-
| airspeedIndicatorRTD || speed / maxSpeed || RTD helicopter
| airspeedIndicatorRTD || speed / maxSpeed || RTD helicopter
|-  
|-
| altBaroRTD || altitude in meters || RTD helicopter
| altBaroRTD || altitude in meters || RTD helicopter
|-  
|-
| vertSpeedRTD || vertical speed / max speed || RTD helicopter
| vertSpeedRTD || vertical speed / max speed || RTD helicopter
|-  
|-
| attitudeBankRTD || radians || RTD helicopter
| attitudeBankRTD || radians || RTD helicopter
|-  
|-
| attitudeDiveRTD || radians || RTD helicopter
| attitudeDiveRTD || radians || RTD helicopter
|-  
|-
| skidRTD || speed / helicopter >> maxSpeed || RTD helicopter
| skidRTD || speed / helicopter >> maxSpeed || RTD helicopter
|-  
|-
| altRadarRTD || altitude above ground in meters || RTD helicopter
| altRadarRTD || altitude above ground in meters || RTD helicopter
|-  
|-
| rpm1RTD || engine 1 rmp / designed max rpm || RTD helicopter
| rpm1RTD || engine 1 rmp / designed max rpm || RTD helicopter
|-  
|-
| rpm2RTD || engine 2 rmp / designed max rpm || RTD helicopter
| rpm2RTD || engine 2 rmp / designed max rpm || RTD helicopter
|-  
|-
| rpm3RTD || engine 3 rmp / designed max rpm || RTD helicopter
| rpm3RTD || engine 3 rmp / designed max rpm || RTD helicopter
|-  
|-
| temp1RTD || engine 1 temperature / helicopter >> DamagePropertiesRTD >> maxEngineTemperature || RTD helicopter
| temp1RTD || engine 1 temperature / helicopter >> DamagePropertiesRTD >> maxEngineTemperature || RTD helicopter (only TKOH)
|-  
|-
| temp2RTD || engine 2 temperature / helicopter >> DamagePropertiesRTD >> maxEngineTemperature || RTD helicopter
| temp2RTD || engine 2 temperature / helicopter >> DamagePropertiesRTD >> maxEngineTemperature || RTD helicopter (only TKOH)
|-  
|-
| temp3RTD || engine 3 temperature / helicopter >> DamagePropertiesRTD >> maxEngineTemperature || RTD helicopter
| temp3RTD || engine 3 temperature / helicopter >> DamagePropertiesRTD >> maxEngineTemperature || RTD helicopter (only TKOH)
|-  
|-
| torqueRTD || torque / helicopter >> DamagePropertiesRTD >> maxTorque || RTD helicopter
| torqueRTD || torque / helicopter >> DamagePropertiesRTD >> maxTorque || RTD helicopter
|-  
|-
| mainRotorRPMRTD || Main Rotor RPM / designed max RPM || RTD helicopter
| mainRotorRPMRTD || Main Rotor RPM / designed max RPM || RTD helicopter
|-  
|-
| tailRotorRPMRTD || Tail Rotor RPM / designed max RPM || RTD helicopter
| tailRotorRPMRTD || Tail Rotor RPM / designed max RPM || RTD helicopter
|-  
|-
| collectiveRTD || collective (0, -1) || RTD helicopter
| collectiveRTD || collective (0, 1) || RTD helicopter
|-  
|-
| rudderRTD || Pedals (-1, 1) || RTD helicopter
| rudderRTD || Pedals (-1, 1) || RTD helicopter
|-  
|-
| throttleRTD1 || (0, 1) || RTD helicopter
| throttleRTD1 || (0, 1) || RTD helicopter
|-  
|-
| throttleRTD2 || (0, 1) || RTD helicopter
| throttleRTD2 || (0, 1) || RTD helicopter
|-  
|-
| throttleRTD3 || (0, 1) || RTD helicopter
| throttleRTD3 || (0, 1) || RTD helicopter
|-  
|-
| torqueEng1RTD || (0, 1) || RTD helicopter
| torqueEng1RTD || (0, 1) || RTD helicopter
|-  
|-
| torqueEng2RTD || (0, 1) || RTD helicopter
| torqueEng2RTD || (0, 1) || RTD helicopter
|-  
|-
| torqueEng3RTD || (0, 1) || RTD helicopter
| torqueEng3RTD || (0, 1) || RTD helicopter
|-  
|-
| collective || collective (0, 1) || Helicopter
|-
|IsEmptyNoReload (A3) || 1 when empty and not reloading magazine || Weapon
|IsEmptyNoReload (A3) || 1 when empty and not reloading magazine || Weapon
|-  
|-
|reloadMagazine (A3) || Phase of magazine reload. For Handweapons 0 at the beginning and 1 at reloadTime. For Vehicle Weapons 1 at beginning, 0 after reloadTime. 0 When no reload happens. Only for first muzzle of weapon affects this. || Weapon
|reloadMagazine (A3) || Phase of magazine reload. For Handweapons 0 at the beginning and 1 at reloadTime. For Vehicle Weapons 1 at beginning, 0 after reloadTime. 0 When no reload happens. Only for first muzzle of weapon affects this. || Weapon
|-  
|-
|reloadMagazine2 (A3) || same as reloadMagazine. Used for second and all consequent muzzles. (obsolete with indexing) || Weapon
|reloadMagazine2 (A3) || same as reloadMagazine. Used for second and all consequent muzzles. (obsolete with indexing) || Weapon
|-  
|-
|ammo (A3) || Number of remaining ammo in magazine (that means revolving * count). Transition is discrete, i.e. immediate switch from 45.0 to 44.0 for example. || Weapon
|ammo (A3) || Number of remaining ammo in magazine (that means revolving * count). Transition is discrete, i.e. immediate switch from 45.0 to 44.0 for example. || Weapon
|-  
|-
|ammoRandom (A3) || Random value changing with every shoot fired from given magazine. || Weapon
|ammoRandom (A3) || Random value changing with every shoot fired from given magazine. || Weapon
|-  
|-
|zeroing1 (A3) || Current position in discreteDistance array for first muzzle. || Weapon
|zeroing1 (A3) || Current position in discreteDistance array for first muzzle. || Weapon
|-  
|-
|zeroing2 (A3) || Current position in discreteDistance array for second muzzle. || Weapon
|zeroing2 (A3) || Current position in discreteDistance array for second muzzle. || Weapon
|-  
|-
|hasOptics (A3) || Binary value of weapon having active optics in its TOP slot. || Weapon
|hasOptics (A3) || Binary value of weapon having active optics in its TOP slot. || Weapon
|-  
|-
|hasAccessory (A3) || Binary value of weapon having active accessory in its SIDE slot. || Weapon
|hasAccessory (A3) || Binary value of weapon having active accessory in its SIDE slot. || Weapon
|-  
|-
|hasSuppressor (A3) || Binary value of weapon having active suppressor in its MUZZLE slot. || Weapon
|hasSuppressor (A3) || Binary value of weapon having active suppressor in its MUZZLE slot. || Weapon
|-
|-
|hasUnderbarrel (A3) || Binary value of weapon having active bipod in its UNDERBARREL slot. || Weapon
|hasUnderbarrel (A3) || Binary value of weapon having active bipod in its UNDERBARREL slot. || Weapon
|-
|-
|hasMagazine (A3) || Binary value of weapon having active magazine. || Weapon
|hasMagazine (A3) || Binary value of weapon having active magazine. || Weapon
|-  
|-
|weaponMode (A3) || Current position in modes[] array of a weapon. Useful for fire selector switches etc. || Weapon
|weaponMode (A3) || Current position in modes[] array of a weapon. Useful for fire selector switches etc. || Weapon
|-  
|-
|weaponMuzzle (A3) || Current position in muzzles[] array of a weapon. Useful for ladder sights that deploy when grenade launcher muzzle is selected. || Weapon
|weaponMuzzle (A3) || Current position in muzzles[] array of a weapon. Useful for ladder sights that deploy when grenade launcher muzzle is selected. || Weapon
|-  
|-
|isSelected (A3) || Returns if the weapon is currently selected. Usefull for folding stocks and similar. || Weapon
|isSelected (A3) || Returns if the weapon is currently selected. Usefull for folding stocks and similar. || Weapon
|-
|-
|primaryWeaponMode || untested || Weapon
|primaryWeaponMode || untested || Weapon
|-
|-
|primaryWeaponZeroing || untested || Weapon
|primaryWeaponZeroing || untested || Weapon
|-
|-
|Throttle (A3) || How much is the throttle used (0-1) || Transport
|Throttle (A3) || How much is the throttle used (0-1) || Transport
|-  
|-
|Brake (A3) || How much is the brake used (0-0.5) || Transport
|Brake (A3) || How much is the brake used (0-0.5) || Transport
|-  
|-
|maxHoldsterValue (A3) || holdsterAnimValue of currently selected weapon || Transport
|maxHoldsterValue (A3) || holdsterAnimValue of currently selected weapon || Transport
|-  
|-
|*ObsElevation (A3) || Raise turret/Lower turret action. *Alternatively defined with ''animationSourceElevation'' in the turret config. || Transport
|*ObsElevation (A3) || Raise turret/Lower turret action. *Alternatively defined with ''animationSourceElevation'' in the turret config. || Transport
|-
|-
|RotorHFullyDestroyed (A3) || 0 by default, 1 if the main rotor has been destroyed by impact || Helicopter
|RotorHFullyDestroyed (A3) || 0 by default, 1 if the main rotor has been destroyed by impact || Helicopter
|-  
|-
|tailRotorHFullyDestroyed (A3) || 0 by default, 1 if the tail rotor has been destroyed by impact || Helicopter
|tailRotorHFullyDestroyed (A3) || 0 by default, 1 if the tail rotor has been destroyed by impact || Helicopter
|-
|-
Line 544: Line 566:
|-
|-
|trigger (A3) || Actual animation phase of trigger finger animation || Weapon
|trigger (A3) || Actual animation phase of trigger finger animation || Weapon
|-  
|-
|collisionLights(A3) || Position lights || ?
|collisionLights(A3) || Position lights || ?
|-  
|-
|MarkerLight|| used in AnimationSources class together with markerLight parameter i.e. (CollisionRed) linking to MarkerLights class. Source is 1 when light is on || Vehicle
|MarkerLight|| used in AnimationSources class together with markerLight parameter i.e. (CollisionRed) linking to MarkerLights class. Source is 1 when light is on || Vehicle
|-
|-
| pilotCameraRotX(A3)
| pilotCameraRotX(A3)
| The turning (yawing) of [[A3_Targeting_config_reference#class_pilotCamera|pilotCamera]]
| The turning (yawing) of [[A3_Targeting_config_reference#class_pilotCamera|pilotCamera]]
| Airplane, Helicopter
| Airplane, Helicopter
|-  
|-
| pilotCameraRotY(A3)
| pilotCameraRotY(A3)
| The elevation (pitching) of [[A3_Targeting_config_reference#class_pilotCamera|pilotCamera]]
| The elevation (pitching) of [[A3_Targeting_config_reference#class_pilotCamera|pilotCamera]]
| Airplane, Helicopter
| Airplane, Helicopter
|-  
|-
|vehicleTransporting || 0 when the vehicle is not transporting any vehicle, 1 when it is. || Vehicle
|vehicleTransporting || 0 when the vehicle is not transporting any vehicle, 1 when it is. || Vehicle
|-
|-
Line 569: Line 591:
|initTime|| Goes from 0 to initTime value from cfgAmmo. I.e. if you have initTime = 0.15 in missile config, maxValue for this source will be 0.15 || Missiles
|initTime|| Goes from 0 to initTime value from cfgAmmo. I.e. if you have initTime = 0.15 in missile config, maxValue for this source will be 0.15 || Missiles
|-
|-
|activeSensorsPhase|| Loop going from 0 to 1 (1 minute). Activated when radar is turned on  || Vehicles
|state|| Engine state: 0 - init, 1 - thrust, 2 - fly || Missiles
|-
|-
|activeSensorsOn|| 1 when radar is activated || Vehicles
|activeSensorsPhase|| Loop going from 0 to 1 (1 minute). Activated when radar is turned on || Vehicles
|-
|activeSensorsOn|| 1 when radar is activated || Vehicles
|-
|-
|isPiP|| 1 when Picture in Picture is enabled in settings || Vehicles
|isPiP|| 1 when Picture in Picture is enabled in settings || Vehicles
Line 582: Line 606:
|-
|-
|damageWheels|| Returns same value as wheels damage control in vehicle info GUI|| Car
|damageWheels|| Returns same value as wheels damage control in vehicle info GUI|| Car
|-
|inWater|| Returns 1 when vehicle is in water || Vehicles
|}
|}


=====Animation types=====
===== Animation types =====
This table outlines the Animation Types you can use for an animation class.
This table outlines the Animation Types you can use for an animation class.


{| class="bikitable sortable"
{| class="bikitable sortable"
|-  
|-
! Type !! Description
! Type !! Description
|-  
|-
| rotation
| rotation
| Circular motion.
| Circular motion.
|-  
|-
| rotationX
| rotationX
| Idem, but locked to the X axis.
| Idem, but locked to the X axis.
|-  
|-
| rotationY
| rotationY
| Idem, but locked to the Y axis.
| Idem, but locked to the Y axis.
|-  
|-
| rotationZ
| rotationZ
| Idem, but locked to the Z axis.
| Idem, but locked to the Z axis.
|-  
|-
| translation
| translation
| Motion along one axis.
| Motion along one axis.
|-  
|-
| translationX
| translationX
| Idem, but locked to the X axis.
| Idem, but locked to the X axis.
|-  
|-
| <div id="translationY">translationY</div>
| <div id="translationY">translationY</div>
| Idem, but locked to the Y axis.
| Idem, but locked to the Y axis.
|-  
|-
| translationZ
| translationZ
| Idem, but locked to the Z axis.
| Idem, but locked to the Z axis.
|-  
|-
| hide
| hide
| Hide once given threshold is reached
| Hide once given threshold is reached
|-  
|-
| direct
| direct
| Rotation and/or translation (without using selection in model as axis)
| Rotation and/or translation (without using selection in model as axis)
|}
|}


=====Animation Properties=====
===== Animation Properties =====
 
This table outlines the properties (or entries) that each defined animation class expects to be present based on the animation type that is specified.
This table outlines the properties (or entries) that each defined animation class expects to be present based on the animation type that is specified.


Eg. If you specify a an animation type of 'rotationX' you must specify the animation properties 'angle0' and 'angle1'.
Eg. If you specify a an animation type of 'rotationX' you must specify the animation properties 'angle0' and 'angle1'.


{| class="bikitable sortable"
{| class="bikitable sortable"
|-  
|-
! Property !! Description !! Animation Type
! Property !! Description !! Animation Type
|-  
|-
| source
| source
| Controller used for input.
| Controller used for input.
| Any
| Any
|-  
|-
| selection
| selection
| Skeleton bone.
| Skeleton bone.
| Any
| Any
|-  
|-
| <div id="axis">axis</div>
| <div id="axis">axis</div>
| Model axis.
| Model axis.
| Any
| Any
|-  
|-
| <div id="begin">begin</div>
| <div id="begin">begin</div>
| Starting point of an oriented model axis.<br />This can be used in combination with [[#end|end]] instead of [[#axis|axis]].
| Starting point of an oriented model axis.<br>This can be used in combination with [[#end|end]] instead of [[#axis|axis]].
| Any
| Any
|-  
|-
| <div id="end">end</div>
| <div id="end">end</div>
| Ending point of an oriented model axis.<br />This can be used in combination with [[#begin|begin]] instead of [[#axis|axis]].
| Ending point of an oriented model axis.<br>This can be used in combination with [[#begin|begin]] instead of [[#axis|axis]].
| Any
| Any
|-  
|-
| memory
| memory
| Optional (default is true). Axis in memory level or not?
| Optional (default is true). Axis in memory level or not?
| Any
| Any
|-  
|-
| animPeriod
| animPeriod
| Time in seconds for one animation cycle.<br />Only used by ''user'' controllers.
| Time in seconds for one animation cycle.<br>Only used by ''user'' controllers.
| Any
| Any
|-  
|-
| minValue
| minValue
| Minimum value of the motion range. i.e. Controller input when the animation phase is 0.
| Minimum value of the motion range. i.e. Controller input when the animation phase is 0.
| Any
| Any
|-  
|-
| maxValue
| maxValue
| Maxmimum value of the motion range. i.e. Controller input when the animation phase is 1.
| Maxmimum value of the motion range. i.e. Controller input when the animation phase is 1.
| Any
| Any
|-  
|-
| minPhase
| phaseBeg
| Minimum phase of the animation.i.e.<br />Animation phase when the controller value is 0.
| Minimum phase of the animation.i.e.<br>Animation phase when the controller value is 0.
| Any
| Any
|-  
|-
| maxPhase
| phaseEnd
| Maxmimum value of the motion range.i.e.<br />Animation phase when the controller value is 1.
| Maxmimum value of the motion range.i.e.<br>Animation phase when the controller value is 1.
| Any
| Any
|-  
|-
| sourceAddress
| sourceAddress
| Does the animation loop or not? This can be any of three different values: clamp (default), loop or mirror.
| Does the animation loop or not? This can be any of three different values: clamp (default), loop or mirror.
| Any
| Any
|-  
|-
| angle0
| angle0
| Starting angle of this animation, where the animation phase is 0.
| Starting angle of this animation, where the animation phase is 0.
| Rotations
| Rotations
|-  
|-
| angle1
| angle1
| Ending angle of this animation, where the animation phase is 1.
| Ending angle of this animation, where the animation phase is 1.
| Rotations
| Rotations
|-  
|-
| offset0
| offset0
| Starting offset of this animation, where the animation phase is 1.
| Starting offset of this animation, where the animation phase is 0.
| Translations
| Translations
|-  
|-
| offset1
| offset1
| Ending offset of this animation, where the animation phase is 1.
| Ending offset of this animation, where the animation phase is 1.
| Translations
| Translations
|-  
|-
| hideValue
| hideValue
| Threshold for hiding ("hides selection once hidevalue is reached")
| Threshold for hiding ("hides selection once hidevalue is reached")
| Hide
| Hide
|-  
|-
| unHideValue (A3 only)
| unHideValue (A3 only)
| Threshold for unhiding (unhides it again after it was already hidden). Value Must be larger than hideValue  
| Threshold for unhiding (unhides it again after it was already hidden). Value Must be larger than hideValue
| Hide
| Hide
|-  
|-
| axisPos[]
| axisPos[]
| Position of axis in model space
| Position of axis in model space
| Direct
| Direct
|-  
|-
| axisDir[]
| axisDir[]
| Direction of axis (vector)
| Direction of axis (vector)
| Direct
| Direct
|-  
|-
| angle
| angle
| Angle of rotation in degrees!
| Angle of rotation in degrees!
| Direct
| Direct
|-  
|-
| axisOffset
| axisOffset
| Used for translation
| Used for translation
Line 724: Line 746:
|}
|}


====AnimationSources====
==== AnimationSources ====
This is '''not''' part of the model cfg, but part of the main configuration file.
This is <b>not</b> part of the model cfg, but part of the main configuration file. This class allows you to define new user controllers or modify selected properties of existing controllers.
This class allows you to define new user controllers or modify selected properties of existing controllers.
Defining custom controllers makes it possible to use one custom controller for several different animations. If an animation does not define the [[#source|source]] parameter, the program looks for a custom controller defined in this class with the same name.
It is also possible to override an existing controller using this class, but be extremely careful in this case. The custom controller will hide the original one, leaving the latter inaccessible. Overriding is done using the <i>::</i> notation in the [[#source|source]] parameter as can be seen in the third example.


Defining custom controllers makes it possible to use one custom controller for several different animations.
class AnimationSources
If an animation does not define the [[#source|source]] parameter, the program looks for a custom controller defined in this class with the same name.
{
    class MachineGun
    {
      source = "reload"; {{codecomment|//The [[#Animation_sources|controller]] used for the definition of}}
                          {{codecomment|//this controller.}}
      weapon = MachineGun25W; {{codecomment|//In the specific case of using the [[#reload|reload]]}}
    };                        {{codecomment|//controller, the weapon class name.}}
};


class AnimationSources
It is also possible to override an existing controller using this class, but be extremely careful in this case.
{
The custom controller will hide the original one, leaving the latter inaccessible.
    {{codecomment|//Used by animations called Door1, which don't define the [[#source|source]]}}
Overriding is done using the ''::'' notation in the [[#source|source]] parameter as can be seen in the third example.
    {{codecomment|//parameter or by animations that define source &#61; Door1;.}}
    class Door1
    {
      source = "user"; {{codecomment|//The controller is defined as a user animation.}}
      animPeriod = 1;  {{codecomment|//The animation period used for this controller.}}
      initPhase=1;    {{codecomment|//Initial phase when object is created.}}
    };
};


class AnimationSources
<syntaxhighlight lang="cpp">
{
class AnimationSources
    class wheel
{
    {
class MachineGun
      source = "::wheel"; {{codecomment|//Overriding the existing [[#wheel|wheel]] controller.}}
{
    };
source = "reload"; // The controller used for the definition of this controller.
};
weapon = MachineGun25W; // In the specific case of using the reload controller, the weapon class name.
};
};
</syntaxhighlight>
See also [[#Animation_sources|controller]], [[#reload|reload]].
 
<syntaxhighlight lang="cpp">
class AnimationSources
{
// Used by animations called Door1, which don't define the source
// parameter or by animations that define source = Door1;.
class Door1
{
source = "user"; // The controller is defined as a user animation.
animPeriod = 1; // The animation period used for this controller.
initPhase=1; // Initial phase when object is created.
};
};
</syntaxhighlight>
See also [[#source|source]].
 
<syntaxhighlight lang="cpp">
class AnimationSources
{
class wheel
{
source = "::wheel"; // Overriding the existing wheel controller.
};
};
</syntaxhighlight>
See also [[#wheel|wheel]].


=== config.cpp model.cfg relationship ===
=== config.cpp model.cfg relationship ===
Line 767: Line 799:
Below is the class name relationship between the two for a user, (or modified), source. Poetic licence used
Below is the class name relationship between the two for a user, (or modified), source. Poetic licence used


class cfgModels
<syntaxhighlight lang="cpp">
{
class CfgModels
  class NameOfP3d
{
  {
class NameOfP3d
  class Animations
{
  {
class Animations
    class ModelClassName
{
    {
class ModelClassName
    selection=BoneName;
{
    source=AnimClassName; //optional
selection = BoneName;
    source=user;         //optional. default AnimClassName==ModelClassName
source = AnimClassName; // optional
    };
source = user; // optional. default AnimClassName == ModelClassName
  };
};
  };
};
};
};
};
</syntaxhighlight>


class cfgvehicles
<syntaxhighlight lang="cpp">
{
class CfgVehicles
  class ModelName
{
  {
class ModelName
    class AnimationSources
{
    {
class AnimationSources
    class AnimClassName
{
    {
class AnimClassName
      AnimPeriod=1;             // mandatory. in seconds.  
{
      source = "user";         // optional. default=user
AnimPeriod = 1; // mandatory. in seconds.
      InitPhase=1;             // optional (default =0)
source = "user"; // optional. default = user
      weapon = WeaponClassName; // only for source=reload;
InitPhase = 1; // optional. default = 0
    };
weapon = WeaponClassName; // only for source = reload;
  };
};
  class UserActions
};
  {
class UserActions
    class MeaninglessName
{
    {
class MeaninglessName
      ......
{
      onlyforplayer = true/false;       //mandatory
......
      statement = "this animate ['AnimClassName',1];"; // executed when action triggered
onlyforplayer = true/false; // mandatory
    };
statement = "this animate ['AnimClassName', 1];"; // executed when action is triggered
  };
};
  };
};
};
};
};
</syntaxhighlight>


*most constructions avoid confusion: AnimClassName==ModelClassName==BoneName
*most constructions avoid confusion: AnimClassName==ModelClassName==BoneName
*the word 'user' in both cfg and cpp appears to be, a) redundant, b) the default
*the word 'user' in both cfg and cpp appears to be, a) redundant, b) the default


=== Example ===
=== See Also ===
 
* How-to for the CfgModels (a working attack helicopter): [[ArmA: Howto Model Config]]
* How-to on CfgModels & CfgSkeletons with additional description and examples: [[ArmA: How to animate a model]].


You can find a howto for the CfgModels (a working attack helicopter) [[ArmA:_Howto_Model_Config | here]] as well as a howto on cfgModels & cfgSkeletons with additional description and examples [[ArmA:_How_to_animate_a_model|here]].


[[Category:ArmA: Addon Configuration]]
[[Category:ArmA: Addon Configuration]]
[[Category:ArmA: Editing]]
[[Category:ArmA: Editing]]

Revision as of 18:49, 7 September 2020

Template:SideTOC The model configuration file (model cfg for short) is the interface between a (P3D) model and the program.
It is a look-up table which is processed during the binarization process, to tell the program what the various sections of the model are, which skeleton it uses and how it is animated.

This system is more flexible than the one previously used, because all the information is stored for the model and not for the object class in the main configuration file. This means that several object classes can use the same model and don't have to define the animations for this model seperately.

A goal of the system is to seperate the configuration of models into a designer and an artist part.
This is done by the introduction of a class AnimationSources in the main configuration file (the designer part) and the continuing use of the class Animations in the model cfg (the artist part).

Most models will be able to inherit definitions from basic definitions on higher levels in the data hierarchy. An example hierarchy is described and illustrated below.

  • p:\ofp2\vehicles\model.cfg - Defines a class Default.
  • p:\ofp2\vehicles\land\wheeled\model.cfg - Defines a class Car.
  • p:\ofp2\vehicles\land\wheeled\landrover\model.cfg - Defines a class LandRover.
  • p:\ofp2\vehicles\land\wheeled\landrover\lr6x6_3 - In the model is a property config = LandRover (this feature is not implemented and may never be).
  • p:\ofp2\vehicles\land\wheeled\landrover\lr6x6_mg240 - Has a LR6x6_MG240.cfg, which inherits from class LandRover and adds definitions for a turret.

Sample tree hierarchy

Notes

At this stage the file is parsed during the binarization of a model and animations can be played in the program with user actions. Eventually they can be previewed using the Buldozer viewer.

The model cfg follows a set of naming conventions. There can be several model cfg files, named by default model.cfg, named after the folder name or named after a specific model. In the case that both a model.cfg and <foldername>.cfg are present, only the latter is parsed. The <modelname>.cfg is parsed alongside of the other model cfg files and therefore the model can be seen as an additional level in the hierarchy.

When we have an example folder called humr with a model called hmmwv.p3d, we can use the following names: model.cfg or humr.cfg and next to that a hmmwv.cfg.

In the future a model may support a named property called config, which tells the model which class in the model cfg to use. There is some doubt whether this feature will be implemented though.

There are model cfg files that do not relate directly to a specific model, but are used for the generic base class definitions, such as class Default.

The functionality of the animations has been extended, allowing to do in scripting what was done before using RTM animations. In addition, animation controllers were introduced, which allow for the control of different animations at the same time. This opens up possibilities like having several turrets on a tank.

The model cfg and main configuration file (where classes cfgModels, cfgSkeletons and Animations were previously defined) operate together to smooth the change from the old to the new system. When a model cfg and the main configuration file both define the same model, the model cfg takes precedence.

Segments

cfgModels

This segment defines all properties of each model. The class names correspond to the model name.
Here you define which sections the model has, which skeleton it uses and its animations.

// Declare base classes
class CarAnimations
{
	class IndicatorSpeed;
};
class CfgModels
{
	class Car; // Declare base class.

	class Vodnik: Car
	{
		sectionsInherit = "Car"; // Inherit all sections from class Car.
		// Add new section.
		sections[] =
		{
			"section1"
		};
		skeletonName = "Vodnik"; // Use the Vodnik skeleton.

		class Animations: CarAnimations // Inherit from generic animations.
		{
			class IndicatorSpeed: IndicatorSpeed	// Redefine the maximum value
			{										// for the speed indicator.
				maxValue = 40;
			};
		};
	};
};

cfgSkeletons

This segment defines the skeleton for the model and the bones that it uses.

class CfgSkeletons
{
	class Car; // Define base class.

	class Vodnik: Car
	{
		skeletonInherit = "Car";			// Inherit all bones from class Car.
		skeletonBones[] =					// Add two new bones. The movement of bone2 is linked to bone1.
		{									// or in other words - bone2 is child of bone1 / bone 1 is parent of bone2
			// "<newbone>", "<parentbone>"	// leave <parentbone> empty if it has no parents
			"bone1", "",
			"bone2", "bone1"
		};
		pivotsModel = "";	// Location of pivot points (local axes) for hierarchical animation. (A2 only)
		isDiscrete = 1;		// 1 stands for discrete skinning values (0 or 100 % for each vertex of every selection)
							// 0 stands for non-discrete (each vertex may have different skinning values for selections - animations have just partial effect on that vertex)
	};
};

Animations

This segment is part of class cfgModels and defines all animations used by the model.

class Animations
{
	class FrontWheelR
	{
		type = "rotationX";			// The type of animation.
		source = "wheel";			// The controller that provides input.
		selection = "pravy predni";	// The name of the skeleton bone used.
		axis = "";					// The name of the axis in the model.
		memory = true;				// Is the axis defined in the memory LOD of the model or not?
		sourceAddress = "loop";		// Does the animation loop or not?

		minValue = 0;				// The minimum value of the motion range.
									// i.e. The controller input when animation phase is 0.

		maxValue = 1;				// The maximum value of the motion range.
									// i.e. The controller input when animation phase is 1.

		angle0 = 0;					// The starting angle of this animation, where the
									// animation phase is minValue

		angle1 = "rad -360";		// The ending angle of this animation,
	};								// where the animation phase is maxValue
};

See also type, controller.

Animation sources

source= is the controller that provides the data to the animation phase. It is declared in in cfgModels.ModelName.class Animations{...}. Inbuilt controllers are listed below. Custom controllers (source=user) can be constructed in config.cpp using cfgVehicles.ModelName.class AnimationSources{...} together with cfgVehicles.ModelName.class UserActions{...}

Controller names marked by * are freely defined by vehicle turret configs. The values here show the names commonly used for ArmA vehicles.

Arma 3 Update 1.60 comes with a new way how to handle multiple muzzle animation sources for weapons:

  • The following may be used with indexes ranging from -1 to (number of muzzles - 1) in format "name.x" (e.g. reload.0):
    • revolving
    • ammo
    • ammoRandom
    • reload
    • trigger
    • reloadMagazine
    • hasMagazine
    • isEmptyNoReload
    • isEmpty
    • zeroing
    • weaponMode
  • Index -1 means currently selected muzzle, index 0 means first muzzle of given weapon, index 1 second and so on
  • Animation sources without indexes should behave the same way as before.
Name Description Simulation Classes
altBaro The baro altitude. Aircraft, Weapon
altRadar The radar altitude. Aircraft
altSurface(A3) Altitude above land surface (ignoring water). Usable for wavebreakers on amphibious vehicles or possibly water depth indicators for ships. CarX + ?
cyclicAside rotor mast machinery (or rotor) animations based on cyclic controls Helicopter
cyclicForward rotor mast machinery (or rotor) animations based on cyclic controls Helicopter
gear The vehicle's gear. 0 when Gear is down(outside), 1 when Gear is up(folded) Aircraft
horizonBank The banking angle of the vehicle. Aircraft
horizonDive The diving angle of the vehicle. Aircraft
vertSpeed The vertical speed. Aircraft
aileron The main aileron control surfaces. Airplane
aileronB The bottom speed brake as opening ailerons. Airplane
aileronT The top speed brake as opening ailerons. Airplane
aoa The Angle Of Attack. Airplane
elevator The elevators. For missiles min & max values are calculated by reading maneuvrability attribute from cfgAmmo. Value is multiplied by +/-0.25 Airplane, Missiles
flap The flaps. 0 when disabled, 0.5 when half deployed, 1 when fully deployed Airplane
rotor The rotors. Airplane
propeller Animation of propeller in water. Activates only when in water. Dependant on travel direction of vehicle and thrust or speed. CarX, BoatX, TankX, + ?
rudder The rudder controlls. For missiles min & max values are calculated by reading maneuvrability attribute from cfgAmmo. Value is multiplied by +/-0.25 Airplane, Missiles
speedBrake The speed brake. Airplane
thrustVector For animating VTOL elements (e.g. Osprey Tilt rotors). 0 when in horizontal flight, 1 when in hover mode. Airplane
direction The orientation of the vehicle. Any
waypointDirection direction to waypoint Any
fuel The fuel level. 0 when tank is empty, 1 when tank is full Any
oil IndicatorOilTemp [Does not work in A3] ?
engineTemp Temperature state of the vehicle engine [A3 post 1.66 only] any ?
wheelsTemp Temperature state of the vehicles wheels [A3 post 1.66 only] any ?
turretGunTemp Temperature state of the vehicles primary gun [A3 post 1.66 only] any ?
exhaustIntensity ? Plane + ? (not tankX)
gmeter Total g-forces. Any
gmeterx g-force component in x direction. Any
gmetery g-force component in y direction. Any
gmeterz g-force component in z direction. Any
rpm The rpm of the vehicle. Used in rpm indicators. Any(except Ship)
speed The speed of the vehicle. Used in speed indicators. (WARNING: 'maxValue' and 'minValue' should be in meters per second) Any
time Timer-based input. Any
timeRndOffset Timer-based input + random offset (per object on spawn, offset constant) Any
objRandom random value per object on spawn, constant value Any
clockHour
The current time in hours. Any (including e.g. Weapon)
clockHour24 The current time in hours in 24h scale. Any (including e.g. Weapon)
clockMinute The current time in minutes. Derived from clockHour. Any (including e.g. Weapon)
clockSecond The current time in seconds. Moves discreetly every second and independently from clockHour. Any (including e.g. Weapon)
damage Current damage level (0=healthy, 1=destroyed) Any
user User defined (script driven) animation Any
userPositionHashedInit Randomized user defined (script driven) animation. This source is utilized on i.e. Tanoa gates and it is using initPhaseArray[] = {0.5, 0.75, 1}; to randomize initial state Any
direct Like user, but immediate, no smooth transition. Any
pedals The pedals. Bicycle
damper The suspension of the vehicle. Currently only works with type translationY. Car, Tank, Aircraft, Motorcycle
FrontDamper The suspension of the front wheels of the vehicle. Car?
BackDamper The suspension of the back wheels of the vehicle. Car?
drivingWheel The orientation of the steering wheel. Used for the steering wheel and steered wheels. Car, Ship, Motorcycle, Tank
*mainGun The main gun. *Alternatively defined with animationSourceGun in the turret config. Car, Tank, Helicopter, Ship
*mainTurret The main turret. *Alternatively defined with animationSourceBody in turret config. Car, Tank, Helicopter, Ship
wheel Normal wheels that turn based on moving forward. Car, Airplane, Motorcycle
noseWheelTurn Airplane
compassArrow The arrow. Compass
compassCover The cover. No longer works in Arma 3 and always return 1. Compass
compassPointer The pointer. Compass
rotorH The 'horizontal' rotor. Helicopter
rotorV The 'vertical' rotor. Helicopter
rotorHDive Tilt of the 'horizontal' rotor. Helicopter
rotorVDive Tilt of the 'vertical' rotor. Helicopter
support The support stand. Motorcycle
*hatchCommander The commander hatch. *Alternatively defined with animationSourceHatch in the turret config. Tank
hatchDriver The driver hatch. Tank
*hatchGunner The gunner hatch. *Alternatively defined with animationSourceHatch in the turret config. Tank
*obsGun The observer or commander gun. *Alternatively defined with animationSourceGun in the turret config. Tank
*obsTurret The observer or commander turret. *Alternatively defined with animationSourceBody in the turret config. Tank
reload The movement when reloading. Source is 1 as soon as shot is fired and returns to 0 within in reload time. Weapon
revolving Source is 1.0 at full magazine and 0 at empty magazine. After each shot, the source will reduce by a fraction (1/magazincapacity) within the reloadTime from the weapon, i.e. a smooth transition. Weapon
isempty The animation to hold the bolt open when the weapon is empty. Weapon
turretDir The orientation of the turret. Tank
wheelL The left track wheels. Tank
wheelR The right track wheels. Tank
scudLauncher Phase of scudlaunch. Scud
flag Runs from 0 to 1 as flag is taken from flagpole. Flagcarrier
airspeedIndicatorRTD speed / maxSpeed RTD helicopter
altBaroRTD altitude in meters RTD helicopter
vertSpeedRTD vertical speed / max speed RTD helicopter
attitudeBankRTD radians RTD helicopter
attitudeDiveRTD radians RTD helicopter
skidRTD speed / helicopter >> maxSpeed RTD helicopter
altRadarRTD altitude above ground in meters RTD helicopter
rpm1RTD engine 1 rmp / designed max rpm RTD helicopter
rpm2RTD engine 2 rmp / designed max rpm RTD helicopter
rpm3RTD engine 3 rmp / designed max rpm RTD helicopter
temp1RTD engine 1 temperature / helicopter >> DamagePropertiesRTD >> maxEngineTemperature RTD helicopter (only TKOH)
temp2RTD engine 2 temperature / helicopter >> DamagePropertiesRTD >> maxEngineTemperature RTD helicopter (only TKOH)
temp3RTD engine 3 temperature / helicopter >> DamagePropertiesRTD >> maxEngineTemperature RTD helicopter (only TKOH)
torqueRTD torque / helicopter >> DamagePropertiesRTD >> maxTorque RTD helicopter
mainRotorRPMRTD Main Rotor RPM / designed max RPM RTD helicopter
tailRotorRPMRTD Tail Rotor RPM / designed max RPM RTD helicopter
collectiveRTD collective (0, 1) RTD helicopter
rudderRTD Pedals (-1, 1) RTD helicopter
throttleRTD1 (0, 1) RTD helicopter
throttleRTD2 (0, 1) RTD helicopter
throttleRTD3 (0, 1) RTD helicopter
torqueEng1RTD (0, 1) RTD helicopter
torqueEng2RTD (0, 1) RTD helicopter
torqueEng3RTD (0, 1) RTD helicopter
collective collective (0, 1) Helicopter
IsEmptyNoReload (A3) 1 when empty and not reloading magazine Weapon
reloadMagazine (A3) Phase of magazine reload. For Handweapons 0 at the beginning and 1 at reloadTime. For Vehicle Weapons 1 at beginning, 0 after reloadTime. 0 When no reload happens. Only for first muzzle of weapon affects this. Weapon
reloadMagazine2 (A3) same as reloadMagazine. Used for second and all consequent muzzles. (obsolete with indexing) Weapon
ammo (A3) Number of remaining ammo in magazine (that means revolving * count). Transition is discrete, i.e. immediate switch from 45.0 to 44.0 for example. Weapon
ammoRandom (A3) Random value changing with every shoot fired from given magazine. Weapon
zeroing1 (A3) Current position in discreteDistance array for first muzzle. Weapon
zeroing2 (A3) Current position in discreteDistance array for second muzzle. Weapon
hasOptics (A3) Binary value of weapon having active optics in its TOP slot. Weapon
hasAccessory (A3) Binary value of weapon having active accessory in its SIDE slot. Weapon
hasSuppressor (A3) Binary value of weapon having active suppressor in its MUZZLE slot. Weapon
hasUnderbarrel (A3) Binary value of weapon having active bipod in its UNDERBARREL slot. Weapon
hasMagazine (A3) Binary value of weapon having active magazine. Weapon
weaponMode (A3) Current position in modes[] array of a weapon. Useful for fire selector switches etc. Weapon
weaponMuzzle (A3) Current position in muzzles[] array of a weapon. Useful for ladder sights that deploy when grenade launcher muzzle is selected. Weapon
isSelected (A3) Returns if the weapon is currently selected. Usefull for folding stocks and similar. Weapon
primaryWeaponMode untested Weapon
primaryWeaponZeroing untested Weapon
Throttle (A3) How much is the throttle used (0-1) Transport
Brake (A3) How much is the brake used (0-0.5) Transport
maxHoldsterValue (A3) holdsterAnimValue of currently selected weapon Transport
*ObsElevation (A3) Raise turret/Lower turret action. *Alternatively defined with animationSourceElevation in the turret config. Transport
RotorHFullyDestroyed (A3) 0 by default, 1 if the main rotor has been destroyed by impact Helicopter
tailRotorHFullyDestroyed (A3) 0 by default, 1 if the tail rotor has been destroyed by impact Helicopter
bipod_legs (A3) Binary value if bipod is deployed (1) or not (0) Weapon attachment
bipod (A3) Binary value if inbuilt bipod is deployed (1) or not (0) Weapon
bipod_legs_length (A3) Length of adjustable bipod legs (distance between bipod point and surface in meters) Weapon attachment
bipod_length (A3) Length of adjustable bipod legs (distance between bipod point and surface in meters) Weapon
trigger (A3) Actual animation phase of trigger finger animation Weapon
collisionLights(A3) Position lights ?
MarkerLight used in AnimationSources class together with markerLight parameter i.e. (CollisionRed) linking to MarkerLights class. Source is 1 when light is on Vehicle
pilotCameraRotX(A3) The turning (yawing) of pilotCamera Airplane, Helicopter
pilotCameraRotY(A3) The elevation (pitching) of pilotCamera Airplane, Helicopter
vehicleTransporting 0 when the vehicle is not transporting any vehicle, 1 when it is. Vehicle
vehicleTransported 0 when the vehicle is not being transported, 1 when the vehicle is being transported in another vehicle. Vehicle
slingloading 0 when the vehicle is not transporting any vehicle, 1 when it is. Progress between 0-1 should be gradual (same as in Sling Load Assistant) Vehicle
slingloaded 0 when the vehicle is not being sling loaded, 1 when the vehicle is being sling loaded by another vehicle. Vehicle
thrusttime Goes from 0 after initTime is rached to thrustTiime value from cfgAmmo. Missiles
initTime Goes from 0 to initTime value from cfgAmmo. I.e. if you have initTime = 0.15 in missile config, maxValue for this source will be 0.15 Missiles
state Engine state: 0 - init, 1 - thrust, 2 - fly Missiles
activeSensorsPhase Loop going from 0 to 1 (1 minute). Activated when radar is turned on Vehicles
activeSensorsOn 1 when radar is activated Vehicles
isPiP 1 when Picture in Picture is enabled in settings Vehicles
drivingstickLeft 1 when thrustL (see EPEVehicle diagnostic view) is at 1 Tank
drivingstickRight 1 when thrustR (see EPEVehicle diagnostic view) is at 1 Tank
damageTracks Returns same value as tracks damage control in vehicle info GUI Tank
damageWheels Returns same value as wheels damage control in vehicle info GUI Car
inWater Returns 1 when vehicle is in water Vehicles
Animation types

This table outlines the Animation Types you can use for an animation class.

Type Description
rotation Circular motion.
rotationX Idem, but locked to the X axis.
rotationY Idem, but locked to the Y axis.
rotationZ Idem, but locked to the Z axis.
translation Motion along one axis.
translationX Idem, but locked to the X axis.
translationY
Idem, but locked to the Y axis.
translationZ Idem, but locked to the Z axis.
hide Hide once given threshold is reached
direct Rotation and/or translation (without using selection in model as axis)
Animation Properties

This table outlines the properties (or entries) that each defined animation class expects to be present based on the animation type that is specified.

Eg. If you specify a an animation type of 'rotationX' you must specify the animation properties 'angle0' and 'angle1'.

Property Description Animation Type
source Controller used for input. Any
selection Skeleton bone. Any
axis
Model axis. Any
begin
Starting point of an oriented model axis.
This can be used in combination with end instead of axis.
Any
end
Ending point of an oriented model axis.
This can be used in combination with begin instead of axis.
Any
memory Optional (default is true). Axis in memory level or not? Any
animPeriod Time in seconds for one animation cycle.
Only used by user controllers.
Any
minValue Minimum value of the motion range. i.e. Controller input when the animation phase is 0. Any
maxValue Maxmimum value of the motion range. i.e. Controller input when the animation phase is 1. Any
phaseBeg Minimum phase of the animation.i.e.
Animation phase when the controller value is 0.
Any
phaseEnd Maxmimum value of the motion range.i.e.
Animation phase when the controller value is 1.
Any
sourceAddress Does the animation loop or not? This can be any of three different values: clamp (default), loop or mirror. Any
angle0 Starting angle of this animation, where the animation phase is 0. Rotations
angle1 Ending angle of this animation, where the animation phase is 1. Rotations
offset0 Starting offset of this animation, where the animation phase is 0. Translations
offset1 Ending offset of this animation, where the animation phase is 1. Translations
hideValue Threshold for hiding ("hides selection once hidevalue is reached") Hide
unHideValue (A3 only) Threshold for unhiding (unhides it again after it was already hidden). Value Must be larger than hideValue Hide
axisPos[] Position of axis in model space Direct
axisDir[] Direction of axis (vector) Direct
angle Angle of rotation in degrees! Direct
axisOffset Used for translation Direct

AnimationSources

This is not part of the model cfg, but part of the main configuration file. This class allows you to define new user controllers or modify selected properties of existing controllers.

Defining custom controllers makes it possible to use one custom controller for several different animations. If an animation does not define the source parameter, the program looks for a custom controller defined in this class with the same name.

It is also possible to override an existing controller using this class, but be extremely careful in this case. The custom controller will hide the original one, leaving the latter inaccessible. Overriding is done using the :: notation in the source parameter as can be seen in the third example.

class AnimationSources
{
	class MachineGun
	{
		source = "reload";		// The controller used for the definition of this controller.
		weapon = MachineGun25W; // In the specific case of using the reload controller, the weapon class name.
	};
};

See also controller, reload.

class AnimationSources
{
	// Used by animations called Door1, which don't define the source
	// parameter or by animations that define source = Door1;.
	class Door1
	{
		source = "user";	// The controller is defined as a user animation.
		animPeriod = 1;		// The animation period used for this controller.
		initPhase=1;		// Initial phase when object is created.
	};
};

See also source.

class AnimationSources
{
	class wheel
	{
		source = "::wheel"; // Overriding the existing wheel controller.
	};
};

See also wheel.

config.cpp model.cfg relationship

Below is the class name relationship between the two for a user, (or modified), source. Poetic licence used

class CfgModels
{
	class NameOfP3d
	{
		class Animations
		{
			class ModelClassName
			{
				selection = BoneName;
				source = AnimClassName;	// optional
				source = user;			// optional. default AnimClassName == ModelClassName
			};
		};
	};
};
class CfgVehicles
{
	class ModelName
	{
		class AnimationSources
		{
			class AnimClassName
			{
				AnimPeriod = 1;				// mandatory. in seconds.
				source = "user";			// optional. default = user
				InitPhase = 1;				// optional. default = 0
				weapon = WeaponClassName;	// only for source = reload;
			};
		};
		class UserActions
		{
			class MeaninglessName
			{
				......
				onlyforplayer = true/false;							// mandatory
				statement = "this animate ['AnimClassName', 1];";	// executed when action is triggered
			};
		};
	};
};
  • most constructions avoid confusion: AnimClassName==ModelClassName==BoneName
  • the word 'user' in both cfg and cpp appears to be, a) redundant, b) the default

See Also