setPylonLoadout: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<h3 style="display:none">Bottom Section</h3> " to "")
m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame( +[0-9])?|Game [Vv]ersion( +[0-9])?|Game Version \(number surrounded by NO SPACES\)|Arguments in MP|MP[Aa]rg|Multiplayer Arguments( \("local" or "global"\))?|Effects|Execution|Effects...)
Line 1: Line 1:
{{Command|Comments=
{{Command


| arma3 |Game name=
| arma3


|1.70|Game Version=
|1.70


|eff= local |Multiplayer Effects=
|eff= local


|gr1= Vehicle Loadouts |GROUP1=
|gr1= Vehicle Loadouts


| Adds/overrides loadout to a vehicle pylon. <tt>TransportPylonsComponent</tt> in vehicle config and <tt>pylonWeapon</tt> in the magazine config are required to run. |DESCRIPTION=
| Adds/overrides loadout to a vehicle pylon. <tt>TransportPylonsComponent</tt> in vehicle config and <tt>pylonWeapon</tt> in the magazine config are required to run.


| vehicle '''setPylonLoadout''' [pylon, magazine, forced, turret]; |SYNTAX=
| vehicle '''setPylonLoadout''' [pylon, magazine, forced, turret];


|p1= vehicle: [[Object]] |PARAMETER1=
|p1= vehicle: [[Object]]


|p2= [pylon, magazine, forced, turret] : [[Array]] |PARAMETER2=
|p2= [pylon, magazine, forced, turret] : [[Array]]
|p3= pylon: [[Number]] or [[String]] - pylon index (index starts from 1) or pylon name (see [[getCompatiblePylonMagazines]] Example 4) |PARAMETER3=
|p3= pylon: [[Number]] or [[String]] - pylon index (index starts from 1) or pylon name (see [[getCompatiblePylonMagazines]] Example 4)
|p4= magazine: [[String]] - magazine name |PARAMETER4=
|p4= magazine: [[String]] - magazine name
|p5= forced (Optional): [[Boolean]] - [[true]] to force incompatible magazine. Default: [[false]] |PARAMETER5=
|p5= forced (Optional): [[Boolean]] - [[true]] to force incompatible magazine. Default: [[false]]
|p6= turret (Optional): [[Array]] - turret path. Default: []|PARAMETER6=
|p6= turret (Optional): [[Array]] - turret path. Default: []


| [[Boolean]] - [[true]] on success |RETURNVALUE=
| [[Boolean]] - [[true]] on success




|x1= <code>[[vehicle]] [[player]] [[setPylonLoadout]] ["pylon1", ""]; </code>|EXAMPLE1=
|x1= <code>[[vehicle]] [[player]] [[setPylonLoadout]] ["pylon1", ""]; </code>


|x2= Make all of your pylon weapons Twin Cannon 30 mm:<code>[[for]] "_i" [[from]] 1 [[to]] 100 [[do]] {
|x2= Make all of your pylon weapons Twin Cannon 30 mm:<code>[[for]] "_i" [[from]] 1 [[to]] 100 [[do]] {
[[vehicle]] [[player]] [[setPylonLoadout]] [_i, "PylonWeapon_300Rnd_20mm_shells", [[true]]];
[[vehicle]] [[player]] [[setPylonLoadout]] [_i, "PylonWeapon_300Rnd_20mm_shells", [[true]]];
};</code>|EXAMPLE2=
};</code>


|x3= Showcase all possible magazines:<code>[] [[spawn]] {
|x3= Showcase all possible magazines:<code>[] [[spawn]] {
Line 38: Line 38:
[[sleep]] 1.5;
[[sleep]] 1.5;
} [[forEach]] ("[[getText]] (_x >> 'pylonWeapon') != <nowiki>''</nowiki>" [[configClasses]] ([[configFile]] >> "CfgMagazines"));
} [[forEach]] ("[[getText]] (_x >> 'pylonWeapon') != <nowiki>''</nowiki>" [[configClasses]] ([[configFile]] >> "CfgMagazines"));
} ;</code>|EXAMPLE3=
} ;</code>


| [[Arma 3 Vehicle Loadouts]],[[getCompatiblePylonMagazines]],[[getPylonMagazines]],[[setAmmoOnPylon]],[[ammoOnPylon]],[[animatePylon]],[[animateBay]],[[setPylonsPriority]] |SEEALSO=
| [[Arma 3 Vehicle Loadouts]],[[getCompatiblePylonMagazines]],[[getPylonMagazines]],[[setAmmoOnPylon]],[[ammoOnPylon]],[[animatePylon]],[[animateBay]],[[setPylonsPriority]]


}}
}}

Revision as of 12:10, 18 January 2021

Hover & click on the images for description

Description

Description:
Adds/overrides loadout to a vehicle pylon. TransportPylonsComponent in vehicle config and pylonWeapon in the magazine config are required to run.
Groups:
Vehicle Loadouts

Syntax

Syntax:
vehicle setPylonLoadout [pylon, magazine, forced, turret];
Parameters:
vehicle: Object
[pylon, magazine, forced, turret] : Array
pylon: Number or String - pylon index (index starts from 1) or pylon name (see getCompatiblePylonMagazines Example 4)
magazine: String - magazine name
forced (Optional): Boolean - true to force incompatible magazine. Default: false
turret (Optional): Array - turret path. Default: []
Return Value:
Boolean - true on success

Examples

Example 1:
vehicle player setPylonLoadout ["pylon1", ""];
Example 2:
Make all of your pylon weapons Twin Cannon 30 mm:for "_i" from 1 to 100 do { vehicle player setPylonLoadout [_i, "PylonWeapon_300Rnd_20mm_shells", true]; };
Example 3:
Showcase all possible magazines:[] spawn { { for "_i" from 1 to 100 do { vehicle player setPylonLoadout [_i, configName _x, true]; }; hint configName _x; sleep 1.5; } forEach ("getText (_x >> 'pylonWeapon') != ''" configClasses (configFile >> "CfgMagazines")); } ;

Additional Information

See also:
Arma 3 Vehicle LoadoutsgetCompatiblePylonMagazinesgetPylonMagazinessetAmmoOnPylonammoOnPylonanimatePylonanimateBaysetPylonsPriority

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes


Posted on April 30, 2020 - 13:01 (UTC)
POLPOX
turret must be [] if you wanted to equip the magazine to the pilot. [-1] will return false and fails unlike other turret related commands.