Vehicle Loadouts – Arma 3

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "{{ExternalLink|" to "{{Link|")
(20 intermediate revisions by 6 users not shown)
Line 1: Line 1:
[[Category:Arma 3: Editing]]
{{TOC|side}}
{{Cfg ref|abc}}
In-game customization of vehicle's external armament.
==Overview==
{{Feature | important | '''Forum thread: {{Link|link= https://forums.bistudio.com/topic/202173-dynamic-loadout-feedback/|text= Dynamic Loadouts}}''' }}
In-game customization of vehicle's external armament.  
=== '''Forum thread: [https://forums.bistudio.com/topic/202173-dynamic-loadout-feedback/ Dynamic Loadouts]''' ===


=Goal=
 
* allow players to add/change weapons on vehicle's hardpoints on the begining of a mission, during the mission, in 3DEN,...  
== 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
* 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=
 
== Features ==
 
* done similarly to how the current missiles work - by a proxy system with simulation "maverick"
* 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
** allows to set missile directly on pylon by pylon ID
Line 15: Line 17:
** future-compatible with non-missile equipment such as fuel tanks, pylon mounted HMG, electronics equipment,...
** future-compatible with non-missile equipment such as fuel tanks, pylon mounted HMG, electronics equipment,...


=Configuration=
 
====CfgNonAIVehicles: simulation: pylonpod====
== Configuration ==
<syntaxhighlight lang="c">
 
==== CfgNonAIVehicles: simulation: pylonpod ====
 
<syntaxhighlight lang="cpp">
class CfgNonAIVehicles
class CfgNonAIVehicles
{
{
    class ProxyWeapon;
class ProxyWeapon;
    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 ====
<syntaxhighlight lang="c">
 
<syntaxhighlight lang="cpp">
class CfgMagazines
class CfgMagazines
{
{
Line 38: Line 44:
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";
initSpeedY = -25; // Y, minus for down speed
initSpeedZ = 0; // Z, aside missile eject speed
};
};
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
};
};
Line 58: Line 66:
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};
};
};
};
};
</syntaxhighlight>
</syntaxhighlight>


===Arma 3 hardpoint naming example===
Parameters used by gunpods or rocket pods without proxies
 
<syntaxhighlight lang="cpp">
class PylonRack_12Rnd_PG_missiles: 24Rnd_PG_missiles
{
displayName = "DAGR";
count = 12;
hardpoints[] = {"B_MISSILE_PYLON", "DAGR"};
model = "\A3\Weapons_F\DynamicLoadout\PylonPod_Rocket_DAGR_F.p3d";
muzzlePos = "muzzlePos";
muzzleEnd = "muzzleEnd";
};
</syntaxhighlight>
 
=== Arma 3 hardpoint naming example ===
 
* B_BOMB_PYLON - default Blufor bomb pylon, attachable NATO bomb + NATO ejectors
* B_BOMB_PYLON - default Blufor bomb pylon, attachable NATO bomb + NATO ejectors
* O_BOMB_PYLON - default Opfor bomb pylon
* O_BOMB_PYLON - default Opfor bomb pylon
Line 71: Line 94:


=== pylonWeapon property ===
=== pylonWeapon property ===
* Pylon magazines require double side connection of pylon weapons and pylon magazine
* 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
* 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:
Example:
<syntaxhighlight lang="c">                                        
<syntaxhighlight lang="cpp">
class CfgMagazines
class CfgMagazines
{
{
    class PylonPod_AA
class PylonPod_AA
    {
{
        pylonWeapon = "Missile_AGM_02_Plane_CAS_01_F";
pylonWeapon = "Missile_AGM_02_Plane_CAS_01_F";
    };
};
};
};
class CfgWeapons
class CfgWeapons
{
{
    class Launcher_AA
class Launcher_AA
    {
{
        magazines[] = {PylonPod_AA};      
magazines[] = {PylonPod_AA};
    };
};
    class Launcher_AA_v2
class Launcher_AA_v2
    {
{
        magazines[] = {PylonPod_AA};      
magazines[] = {PylonPod_AA};
    };  
};
};  
};
</syntaxhighlight>
</syntaxhighlight>
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====
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:
<sqf>
veh addWeapon "Launcher_AA_v2";
// then
veh setPylonLoadout [1, "PylonPod_AA"];
</sqf>
In this case Launcher_AA will not be added because compatible weapon is already present


<syntaxhighlight lang="c">
==== vehicle config - CfgVehicles ====
 
