setPylonLoadout: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "(Optional, default {{hl|[]}})" to "(Optional, default <sqf inline>[]</sqf>)") |
(MP update) |
||
Line 3: | Line 3: | ||
|game1= arma3 | |game1= arma3 | ||
|version1= 1.70 | |version1= 1.70 | ||
|arg= local | |||
|eff= local | |eff= local | ||
Line 9: | Line 11: | ||
|descr= Adds/overrides loadout to a vehicle pylon. {{hl|TransportPylonsComponent}} in vehicle config and {{hl|pylonWeapon}} in the magazine config are required to run. | |descr= Adds/overrides loadout to a vehicle pylon. {{hl|TransportPylonsComponent}} in vehicle config and {{hl|pylonWeapon}} in the magazine config are required to run. | ||
{{Feature|Informative|This command also adds the corresponded weapon if the vehicle does not have one, but will not remove one that is no longer used.}} | |||
{{Feature|Important|In Multiplayer, this command should run locally to the vehicle itself or will cause desync issue! (especially upon the locality change eg get in the vehicle) See Example 4 for MP-compatible usage.}} | |||
|s1= vehicle [[setPylonLoadout]] [pylon, magazine, forced, turret] | |s1= vehicle [[setPylonLoadout]] [pylon, magazine, forced, turret] | ||
Line 44: | Line 48: | ||
} forEach ("getText (_x >> 'pylonWeapon') != ''" configClasses (configFile >> "CfgMagazines")); | } forEach ("getText (_x >> 'pylonWeapon') != ''" configClasses (configFile >> "CfgMagazines")); | ||
}; | }; | ||
</sqf> | |||
|x4= MP compatible usage: | |||
<sqf> | |||
[myPlane, [1, "PylonWeapon_300Rnd_20mm_shells", true]] remoteExecCall ["setPylonLoadout", myPlane]; | |||
</sqf> | </sqf> | ||
Revision as of 09:59, 1 February 2024
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:
- Example 2:
- Make all of your pylon weapons Twin Cannon 30 mm:
- 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")); };
- 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 or on the Forums.
Only post proven facts here! Add Note
- 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.