setPylonLoadout: Difference between revisions
Lou Montana (talk | contribs) m (Some wiki formatting) |
Killzone Kid (talk | contribs) No edit summary |
||
| (4 intermediate revisions by 3 users not shown) | |||
| Line 28: | Line 28: | ||
|p4= forced: [[Boolean]] - (Optional, default [[false]]) [[true]] to force an incompatible magazine | |p4= forced: [[Boolean]] - (Optional, default [[false]]) [[true]] to force an incompatible magazine | ||
|p5= turret: [[ | |p5= turret: [[Turret Path]] - (Optional, default <sqf inline>[]</sqf>) turret path | ||
|r1= [[Boolean]] - [[true]] on success | |r1= [[Boolean]] - [[true]] on success | ||
| Line 37: | Line 37: | ||
<sqf> | <sqf> | ||
private _vehicle = vehicle player; | private _vehicle = vehicle player; | ||
private _pylonsIndices = getAllPylonsInfo _vehicle | private _pylonsIndices = getAllPylonsInfo _vehicle apply { _x select 0 }; | ||
{ | { | ||
_vehicle setPylonLoadout [_x, "PylonWeapon_300Rnd_20mm_shells", true]; | _vehicle setPylonLoadout [_x, "PylonWeapon_300Rnd_20mm_shells", true]; | ||
| Line 45: | Line 45: | ||
|x3= Showcase all possible magazines: | |x3= Showcase all possible magazines: | ||
<sqf> | <sqf> | ||
0 spawn { | |||
private _allPylonMagazines = "getText (_x >> 'pylonWeapon') != ''" configClasses (configFile >> "CfgMagazines"); | private _allPylonMagazines = "getText (_x >> 'pylonWeapon') != ''" configClasses (configFile >> "CfgMagazines"); | ||
private _vehicle = vehicle player; | private _vehicle = vehicle player; | ||
private _pylonsIndices = getAllPylonsInfo _vehicle | private _pylonsIndices = getAllPylonsInfo _vehicle apply { _x select 0 }; | ||
{ | { | ||
| Line 71: | Line 71: | ||
|user= POLPOX | |user= POLPOX | ||
|timestamp= 20200430130100 | |timestamp= 20200430130100 | ||
|text= ''turret'' must be <sqf inline>[]</sqf> if you wanted to equip the magazine to the pilot. <sqf inline>[-1]</sqf> returns false and fails unlike other turret-related commands. | |text= '''Before {{GVI|arma3|2.02}}:''' ''turret'' must be <sqf inline>[]</sqf> if you wanted to equip the magazine to the pilot. <sqf inline>[-1]</sqf> returns false and fails unlike other turret-related commands. | ||
}} | }} | ||
Latest revision as of 12:02, 1 July 2026
Description
- Description:
- Adds/overrides loadout to a vehicle pylon. TransportPylonsComponent in vehicle config and pylonWeapon in the magazine config are required to run.
- Multiplayer:
- 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 Example 1)
- magazine: String - magazine name
- forced: Boolean - (Optional, default false) true to force an incompatible magazine
- turret: Turret Path - (Optional, default []) turret path
- Return Value:
- Boolean - true on success
Examples
- Example 1:
- Example 2:
- Make all of your pylon weapons Twin Cannon 30 mm:
- Example 3:
- Showcase all possible magazines:
0 spawn { private _allPylonMagazines = "getText (_x >> 'pylonWeapon') != ''" configClasses (configFile >> "CfgMagazines"); private _vehicle = vehicle player; private _pylonsIndices = getAllPylonsInfo _vehicle apply { _x select 0 }; { private _configName = configName _x; { _vehicle setPylonLoadout [_x, _configName, true]; } forEach _pylonsIndices; hint _configName; sleep 1.5; } forEach _allPylonMagazines; };
- Example 4:
- MP compatible usage:
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.
Only post proven facts here! Add Note