<syntaxhighlight lang="cpp">
class CfgVehicles
class CfgVehicles
{
{
    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;
    };
};
    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 // Pylons are indexed to aircraft model's proxies IDs in the order they are written in 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
                    };
};
                    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{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 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 pylons7: pylons4 { mirroredMissilePos = 4; };
                    class pylons8:pylons3{mirroredMissilePos = 3};
class pylons8: pylons3 { mirroredMissilePos = 3; };
                    class pylons9:pylons2{mirroredMissilePos = 2;};
class pylons9: pylons2 { mirroredMissilePos = 2; };
                    class pylons10:pylons1{mirroredMissilePos = 1;}; // right wingtip
class pylons10: pylons1 { mirroredMissilePos = 1; }; // right wingtip
                };
};
                class Bays
class Bays
                {
{
                    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;
                };
};
            };
};
`    };
};
    };
};
};
};
</syntaxhighlight>
</syntaxhighlight>
* pylons:hardpoint: if one or more matches with magazine:hardpoints then magazine can be attached, setPylonLoadOut with force = true will ignore this check.


=Scripting=
* pylons:hardpoint: if one or more matches with magazine:hardpoints then magazine can be attached, setPylonLoadout with force = true will ignore this check.
    vehicle [[setPylonLoadOut]] [pylonID, magazine name, forced = false, turret path = []]
 
 
== Scripting ==
 
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
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  
* return list of compatible magazines, number > 0 or class name for one given pylon, or 0 for array of all pylons
----
 
Here is a demonstration of how to gather and store a pylon loadout in script form:
=== Saving and restoring ===
# 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>
Here's a demo on how to gather and store pylon loadouts in script form:
# Open your text editor, and copy-paste the following: <sqf>
private _pylons = /* paste your data here */;
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;
</sqf>
# Create a new scenario in the Eden editor, add your vehicle, adjust the pylon loadout, and set its "Object Init" to: <sqf>copyToClipboard str getPylonMagazines this</sqf>
# 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, and paste the loadout in the {{hl|_pylons}} variable.
# 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 {{hl|_vehicle}} variable before calling it.
<br/>
 
== Animation sources ==
 
=== plane/helicopter ===


=Animation sources=
===plane/helicopter===
* bay.1, bay.2,...bay.X - animation state of bay
* 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
* pylonReadyPos.X - animation state of pylon, missile is released when anim. state of bay and pylon is 1
Line 203: Line 246:
* pylonRevolving.X - revolving state of weapon on given pylon
* pylonRevolving.X - revolving state of weapon on given pylon


===magazine===
=== magazine ===
* revolving - revolving state of weapon, can be used in model.cfg for model of magazine/pylon ejector model  
 
* 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
* ammo - real count of ammunition from 0 to maxAmmo
* reload - reload state of pylon magazine, same as reload for non - pylon weapons
* reload - reload state of pylon magazine, same as reload for non - pylon weapons




= Related =
== See Also ==
 
* [[CfgAmmo_Config_Reference|CfgAmmo]]
* [[CfgAmmo_Config_Reference|CfgAmmo]]
* [[CfgVehicles_Config_Reference|CfgVehicles]]
* [[CfgVehicles_Config_Reference|CfgVehicles]]
* [[CfgMagazines_Config_Reference|CfgMagazines]]
* [[CfgMagazines_Config_Reference|CfgMagazines]]
* [https://forums.bistudio.com/topic/202173-dynamic-loadout-feedback/ Dynamic Loadouts thread]
* {{Link|link= https://forums.bistudio.com/topic/202173-dynamic-loadout-feedback/|text= Dynamic Loadouts forum thread}}
 
 
{{GameCategory|arma3|Vehicle Configuration}}

Revision as of 17:21, 4 January 2023

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";
		initSpeedY		= -25; // Y, minus for down speed
		initSpeedZ		= 0; // Z, aside missile eject speed
	};
	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};
	};
};

Parameters used by gunpods or rocket pods without proxies

class PylonRack_12Rnd_PG_missiles: 24Rnd_PG_missiles
{
	displayName = "DAGR";
	count = 12;
	hardpoints[] = {"B_MISSILE_PYLON", "DAGR"};
	model = "\A3\Weapons_F\DynamicLoadout\PylonPod_Rocket_DAGR_F.p3d";
	muzzlePos = "muzzlePos";
	muzzleEnd = "muzzleEnd";
};

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"; // 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 = /* paste your data here */; 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:
  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, and paste the loadout in the _pylons variable.
  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


See Also