Vehicle Loadouts – Arma 3

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Page refresh)
m (Text replacement - " ( *class [a-zA-Z0-9_]+): +" to " $1 : ")
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{SideTOC}}
{{TOC|side}}
In-game customization of vehicle's external armament.
In-game customisation of vehicle's external armament.
{{Important | '''Forum thread: [https://forums.bistudio.com/topic/202173-dynamic-loadout-feedback/ Dynamic Loadouts]''' }}
{{Feature|important|'''Forum thread: {{Link|link= https://forums.bistudio.com/topic/202173-dynamic-loadout-feedback/|text= Dynamic Loadouts}}'''.}}




== Goal ==
== Goal ==


* allow players to add/change weapons on vehicle's hardpoints on the begining of a mission, during the mission, in 3DEN,...
* 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 the real world.




Line 15: Line 15:
** allows to set missile directly on pylon by pylon ID
** allows to set missile directly on pylon by pylon ID
** supports both missile holder (rail) and multi-missile holder (rack)
** 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,...
** future-compatible with non-missile equipment such as fuel tanks, pylon mounted HMG, electronics equipment, ...




Line 26: Line 26:
{
{
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";
Line 42: Line 42:
{
{
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";
initSpeedY = -25; // Y, minus for down speed
initSpeedY = -25; // Y, minus for down speed
initSpeedZ = 0; // Z, aside missile eject 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";
Line 58: Line 59:
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
{
{
class MissileLauncher;
class MissileLauncher;
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 74: Line 76:


<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
class PylonRack_12Rnd_PG_missiles: 24Rnd_PG_missiles
class PylonRack_12Rnd_PG_missiles : 24Rnd_PG_missiles
{
{
displayName = "DAGR";
displayName = "DAGR";
count = 12;
count = 12;
hardpoints[] = {"B_MISSILE_PYLON", "DAGR"};
hardpoints[] = { "B_MISSILE_PYLON", "DAGR" };
model = "\A3\Weapons_F\DynamicLoadout\PylonPod_Rocket_DAGR_F.p3d";
model = "\A3\Weapons_F\DynamicLoadout\PylonPod_Rocket_DAGR_F.p3d";
muzzlePos = "muzzlePos";
muzzlePos = "muzzlePos";
Line 85: Line 87:
</syntaxhighlight>
</syntaxhighlight>


=== Arma 3 hardpoint naming example ===
=== {{arma3}} 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
* B_ASRAAM - build in ejector (mostly wing tip); only AIM-9 compatible missiles
* B_ASRAAM - build in ejector (mostly wing tip); only AIM-9 compatible missiles
* B_AH_99_PYLON - special pylons, only AH-99 compatible weapon
* 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.
{{hl|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.
 
Here is a list of all vanilla hardpoints: <spoiler>
{{Columns|3|
* "20MM_TWIN_CANNON"
* "ANTIMINE_DRONE_PYLON"
* "B_A143_BUZZARD_CENTER_PYLON"
* "B_AGM65_DUAL"
* "B_AGM65_DUAL_RAIL"
* "B_AGM65_RAIL"
* "B_AMRAAM_D_DUAL_RAIL"
* "B_AMRAAM_D_INT"
* "B_AMRAAM_D_RAIL"
* "B_ASRAAM"
* {{sic|"B_ASRRAM_EJECTOR"|B_ASRAAM_EJECTOR}}
* "B_BIM9X"
* "B_BIM9X_DUAL_RAIL"
* "B_BIM9X_RAIL"
* "B_BOMB_PYLON"
* "B_GBU12"
* "B_GBU12_DUAL_RAIL"
* "B_HARM_INT"
* "B_HARM_RAIL"
* "B_MISSILE_PYLON"
* "B_SDB_QUAD_RAIL"
* "B_SHIEKER"
* "B_ZEPHYR"
* "DAGR"
* "DAR"
* "I_AGM65_DUAL_RAIL"
* "I_AGM65_RAIL"
* "I_AMRAAM_C_DUAL_RAIL"
* "I_AMRAAM_C_RAIL"
* "I_BIM9X"
* "I_BIM9X_DUAL_RAIL"
* "I_BIM9X_RAIL"
* "I_GBU12"
* "I_ORCA_RIGHT_PYLON"
* "O_BOMB_PYLON"
* "O_BOMB_PYLON_HELI"
* "O_KAB250_BOMB"
* "O_KH25"
* "O_KH25_INT"
* "O_KH58"
* "O_KH58_INT"
* "O_MISSILE_PYLON"
* "O_R73"
* "O_R77"
* "O_R77_INT"
* "O_SKYFIRE"
* "SCALPEL_1RND"
* "SCALPEL_1RND_EJECTOR"
* "UNI_LEAFLETS_PYLON"
* "UNI_SCALPEL"
}}
</spoiler>


=== pylonWeapon property ===
=== pylonWeapon property ===
Line 112: Line 169:
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" };
};
};
};
};
Line 123: Line 181:
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.
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:
To add Launcher_AA_v2 call:
veh [[addWeapon]] "Launcher_AA_v2";
<sqf>
{{cc|then}}
veh addWeapon "Launcher_AA_v2";
veh [[setPylonLoadout]] [1, "PylonPod_AA"];
// then
In this case Launcher_AA will not be added because compatible weapon is already present
veh setPylonLoadout [1, "PylonPod_AA"];
</sqf>
In this case Launcher_AA will not be added because compatible weapon is already present.


==== vehicle config - CfgVehicles ====
==== vehicle config - CfgVehicles ====
Line 134: Line 194:
{
{
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
Line 157: Line 218:
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 pylons4: pylons1 { priority = 2; };
class pylons3 : pylons1 { priority = 3; };
class pylons5: pylons1 { priority = 1; };
class pylons4 : pylons1 { priority = 2; };
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 pylons5 : pylons1 { priority = 1; };
class pylons7: pylons4 { mirroredMissilePos = 4; };
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 pylons8: pylons3 { mirroredMissilePos = 3; };
class pylons7 : pylons4 { mirroredMissilePos = 4; };
class pylons9: pylons2 { mirroredMissilePos = 2; };
class pylons8 : pylons3 { mirroredMissilePos = 3; };
class pylons10: pylons1 { mirroredMissilePos = 1; }; // right wingtip
class pylons9 : pylons2 { mirroredMissilePos = 2; };
class pylons10 : pylons1 { mirroredMissilePos = 1; }; // right wingtip
};
};
class Bays
class Bays
{
{
Line 177: Line 241:
{
{
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;
{
{
Line 187: Line 252:
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 203: Line 269:
* 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
Line 214: Line 280:
* 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
Line 220: Line 286:
* 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


=== Saving and restoring ===
=== Saving and Restoring ===


Here's a demo on how to gather and store pylon loadouts in script form:
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/>[[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>
# Open your text editor, and copy-paste the following: <sqf>
# 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>
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 inline>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.




== Animation sources ==
== Animation Sources ==


=== plane/helicopter ===
=== 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
* pylonIsEmpty.X - return 1 when no magazine is attached on pylon
* pylonIsEmpty.X - return 1 when no magazine is attached on pylon
Line 249: Line 320:
== See Also ==
== 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 forum thread]
* {{Link|https://forums.bistudio.com/topic/202173-dynamic-loadout-feedback/|Dynamic Loadouts forum thread}}




[[Category:Arma 3: Vehicle Configuration]]
{{GameCategory|arma3|Vehicle Configuration}}

Latest revision as of 11:04, 6 December 2023

In-game customisation 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 the 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.

Here is a list of all vanilla hardpoints:

  • "20MM_TWIN_CANNON"
  • "ANTIMINE_DRONE_PYLON"
  • "B_A143_BUZZARD_CENTER_PYLON"
  • "B_AGM65_DUAL"
  • "B_AGM65_DUAL_RAIL"
  • "B_AGM65_RAIL"
  • "B_AMRAAM_D_DUAL_RAIL"
  • "B_AMRAAM_D_INT"
  • "B_AMRAAM_D_RAIL"
  • "B_ASRAAM"
  • "B_ASRRAM_EJECTOR"sic
  • "B_BIM9X"
  • "B_BIM9X_DUAL_RAIL"
  • "B_BIM9X_RAIL"
  • "B_BOMB_PYLON"
  • "B_GBU12"
  • "B_GBU12_DUAL_RAIL"
  • "B_HARM_INT"
  • "B_HARM_RAIL"
  • "B_MISSILE_PYLON"
  • "B_SDB_QUAD_RAIL"
  • "B_SHIEKER"
  • "B_ZEPHYR"
  • "DAGR"
  • "DAR"
  • "I_AGM65_DUAL_RAIL"
  • "I_AGM65_RAIL"
  • "I_AMRAAM_C_DUAL_RAIL"
  • "I_AMRAAM_C_RAIL"
  • "I_BIM9X"
  • "I_BIM9X_DUAL_RAIL"
  • "I_BIM9X_RAIL"
  • "I_GBU12"
  • "I_ORCA_RIGHT_PYLON"
  • "O_BOMB_PYLON"
  • "O_BOMB_PYLON_HELI"
  • "O_KAB250_BOMB"
  • "O_KH25"
  • "O_KH25_INT"
  • "O_KH58"
  • "O_KH58_INT"
  • "O_MISSILE_PYLON"
  • "O_R73"
  • "O_R77"
  • "O_R77_INT"
  • "O_SKYFIRE"
  • "SCALPEL_1RND"
  • "SCALPEL_1RND_EJECTOR"
  • "UNI_LEAFLETS_PYLON"
  • "UNI_SCALPEL"
↑ Back to spoiler's top

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: 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, 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