Arma 3 Scripting

Arma 3: Cars Config Guidelines

  • Also known as Arma 3 Cars Config Guidelines, Arma 3 Cars Config Guidlines, Arma 3: Cars Config Guidlines

Topic · Markdown · JSON · original wiki page

Important:
Please be aware of the Arma 3: Modding License.

Additional functionality compared to A2/OA

Model requirements {p3d}

Model config changes {model.cfg}

{model.cfg}

class Wheel_1_1_Damper
{
    type = "translation";
    source = "damper";
    selection = "wheel_1_1_damper_land";
    axis = "posun wheel_1_1";
    animPeriod = 1;
    minValue = "0";
    maxValue = "1";
    offset0 = "0.5";
    offset1 = "-0.5";
    memory = 1;
};

New config parameters {config.cpp}

Basic parameters

Following parameters are defined in vehicle class.

Differential parameters

Make sure you use values in the specified range to prevent PhysX errors

A good starting value is around 1.3.

Engine parameters

A starting value might be around 600.

Note: you can also use math in this definition, here is the same example from above using this technique:

Wheel parameters

This parameters relates to each wheel. In the vehicle class, there has to be subclass called Wheels, which contains subclass for every wheel the vehicle has. These are the parameters that could be defined in that subclasses.

General parameters

Wheel PX parameters

Wheel simulation parameters

points straight downwards is a good starting point.

Suspension parameters

Tire parameters

Floating and sinking

WaterLeakiness should be amount of water in liters that goes into selected object per second. This is set to zero by engine for all vehicles with simulation of a ship or having canFloat = 1 (unless they are toppled of destroyed, then config value takes precedence). WaterLeakiness = 10; seems to be a good value to start with for all kinds of vehicles no matter the size (which is a bit spooky, but it works).

PhysX 3 integration

WheelMask

Anti-roll bars

Complex gearbox

{config.cpp}

class complexGearbox
{
    GearboxRatios[] = { "R1", -3.231, "N", 0, "D1", 2.462, "D2", 1.870, "D3", 1.241, "D4", 0.970, "D5", 0.711 };
    TransmissionRatios[] = { "High", 4.111 }; // Optional: defines transmission ratios (for example, High and Low range as commonly found in offroad vehicles)
    moveOffGear            = 1; // defines what gear an automatic or semi-automatic gearbox will move off from stationary in. 1 by default.
    driveString            = "D"; // string to display in the HUD for forward gears.
    neutralString        = "N"; // string to display in the HUD for neutral gear.
    reverseString        = "R"; // string to display in the HUD for reverse gears.
};

Gearbox parameters

Different amount of torque

IK for hands and legs

Picture in Picture for screens and mirrors

{config.cpp}

class RenderTargets
{
    class LeftMirror
    {
        renderTarget = "rendertarget0";

        class CameraView1
        {
            pointPosition        = "PIP0_pos";
            pointDirection        = "PIP0_dir";
            renderQuality         = 2;
            renderVisionMode     = 0;
            fov                 = 0.7;
        };

        BBoxes[]    = { "PIP0_TopLeft", "PIP0_TopRight", "PIP0_BottomLeft", "PIP0_BottomRight" };
    };
};

Random visual variants

Random variants script

Reflectors, markerlights and beacons

Reflectors

Markerlights

Beacons

Steering properties for player

{config.cpp}

class myCar_F : Car_F
{
    class PlayerSteeringCoefficients // steering sensitivity configuration
    {
        turnIncreaseConst    = 0.3; // basic sensitivity value, higher value = faster steering
        turnIncreaseLinear    = 1.0; // higher value means less sensitive steering in higher speed, more sensitive in lower speeds
        turnIncreaseTime    = 1.0; // higher value means smoother steering around the center and more sensitive when the actual steering angle gets closer to the max. steering angle

        turnDecreaseConst    = 5.0; // basic caster effect value, higher value = the faster the wheels align in the direction of travel
        turnDecreaseLinear    = 3.0; // higher value means faster wheel re-centering in higher speed, slower in lower speeds
        turnDecreaseTime    = 0.0; // higher value means stronger caster effect at the max. steering angle and weaker once the wheels are closer to centered position

        maxTurnHundred        = 0.7; // coefficient of the maximum turning angle @ 100km/h; limit goes linearly to the default max. turn. angle @ 0km/h
    };
};

Compartments

// Driver
driverCompartments = "CompartmentX";

// Passengers - Unified in one compartment
cargoCompartments[] = {
   "CompartmentX"
};

// Passengers - Split in different compartments
// To set different passenger seats to different compartments, one has to define the compartment for each seat.
// The number of entries in array corresponds to the number of passenger seats. This does not include the FFV seats.
cargoCompartments[] = {
   "CompartmentX",
   "CompartmentX",
   "CompartmentY",
   ...
};

Firing from vehicles

{config.cpp}

class CargoTurret;
class Turrets : Turrets
{
    class CargoTurret_01 : CargoTurret
    {
        gunnerAction = "passenger_flatground_3";
        memoryPointsGetInGunner = "pos cargo RR";
        memoryPointsGetInGunnerDir = "pos cargo RR dir";
        gunnerName = "$STR_A3_TURRETS_CARGOTURRET_R2";
        gunnerCompartments = "Compartment2";
        proxyIndex = 2;
        isPersonTurret = 2; // this turret is able to fire both when turned in and out

        // Old view limits inbounce

        maxElev = 45;    // vertical limit for field of view
        minElev = -5;    // vertical limit for field of view
        maxTurn = 95;    // horizontal limit for field of view
        minTurn = -95;    // horizontal limit for field of view
        class dynamicViewLimits    // additional limits according to filled positions
        {
            CargoTurret_02[] = { -65, 95 };    // if CargoTurret_02 is filled, this turret cannot turn that much to negative way (limits from -95 to -65 degrees)
        };

        // New view limits inbounce

        class TurnIn // limits for gunner turned in
        {
            limitsArrayTop[] = { { 33.8208, -93.9616 }, { 40.8906, 66.5705 } }; // points for the upper curve
            limitsArrayBottom[] = { { -9.4643, -94.5753 }, { -8.3683, -67.6867 }, { -9.7173, 43.6372 }, { -10.1082, 78.9166 } }; // points for the lower curve
        };

        class TurnOut : TurnIn {}; // turn out uses the same limits as turn in this time
    };

    class CargoTurret_02 : CargoTurret {...}; // there is some second turret just to show the class name for dynamic limits
};

Plate Numbers

Configuration

Scripting commands for plate numbers:

_vehicle setPlateNumber "some string";

sets given string to selected vehicle

getPlateNumber _vehicle;

returns string with plate number

Basic Config Hints

Diagnostics

Suspension

Gearbox

Reference

This page is discussed on the BI forums.