Vehicle Loadouts – Arma 3

From Bohemia Interactive Community
Jump to navigation Jump to search
(13 intermediate revisions by 6 users not shown)
Line 1: Line 1:
[[Category:Arma 3: Editing]]
[[Category:Arma 3: Editing]]
{{Cfg ref|abc}}
{{Cfg ref|abc}}
<div style="font-size:12pt;color:#FF0000;">!!! Current state of dynamic loadout is still work-in-progress. Names or parameters of config variables or script commands may change in future !!!</div>
==Overview==
==Overview==
In-game customization of vehicle's external armament.  
In-game customization of vehicle's external armament.  
Line 27: Line 23:
     class ProxyPylonPod_3x_Missile_AGM_02_F: ProxyWeapon
     class ProxyPylonPod_3x_Missile_AGM_02_F: ProxyWeapon
     {
     {
         model = "\A3\Weapons_F\DynamicLoadout\PylonPod_3x_Missile_AGM_02_F.p3d";
         model   = "\A3\Weapons_F\DynamicLoadout\PylonPod_3x_Missile_AGM_02_F.p3d";
         simulation = "pylonpod";
         simulation = "pylonpod";
     };
     };
};
};
</syntaxhighlight>
</syntaxhighlight>
This says to engine that model PylonPod_3x_Missile_AGM_02_F - used as proxy in parent model - is the place for an item under pylon. Proxy ID corresponds with ID in config and script command to determine where to draw the item.
This tells engine that model "PylonPod_3x_Missile_AGM_02_F" - used as proxy in parent model - is the place for an item under pylon. Proxy ID corresponds with ID in config and script command to determine where to draw the item.
Only models that are used in airplanes' P3Ds have to be CfgNonAIVehicles. Models that are only in CfgMagazines doen't need to be in CfgNonAIVehicles.
Only models that are used in airplane's P3Ds have to be CfgNonAIVehicles. Models that are only in CfgMagazines doen't need to be in CfgNonAIVehicles.


