setPylonLoadout: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\|seealso= *\[\[([^ ]+)\]\], *\[\[([^ ]+)\]\]" to "|seealso= $1 $2")
m (Some wiki formatting)
Line 14: Line 14:
|p1= vehicle: [[Object]]
|p1= vehicle: [[Object]]


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


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


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


|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:
[[vehicle]] [[player]] [[setPylonLoadout]] [_i, "PylonWeapon_300Rnd_20mm_shells", [[true]]];
<sqf>
};</code>
for "_i" from 1 to 100 do {
vehicle player setPylonLoadout [_i, "PylonWeapon_300Rnd_20mm_shells", true];
};
</sqf>


|x3= Showcase all possible magazines:<code>[] [[spawn]] {
|x3= Showcase all possible magazines:
<sqf>
[] spawn {
{
{
[[for]] "_i" [[from]] 1 [[to]] 100 [[do]] {
for "_i" from 1 to 100 do {
[[vehicle]] [[player]] [[setPylonLoadout]] [_i, [[configName]] _x, [[true]]];
vehicle player setPylonLoadout [_i, configName _x, true];
};
};
[[hint]] [[configName]] _x;
hint configName _x;
[[sleep]] 1.5;
sleep 1.5;
} [[forEach]] ("[[getText]] (_x >> 'pylonWeapon') != <nowiki>''</nowiki>" [[configClasses]] ([[configFile]] >> "CfgMagazines"));
} forEach ("getText (_x >> 'pylonWeapon') != ''" configClasses (configFile >> "CfgMagazines"));
};</code>
};
</sqf>


|seealso= [[Arma 3: Vehicle Loadouts]] [[getCompatiblePylonMagazines]] [[getPylonMagazines]] [[setAmmoOnPylon]] [[ammoOnPylon]] [[animatePylon]] [[animateBay]] [[setPylonsPriority]]
|seealso= [[Arma 3: Vehicle Loadouts]] [[getCompatiblePylonMagazines]] [[getPylonMagazines]] [[setAmmoOnPylon]] [[ammoOnPylon]] [[animatePylon]] [[animateBay]] [[setPylonsPriority]]
}}
}}


<dl class="command_description">
{{Note
 
|user= POLPOX
<dt></dt>
|timestamp= 20200430130100
<dd class="notedate">Posted on April 30, 2020 - 13:01 (UTC)</dd>
|text= ''turret'' must be {{hl|[]}} if you wanted to equip the magazine to the pilot. {{hl|[-1]}} will return false and fails unlike other turret related commands.
<dt class="note">[[User:POLPOX|POLPOX]]</dt>
}}
<dd class="note">
''turret'' must be {{hl|[]}} if you wanted to equip the magazine to the pilot. {{hl|[-1]}} will return false and fails unlike other turret related commands.
</dd>
 
</dl>

Revision as of 22:49, 7 May 2022

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: Number or String - pylon index (index starts from 1) or pylon name (see getCompatiblePylonMagazines Example 4)
magazine: String - magazine name
forced: Boolean - (Optional, default false) true to force incompatible magazine
turret: Array - (Optional, default []) turret path
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 Loadouts getCompatiblePylonMagazines getPylonMagazines setAmmoOnPylon ammoOnPylon animatePylon animateBay setPylonsPriority

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
POLPOX - c
Posted on Apr 30, 2020 - 13:01 (UTC)
turret must be [] if you wanted to equip the magazine to the pilot. [-1] will return false and fails unlike other turret related commands.