setUnitLoadout: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " *\| *(Effects?|Arguments?) *=" to "") |
Lou Montana (talk | contribs) m (Text replacement - " *\| *PARAMETER[0-9]{1,3} *= * " to " ") |
||
Line 25: | Line 25: | ||
| s2= unit [[setUnitLoadout]] [loadout, fullMagazines] | | s2= unit [[setUnitLoadout]] [loadout, fullMagazines] | ||
|p21= unit: [[Object]] | |p21= unit: [[Object]] | ||
|p22=[loadout, fullMagazines] : [[Array]] | |p22=[loadout, fullMagazines] : [[Array]] | ||
|p23= loadout: [[Array]] - [[Unit Loadout Array]] | |p23= loadout: [[Array]] - [[Unit Loadout Array]] | ||
|p24= fullMagazines: [[Boolean]] - Partially emptied magazines will be refilled when the loadout is applied | |p24= fullMagazines: [[Boolean]] - Partially emptied magazines will be refilled when the loadout is applied | ||
| r2= [[Nothing]] | | r2= [[Nothing]] | ||
|s3= unit [[setUnitLoadout]] name | |s3= unit [[setUnitLoadout]] name | ||
|p41= unit: [[Object]] | |p41= unit: [[Object]] | ||
|p42= name: [[String]] - class name (see description) | |p42= name: [[String]] - class name (see description) | ||
|r3= [[Nothing]] | |r3= [[Nothing]] | ||
|s4= unit [[setUnitLoadout]] config | |s4= unit [[setUnitLoadout]] config | ||
|p61= unit: [[Object]] | |p61= unit: [[Object]] | ||
|p62= config: [[Config]] - config class (see description) | |p62= config: [[Config]] - config class (see description) | ||
|r4= [[Nothing]] | |r4= [[Nothing]] |
Revision as of 18:10, 29 January 2021
Description
- Description:
- Description needed
- Groups:
- Unit Inventory
Syntax 1
- Syntax:
- Syntax needed
- Parameters:
- unit: Object
- loadout: Array - Unit Loadout Array
- Return Value:
- Return value needed
Syntax 2
- Syntax:
- unit setUnitLoadout [loadout, fullMagazines]
- Parameters:
- unit: Object
- [loadout, fullMagazines] : Array
- loadout: Array - Unit Loadout Array
- fullMagazines: Boolean - Partially emptied magazines will be refilled when the loadout is applied
- Return Value:
- Nothing
Syntax 3
- Syntax:
- unit setUnitLoadout name
- Parameters:
- unit: Object
- name: String - class name (see description)
- Return Value:
- Nothing
Syntax 4
- Syntax:
- unit setUnitLoadout config
- Parameters:
- unit: Object
- config: Config - config class (see description)
- Return Value:
- Nothing
Examples
- Example 1:
player_2 setUnitLoadout (getUnitLoadout player_1); // Copies loadout from player_1 and applies it to player_2
- Example 2:
player_2 setUnitLoadout [getUnitLoadout player_1, true]; // Copies loadout from player_1 and applies it to player_2 while topping up all magazines
- Example 3:
_unit setUnitLoadout "B_Soldier_F";
- Example 4:
_unit setUnitLoadout (configFile >> "CfgVehicles" >> "B_Soldier_F");
- Example 5:
_unit setUnitLoadout (missionConfigFile >> "MyLoadout");
- Example 6:
- Strip unit of everything (after Arma 3 v1.93):
_unit setUnitLoadout (configFile >> "EmptyLoadout");
Additional Information
- See also:
- See also needed
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 December 17, 2019 - 23:08 (UTC)
- demellion
-
NOTE: Empty or used magazines in loadouts will be refilled under specific circumstance, even if the refill argument is false. This seems to happen if amount of used magazines is 2 or more.
player setUnitLoadout [ ["arifle_MX_ACO_pointer_F","","acc_pointer_IR","optic_Aco",[],[],""], [], ["hgun_P07_F","","","",["16Rnd_9x21_Mag",16],[],""], ["U_B_CombatUniform_mcam",[ ["30Rnd_65x39_caseless_mag",1,1] ]], ["V_PlateCarrier1_rgr",[]], ["B_AssaultPack_mcamo_Ammo",[]], "H_HelmetB_grass","",[],["ItemMap","","ItemRadio","ItemCompass","ItemWatch","NVGoggles"] ]
Will result in 30Rnd magazine with one bullet in it.player setUnitLoadout [ ["arifle_MX_ACO_pointer_F","","acc_pointer_IR","optic_Aco",[],[],""], [], ["hgun_P07_F","","","",["16Rnd_9x21_Mag",16],[],""], ["U_B_CombatUniform_mcam",[ ["30Rnd_65x39_caseless_mag",2,1] ]], ["V_PlateCarrier1_rgr",[]], ["B_AssaultPack_mcamo_Ammo",[]], "H_HelmetB_grass","",[],["ItemMap","","ItemRadio","ItemCompass","ItemWatch","NVGoggles"] ]
Will result in 2 magazines but full, 30 rounds in it. This applies to any magazines count >2. They will never be with specified amount of rounds, even if you force the refill argument to false - Posted on October 23, 2020 - 21:16 (UTC)
- Andrew_S90
- Here is a command I wrote up that provides a fix for the ammo bug described by demellion above. https://pastebin.com/SHX41Jkk Pass a loadout to your compiled command and it will provide one back that will not refill ammo