====Magazine and weapon====
====Magazine and weapon====
Line 40: Line 36:
{
{
     class 6Rnd_Missile_AGM_02_F;
     class 6Rnd_Missile_AGM_02_F;
    class PylonPod_1Rnd_Missile_AGM_02_F: 6Rnd_Missile_AGM_02_F
    class PylonPod_1Rnd_Missile_AGM_02_F: 6Rnd_Missile_AGM_02_F
     {
     {
         displayName       = "1x Macer";
         displayName             = "1x Macer";
         model = "\A3\Weapons_F\DynamicLoadout\PylonPod_1x_Missile_AGM_02_F.p3d";
         model                   = "\A3\Weapons_F\DynamicLoadout\PylonPod_1x_Missile_AGM_02_F.p3d";
         count = 1;
         count                   = 1;
         hardpoints[] = {"SUU_63_PYLON","BRU_32_EJECTOR","US_BOMB"};
         hardpoints[]           = {"SUU_63_PYLON","BRU_32_EJECTOR","US_BOMB"};
         pylonWeapon = "Missile_AGM_02_Plane_CAS_01_F";
         pylonWeapon             = "Missile_AGM_02_Plane_CAS_01_F";
     };
     };
     class PylonPod_3Rnd_Missile_AGM_02_F: PylonPod_1Rnd_Missile_AGM_02_F
     class PylonPod_3Rnd_Missile_AGM_02_F: PylonPod_1Rnd_Missile_AGM_02_F
     {
     {
         displayName       = "3x Macer";
         displayName             = "3x Macer";
         model = "\A3\Weapons_F\DynamicLoadout\PylonPod_3x_Missile_AGM_02_F.p3d";
         model                   = "\A3\Weapons_F\DynamicLoadout\PylonPod_3x_Missile_AGM_02_F.p3d";
         count = 3;
         count                   = 3;
         pylonWeapon = "Missile_AGM_02_Plane_CAS_01_F";
         pylonWeapon             = "Missile_AGM_02_Plane_CAS_01_F";
         mirrorMissilesIndexes[] = {2,1,3}; // when on pylon with mirroredMissilePos = true, proxies will be taken/fired in this order
         mirrorMissilesIndexes[] = {2,1,3}; // when on pylon with mirroredMissilePos = true, proxies will be taken/fired in this order
  };
    };
};
};
class CfgWeapons
class CfgWeapons
Line 62: Line 58:
     class Missile_AGM_02_Plane_CAS_01_F: MissileLauncher
     class Missile_AGM_02_Plane_CAS_01_F: MissileLauncher
     {
     {
         magazines[] = {6Rnd_Missile_AGM_02_F, PylonPod_1Rnd_Missile_AGM_02_F, PylonPod_3Rnd_Missile_AGM_02_F};
         magazines[]             = {6Rnd_Missile_AGM_02_F, PylonPod_1Rnd_Missile_AGM_02_F, PylonPod_3Rnd_Missile_AGM_02_F};
     };
     };
};
};
Line 108: Line 104:
{
{
     class Plane_Base_F;
     class Plane_Base_F;
     class Plane_CAS_01_base_F:Plane_Base_F
     class Plane_CAS_01_base_F: Plane_Base_F
     {
     {
         class Components;
         class Components;
Line 114: Line 110:
     class B_Plane_CAS_01_Pylons_F: Plane_CAS_01_base_F
     class B_Plane_CAS_01_Pylons_F: Plane_CAS_01_base_F
     {
     {
         class Components:Components
         class Components: Components
         {
         {
             class TransportPylonsComponent
             class TransportPylonsComponent
             {
             {
                 class pylons
                 class pylons // Pylons are indexed to aircraft model's proxies IDs in the order they are written in class Pylons
                 {
                 {
                     class pylons1 // left wingtip
                     class pylons1 // left wingtip
                     {
                     {
                         maxweight = 560; //kg ,magazine with higher mass will not be allowed on this pylon
                         maxweight     = 560;                           //kg ,magazine with higher mass will not be allowed on this pylon
                         hardpoints[] = {"B_BOMB_PYLON"}; // magazine with at least one same hardpoints name will be attachable
                         hardpoints[] = {"B_BOMB_PYLON"};               // magazine with at least one same hardpoints name will be attachable
                         //hardpoint[] = {"A164_PYLON_1_10","LAU_7","B_ASRAAM", "SUU_63_PYLON","BRU_32_EJECTOR","B_BOMB_PYLON",....}; // just example for community, I am sure you will go closer to realism
                         //hardpoint[] = {"A164_PYLON_1_10","LAU_7","B_ASRAAM", "SUU_63_PYLON","BRU_32_EJECTOR","B_BOMB_PYLON",....}; // just example for community, I am sure you will go closer to realism
                         attachment = "PylonPod_1Rnd_Missile_AA_04_F"; // default magazine
                         attachment   = "PylonPod_1Rnd_Missile_AA_04_F"; // default magazine
                         bay = -1; // index of bay for animation
                         bay           = -1;                             // index of bay for animation
                         priority = 5; // pylon with higher priority is used to fire missile first, this can by changed in run time by script command setPylonsPriority
                         priority     = 5;                               // pylon with higher priority is used to fire missile first, this can by changed in run time by script command setPylonsPriority
                         UIposition[] = {0.1, 0.25}; // x,y coordinates in 3DEN UI
                         UIposition[] = {0.1, 0.25};                     // x,y coordinates in 3DEN UI
                         turret[] = {}; // default owner of pylon/weapon, empty for driver
                         turret[]     = {};                             // default owner of pylon/weapon, empty for driver
                        mirroredMissilePos = false; // when true proxies/missiles on rack on this pylon will be re-indexed by magazine::mirrorMissilesIndexes[]
                     };
                     };
                     class pylons2:pylons1
                     class pylons2:pylons1
                     {
                     {
                         maxweight = 800; //kg
                         maxweight   = 800; //kg
                         attachment[] = {ProxyPylonPod_3x_Missile_AGM_02_F};
                         attachment[] = {ProxyPylonPod_3x_Missile_AGM_02_F};
                         priority = 4;
                         priority     = 4;
                     };
                     };
                     class pylons3:pylons1{priority = 3;};
                     class pylons3: pylons1 {priority = 3;};
                     class pylons4:pylons1{priority = 2;};
                     class pylons4: pylons1 {priority = 2;};
                     class pylons5:pylons1{priority = 1;};
                     class pylons5: pylons1 {priority = 1;};
                     class pylons6:pylons5{};
                     class pylons6: pylons5 {mirroredMissilePos = 5;}; // Will copy loadout from pylon 5 in when "Mirror" is checked in Eden loadout interface. And proxies/missiles racks on this pylon will be re-indexed by magazine::mirrorMissilesIndexes[]
                     class pylons7:pylons4{};
                     class pylons7: pylons4 {mirroredMissilePos = 4;};
                     class pylons8:pylons3{};
                     class pylons8: pylons3 {mirroredMissilePos = 3;};
                     class pylons9:pylons2{};
                     class pylons9: pylons2 {mirroredMissilePos = 2;};
                     class pylons10:pylons1{}; // right wingtip
                     class pylons10: pylons1 {mirroredMissilePos = 1;}; // right wingtip
                 };
                 };
                 class Bays
                 class Bays
Line 151: Line 146:
                     class BayCenter // corresponding to pylons/##pylon##/bay=1;
                     class BayCenter // corresponding to pylons/##pylon##/bay=1;
                     {
                     {
                         bayOpenTime = 1;
                         bayOpenTime               = 1;
                         openBayWhenWeaponSelected = 1.0; // float value, can be used to half open bay
                         openBayWhenWeaponSelected = 1.0; // float value, can be used to half open bay
                       
 
                        // -1 keep open, 0 close after last missile, > 0 keep open for given time after last shot                       
                        // -1 keep open, 0 close after last missile, > 0 keep open for given time after last shot                       
                         autoCloseWhenEmptyDelay = 2; // when last shot keep 2s open after last shot
                         autoCloseWhenEmptyDelay   = 2; // when last shot keep 2s open after last shot
                     };
                     };
                     class BayRight  // corresponding to pylons/##pylon##/bay=2;
                     class BayRight  // corresponding to pylons/##pylon##/bay=2;
                     {
                     {
                         bayOpenTime = 0.8;
                         bayOpenTime               = 0.8;
                         openBayWhenWeaponSelected = 0.0;
                         openBayWhenWeaponSelected = 0.0;
                     };
                     };
                     class BayLeft:BayRight{}; // corresponding to pylons/##pylon##/bay=3;
                     class BayLeft: BayRight{}; // corresponding to pylons/##pylon##/bay=3;
                 };
                 };
             };
             };
`    };
        };
     };
     };
};
};
Line 172: Line 167:


=Scripting=
=Scripting=
     vehicle setPylonLoadOut [pylonID, magazine name, forced = false, turret path = []]
     vehicle [[setPylonLoadOut]] [pylonID, magazine name, forced = false, turret path = []]
* adds missile to vehicle pylon; TransportPylonsComponent in config is required
* adds missile to vehicle pylon; TransportPylonsComponent in config is required
* pylonID can be number/index corresponding to order in config or string name of pylon in config   
* pylonID can be number/index corresponding to order in config or string name of pylon in config   
   vehicle setPylonsPriority [priority pylon 1, priority pylon 2,..., priority pylon n]
   vehicle [[setPylonsPriority]] [priority pylon 1, priority pylon 2,..., priority pylon n]
* overrides default pylons priorities
* overrides default pylons priorities
* can be used to make weapon fire in different order or to force burst of all weapons of same type
* can be used to make weapon fire in different order or to force burst of all weapons of same type
     vehicle AnimateBay [bay index, value <-1,1>, bool instant]
     vehicle [[animateBay]] [bay index, value <-1,1>, bool instant]
* will force bay to animate to given position, use -1 reset to default (engine driven) state
* will force bay to animate to given position, use -1 reset to default (engine driven) state
     vehicle AnimatePylon [pylon index, value <-1,1>, bool instant]
     vehicle [[animatePylon]] [pylon index, value <-1,1>, bool instant]
* will force pylon to animate to given position, use -1 reset to default (engine driven) state
* will force pylon to animate to given position, use -1 reset to default (engine driven) state
* both script command above will in case that state < 1 make attached weapon unable to release missile, because missile can be released only when bay.animation == 1 && pylon.animation == 1
* both script command above will in case that state < 1 make attached weapon unable to release missile, because missile can be released only when bay.animation == 1 && pylon.animation == 1
     vehicle AmmoOnPylon pylon name/index
     vehicle [[ammoOnPylon]] pylon name/index
* returns ammo count on given pylon
* returns ammo count on given pylon
     vehicle SetAmmoOnPylon [pylon name/index, ammo count]
     vehicle [[setAmmoOnPylon]] [pylon name/index, ammo count]
*  set count of ammo in magazine on pylon
*  set count of ammo in magazine on pylon
     GetPylonMagazines vehicle
     [[getPylonMagazines]] vehicle
* return array of magazines on pylons, size is equal to count of pylons
* return array of magazines on pylons, size is equal to count of pylons
----
    vehicle [[getCompatiblePylonMagazines]] string/index
Here is a demonstration of how to gather and store a pylon loadout in script form:
* return list of compatible magazines, number > 0 or class name for one given pylon, or 0 for array of all pylons
# Open your text editor, and copy-paste the following: <code>private _pylons = PASTEHERE;<br/>private _pylonPaths = ([[configProperties]] <nowiki>[</nowiki>[[configFile]] >> "CfgVehicles" >> [[typeOf]] _vehicle >> "Components" >> "TransportPylonsComponent" >> "Pylons", "isClass _x"]) [[apply]] {[[getArray]] (_x >> "turret")};<br/>private _nonPylonWeapons = [];<br/>{ _nonPylonWeapons [[append]] getArray (_x >> "weapons") } forEach ([_vehicle, [[configNull]]<nowiki>]</nowiki> call [[BIS_fnc_getTurrets]]);<br/>{ _vehicle [[removeWeaponGlobal]] _x } forEach (([[weapons]] _vehicle) - _nonPylonWeapons);<br/>{ _vehicle setPylonLoadOut [_forEachIndex + 1, _x, true, _pylonPaths [[select]] _forEachIndex] } [[forEach]] _pylons;</code>
 
===Saving and restoring===
Here's a demo on how to gather and store pylon loadouts in script form:
# Open your text editor, and copy-paste the following: <code>private _pylons = PASTEHERE;<br/>private _pylonPaths = ([[configProperties]] <nowiki>[</nowiki>[[configFile]] >> "CfgVehicles" >> [[typeOf]] _vehicle >> "Components" >> "TransportPylonsComponent" >> "Pylons", "isClass _x"]) [[apply]] {[[getArray]] (_x >> "turret")};<br/>{ _vehicle [[removeWeaponGlobal]] [[getText]] (configFile >> "CfgMagazines" >> _x >> "pylonWeapon") } forEach getPylonMagazines _vehicle;<br/>{ _vehicle setPylonLoadOut [_forEachIndex + 1, _x, true, _pylonPaths [[select]] _forEachIndex] } [[forEach]] _pylons;</code>
# Create a new scenario in the Eden editor, add your vehicle, adjust the pylon loadout, and set its Object Init to: <code>copyToClipboard str getPylonMagazines this</code>
# Create a new scenario in the Eden editor, add your vehicle, adjust the pylon loadout, and set its Object Init to: <code>copyToClipboard str getPylonMagazines this</code>
# Play scenario, wait until loaded, then pause the game and return to Eden.
# Play scenario, wait until loaded, then pause the game and return to Eden.
# Your pylon loadout is now in the clipboard; go back to your text editor, select <tt>PASTEHERE</tt> and paste the loadout.
# Your pylon loadout is now in the clipboard; go back to your text editor, select <tt>PASTEHERE</tt> and paste the loadout.
# The loadout code is ready; you must assign the target vehicle to the <tt>_vehicle</tt> variable before calling it.
# The loadout code is ready; you must assign the target vehicle to the <tt>_vehicle</tt> variable before calling it.
<br/>


=Animation sources=
=Animation sources=

Revision as of 19:15, 12 August 2017

Template:Cfg ref

Overview

In-game customization of vehicle's external armament.

Forum thread: Dynamic Loadouts

Goal

  • allow players to add/change weapons on vehicle's hardpoints on the begining of a mission, during the mission, in 3DEN,...
  • add system that will allow addon-makers (configs) and designers (scripts) manage weapons on vehicles (mainly helicopters and airplanes) in a similar way to how it works in real world

Features

  • done similarly to how the current missiles work - by a proxy system with simulation "maverick"
    • allows to set missile directly on pylon by pylon ID
    • supports both missile holder (rail) and multi-missile holder (rack)
    • future-compatible with non-missile equipment such as fuel tanks, pylon mounted HMG, electronics equipment,...

Configuration

CfgNonAIVehicles: simulation: pylonpod

class CfgNonAIVehicles
{
    class ProxyWeapon;
    class ProxyPylonPod_3x_Missile_AGM_02_F: ProxyWeapon
    {
        model	   = "\A3\Weapons_F\DynamicLoadout\PylonPod_3x_Missile_AGM_02_F.p3d";
        simulation = "pylonpod";
    };
};

This tells engine that model "PylonPod_3x_Missile_AGM_02_F" - used as proxy in parent model - is the place for an item under pylon. Proxy ID corresponds with ID in config and script command to determine where to draw the item. Only models that are used in airplane's P3Ds have to be CfgNonAIVehicles. Models that are only in CfgMagazines doen't need to be in CfgNonAIVehicles.

Magazine and weapon

class CfgMagazines
{
    class 6Rnd_Missile_AGM_02_F;
    class PylonPod_1Rnd_Missile_AGM_02_F: 6Rnd_Missile_AGM_02_F
    {
        displayName             = "1x Macer";
        model                   = "\A3\Weapons_F\DynamicLoadout\PylonPod_1x_Missile_AGM_02_F.p3d";
        count                   = 1;
        hardpoints[]            = {"SUU_63_PYLON","BRU_32_EJECTOR","US_BOMB"};
        pylonWeapon             = "Missile_AGM_02_Plane_CAS_01_F";
    };
    class PylonPod_3Rnd_Missile_AGM_02_F: PylonPod_1Rnd_Missile_AGM_02_F
    {
        displayName             = "3x Macer";
        model                   = "\A3\Weapons_F\DynamicLoadout\PylonPod_3x_Missile_AGM_02_F.p3d";
        count                   = 3;
        pylonWeapon             = "Missile_AGM_02_Plane_CAS_01_F";
        mirrorMissilesIndexes[] = {2,1,3}; // when on pylon with mirroredMissilePos = true, proxies will be taken/fired in this order
    };
};
class CfgWeapons
{
    class MissileLauncher;
    class Missile_AGM_02_Plane_CAS_01_F: MissileLauncher
    {
        magazines[]             = {6Rnd_Missile_AGM_02_F, PylonPod_1Rnd_Missile_AGM_02_F, PylonPod_3Rnd_Missile_AGM_02_F};
    };
};

Arma 3 hardpoint naming example

  • B_BOMB_PYLON - default Blufor bomb pylon, attachable NATO bomb + NATO ejectors
  • O_BOMB_PYLON - default Opfor bomb pylon
  • B_ASRAAM - build in ejector (mostly wing tip); only AIM-9 compatible missiles
  • B_AH_99_PYLON - special pylons, only AH-99 compatible weapon

Hardpoint[] is only array of string, when one or more hardpoint from magazine and pylon are same, and mass of missile is OK, weapon can be used.

pylonWeapon property

  • Pylon magazines require double side connection of pylon weapons and pylon magazine
  • Each weapon has to have a list of compatible magazines. No change here. But the new pylon magazine requires a new parameter called "pylonWeapon" with a name of default weapon which is added automatically when adding missile by setPylonLoadout script command or by 3DEN

Example:

                                         
class CfgMagazines
{
    class PylonPod_AA
    {
        pylonWeapon = "Missile_AGM_02_Plane_CAS_01_F";
    };
};
class CfgWeapons
{
    class Launcher_AA
    {
        magazines[] = {PylonPod_AA};       
    };
    class Launcher_AA_v2
    {
        magazines[] = {PylonPod_AA};       
    };   
};

In case of new vehicle in 3DEN, Launcher_AA will be added automatically. If you call script command setPylonLoadOut then only Launcher_AA will be added. To add Launcher_AA_v2 call: veh addweapon Launcher_AA_v2; and then {veh setPylonLoadOut [1, "PylonPod_AA"]; In this case Launcher_AA will not be added because compatible weapon is already present

vehicle config - CfgVehicles

class CfgVehicles
{
    class Plane_Base_F;
    class Plane_CAS_01_base_F: Plane_Base_F
    {
        class Components;
    };
    class B_Plane_CAS_01_Pylons_F: Plane_CAS_01_base_F
    {
        class Components: Components
        {
            class TransportPylonsComponent
            {
                class pylons // Pylons are indexed to aircraft model's proxies IDs in the order they are written in class Pylons
                {
                    class pylons1 // left wingtip
                    {
                        maxweight     = 560;                            //kg ,magazine with higher mass will not be allowed on this pylon
                        hardpoints[]  = {"B_BOMB_PYLON"};               // magazine with at least one same hardpoints name will be attachable
                        //hardpoint[] = {"A164_PYLON_1_10","LAU_7","B_ASRAAM", "SUU_63_PYLON","BRU_32_EJECTOR","B_BOMB_PYLON",....}; // just example for community, I am sure you will go closer to realism
                        attachment    = "PylonPod_1Rnd_Missile_AA_04_F"; // default magazine
                        bay           = -1;                              // index of bay for animation
                        priority      = 5;                               // pylon with higher priority is used to fire missile first, this can by changed in run time by script command setPylonsPriority
                        UIposition[]  = {0.1, 0.25};                     // x,y coordinates in 3DEN UI
                        turret[]      = {};                              // default owner of pylon/weapon, empty for driver
                    };
                    class pylons2:pylons1
                    {
                        maxweight    = 800; //kg
                        attachment[] = {ProxyPylonPod_3x_Missile_AGM_02_F};
                        priority     = 4;
                    };
                    class pylons3: pylons1 {priority = 3;};
                    class pylons4: pylons1 {priority = 2;};
                    class pylons5: pylons1 {priority = 1;};
                    class pylons6: pylons5 {mirroredMissilePos = 5;}; // Will copy loadout from pylon 5 in when "Mirror" is checked in Eden loadout interface. And proxies/missiles racks on this pylon will be re-indexed by magazine::mirrorMissilesIndexes[]
                    class pylons7: pylons4  {mirroredMissilePos = 4;};
                    class pylons8: pylons3  {mirroredMissilePos = 3;};
                    class pylons9: pylons2  {mirroredMissilePos = 2;};
                    class pylons10: pylons1 {mirroredMissilePos = 1;}; // right wingtip
                };
                class Bays
                {
                    class BayCenter // corresponding to pylons/##pylon##/bay=1;
                    {
                        bayOpenTime               = 1;
                        openBayWhenWeaponSelected = 1.0; // float value, can be used to half open bay

                        // -1 keep open, 0 close after last missile, > 0 keep open for given time after last shot                       
                        autoCloseWhenEmptyDelay   = 2; // when last shot keep 2s open after last shot
                    };
                    class BayRight   // corresponding to pylons/##pylon##/bay=2;
                    {
                        bayOpenTime               = 0.8;
                        openBayWhenWeaponSelected = 0.0;
                    };
                    class BayLeft: BayRight{}; // corresponding to pylons/##pylon##/bay=3;
                };
            };
        };
    };
};
  • pylons:hardpoint: if one or more matches with magazine:hardpoints then magazine can be attached, setPylonLoadOut with force = true will ignore this check.

Scripting

   vehicle setPylonLoadOut [pylonID, magazine name, forced = false, turret path = []]
  • adds missile to vehicle pylon; TransportPylonsComponent in config is required
  • pylonID can be number/index corresponding to order in config or string name of pylon in config
  vehicle setPylonsPriority [priority pylon 1, priority pylon 2,..., priority pylon n]
  • overrides default pylons priorities
  • can be used to make weapon fire in different order or to force burst of all weapons of same type
   vehicle animateBay [bay index, value <-1,1>, bool instant]
  • will force bay to animate to given position, use -1 reset to default (engine driven) state
   vehicle animatePylon [pylon index, value <-1,1>, bool instant]
  • will force pylon to animate to given position, use -1 reset to default (engine driven) state
  • both script command above will in case that state < 1 make attached weapon unable to release missile, because missile can be released only when bay.animation == 1 && pylon.animation == 1
   vehicle ammoOnPylon pylon name/index
  • returns ammo count on given pylon
   vehicle setAmmoOnPylon [pylon name/index, ammo count]
  • set count of ammo in magazine on pylon
   getPylonMagazines vehicle
  • return array of magazines on pylons, size is equal to count of pylons
   vehicle getCompatiblePylonMagazines string/index
  • return list of compatible magazines, number > 0 or class name for one given pylon, or 0 for array of all pylons

Saving and restoring

Here's a demo on how to gather and store pylon loadouts in script form:

  1. Open your text editor, and copy-paste the following: private _pylons = PASTEHERE;
    private _pylonPaths = (configProperties [configFile >> "CfgVehicles" >> typeOf _vehicle >> "Components" >> "TransportPylonsComponent" >> "Pylons", "isClass _x"]) apply {getArray (_x >> "turret")};
    { _vehicle removeWeaponGlobal getText (configFile >> "CfgMagazines" >> _x >> "pylonWeapon") } forEach getPylonMagazines _vehicle;
    { _vehicle setPylonLoadOut [_forEachIndex + 1, _x, true, _pylonPaths select _forEachIndex] } forEach _pylons;
  2. Create a new scenario in the Eden editor, add your vehicle, adjust the pylon loadout, and set its Object Init to: copyToClipboard str getPylonMagazines this
  3. Play scenario, wait until loaded, then pause the game and return to Eden.
  4. Your pylon loadout is now in the clipboard; go back to your text editor, select PASTEHERE and paste the loadout.
  5. The loadout code is ready; you must assign the target vehicle to the _vehicle variable before calling it.


Animation sources

plane/helicopter

  • bay.1, bay.2,...bay.X - animation state of bay
  • pylonReadyPos.X - animation state of pylon, missile is released when anim. state of bay and pylon is 1
  • pylonIsEmpty.X - return 1 when no magazine is attached on pylon
  • pylonReload.X - reload state of weapon on given pylon
  • pylonRevolving.X - revolving state of weapon on given pylon

magazine

  • revolving - revolving state of weapon, can be used in model.cfg for model of magazine/pylon ejector model
  • ammo - real count of ammunition from 0 to maxAmmo
  • reload - reload state of pylon magazine, same as reload for non - pylon weapons


Related