addWeaponWithAttachmentsCargo: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Created page with "{{Command|= ____________________________________________________________________________________________ | arma3dev |Game= |1.93|Game Version= |arg= global |= Arguments in...")
 
(6 intermediate revisions by 3 users not shown)
Line 2: Line 2:
____________________________________________________________________________________________
____________________________________________________________________________________________


| arma3dev |Game=
| arma3 |Game=


|1.93|Game Version=
|1.94|Game Version=


|arg= global |= Arguments in MP
|arg= global |Arguments in MP=


|eff= local |= Effects in MP
|eff= local |Effects in MP=
____________________________________________________________________________________________
____________________________________________________________________________________________


|  
| Adds a weapon into cargo space of a vehicle / box with given attachments / magazines. Ignores available cargo space. If the weapon class has any pre-attached items (LinkedItems), they are removed and new items, supplied via command arguments, are added.
Add a weapon into cargo space of vehicles, but with pre-attached attachments/magazines. Ignores available cargo space.<br><br>
{{Important | This command has [[local]] effect; for a global variant, see [[addWeaponWithAttachmentsCargoGlobal]].}} |Description=
____________________________________________________________________________________________


{{Important|
| container [[addWeaponWithAttachmentsCargo]] [<nowiki/>[weapon, muzzle, flashlight, optics, [primaryMuzzleMagazine, ammoCount], [secondaryMuzzleMagazine, ammoCount], bipod], weaponsCount] |SYNTAX=
The cargo object this is applied on can be remote. But only local player will see the changed inventory.<br>
 
You most likely want [[addWeaponWithAttachmentsCargoGlobal]] in any multiplayer scenario
|p1= container: [[Object]] - Container to add the weapon to, might be backpack, ammobox or vehicle |Parameter 1=
}}|Description=
 
____________________________________________________________________________________________
|p2= <nowiki>[</nowiki>[weapon, muzzle, flashlight, optics, [primaryMuzzleMagazine, ammoCount], [secondaryMuzzleMagazine, ammoCount], bipod], weaponsCount]: [[Array]] |Parameter 2=
 
|p3= [weapon, muzzle, flashlight, optics, [primaryMuzzleMagazine, ammoCount], [secondaryMuzzleMagazine, ammoCount], bipod]: [[Array]] in format [[weaponsItems]] |Parameter 3=


| container addWeaponWithAttachmentsCargo [weapon, muzzleAttachment, sideAttachment, topAttachment, bipodAttachment, [(primaryMagazine), (primaryAmmoCount), (secondaryMagazine), (secondaryAmmoCount)], (count)] |SYNTAX=
|p4= weapon: [[String]] - Weapon class name. See the topic [[:Category:Weapons]] for reference about possible values |Parameter 4=


|p1= container: [[Object]] - container to add the weapon to, might be backpack, ammobox or vehicle. |Parameter 1=
|p5= muzzle: [[String]] - Muzzle attachment class name or "" if not needed |Parameter 5=


|p2= weapon: [[String]] - weapon classname. See the topic [[:Category:Weapons]] for reference about possible values. |Parameter 2=
|p6= flashlight: [[String]] - Side rail attachment class name or "" if not needed |Parameter 6=


|p3= muzzleAttachment: [[String]] - Muzzle attachment classname. If you don't want any just supply empty string. |Parameter 3=
|p7= optics: [[String]] - Top rail attachment class name or "" if not needed |Parameter 7=


|p4= sideAttachment: [[String]] - Side rail attachment classname. If you don't want any just supply empty string. |Parameter 4=
|p8= [primaryMuzzleMagazine, ammoCount]: [[Array]] - Primary muzzle magazine info or [] if not needed|Parameter 8=


|p5= topAttachment: [[String]] - Top rail attachment classname. If you don't want any just supply empty string. |Parameter 5=
|p9= primaryMuzzleMagazine: [[String]] - Magazine class name |Parameter 9=


|p6= bipodAttachment: [[String]] - Underbarrel rail attachment classname. If you don't want any just supply empty string. |Parameter 6=
|p10= ammoCount: [[Number]] - Ammo count in magazine (will be clipped in 0 and max mag capacity range) |Parameter 10=


|p7= primaryMagazine (Optional): [[String]] - Primary magazine classname. If you don't want any just supply empty string or leave the whole magazine array empty. |Parameter 7=
|p11= [secondaryMuzzleMagazine, ammoCount]: [[Array]] - Secondary muzzle magazine info or [] if not needed|Parameter 11=


|p8= primaryAmmoCount (Optional): [[Number]] - Ammo count in primary magazine if you want default you can just omit this parameter. <br>
|p12= secondaryMuzzleMagazine: [[String]] - Magazine class name |Parameter 12=
But you have to supply a correct value if you want a secondary magazine. (Might change before release out of dev branch) |Parameter 8=


|p9= secondaryMagazine (Optional): [[String]] - Secondary magazine classname. If you don't want any just supply empty string or leave the whole magazine array empty. |Parameter 9=
|p13= ammoCount: [[Number]] - Ammo count in magazine (will be clipped in 0 and max mag capacity range)|Parameter 13=


|p10= secondaryAmmoCount (Optional): [[Number]] - Ammo count in secondary magazine if you want default you can just omit this parameter. |Parameter 10=
|p14= bipod: [[String]] - Underbarrel rail attachment class name or "" if not needed |Parameter 14=


|p11= count (Optional): [[Number]] - Number of weapons to add. Default is 1. |Parameter 11=
|p15= weaponsCount: [[Number]] - Number of weapons to add |Parameter 15=


| [[Nothing]] |Return Value=
| [[Nothing]] |Return Value=
____________________________________________________________________________________________
____________________________________________________________________________________________


|x1= <code>cursorTarget addWeaponWithAttachmentsCargo ["arifle_MX_GL_F", "muzzle_snds_H", "acc_flashlight", "optic_aco", "", ["30Rnd_65x39_caseless_mag", 15, "3Rnd_HE_Grenade_shell", 2], 2]
|x1= <code>[[cursorObject]] [[addWeaponWithAttachmentsCargo]] [<nowiki/>["arifle_MX_GL_F", "muzzle_snds_H", "", "optic_aco", ["30Rnd_65x39_caseless_mag", 15], ["3Rnd_HE_Grenade_shell", 2], ""], 2];
</code> |Example 1=
</code> |Example 1=
____________________________________________________________________________________________
____________________________________________________________________________________________


|x2= <code>cursorTarget addWeaponWithAttachmentsCargo ["arifle_MX_GL_F", "", "acc_flashlight", "", "", ["30Rnd_65x39_caseless_mag", 30, "3Rnd_HE_Grenade_shell"], 2] </code> Add's two MX GL rifles with flashlight side attachment and a full 30 round magazine loaded into the gun, and 3Rnd HE grenade magazine loaded into the grenade launcher |Example 2=
|x2= Add five MX GL rifles with flashlight side attachment and a full 30 rounds magazine loaded into the gun, and full 3Rnd HE grenade magazine loaded into the grenade launcher:
<code>[[cursorObject]] [[addWeaponWithAttachmentsCargo]] [<nowiki/>["arifle_MX_GL_F", "", "acc_flashlight", "", ["30Rnd_65x39_caseless_mag", 30], ["3Rnd_HE_Grenade_shell", 2], ""], 5]</code> |Example 2=
____________________________________________________________________________________________
____________________________________________________________________________________________


|x3= <code>cursorTarget addWeaponWithAttachmentsCargo ["arifle_MX_GL_F", "", "", "", "", []]</code> Same as a simple [[addWeaponCargo]]. This is the minimum number of arguments you need to supply. |Example 3=
|x3= Add one MX rifle without any attachments or magazines event though the class has linked items:
<code>[[cursorObject]] [[addWeaponWithAttachmentsCargo]] [<nowiki/>["arifle_MX_Holo_pointer_F", "", "", "", [], [], ""], 1];</code> |Example 3=
____________________________________________________________________________________________
____________________________________________________________________________________________


| [[addWeaponWithAttachmentsCargoGlobal]], [[addWeaponCargo]], [[addWeaponCargoGlobal]], [[clearWeaponCargo]], [[getWeaponCargo]], |See Also=
|x4= Add all weapons on player with attachments:
<code>{ [[cursorObject]] [[addWeaponWithAttachmentsCargo]] [_x, 1] } [[forEach]] [[weaponsItems]] [[player]];</code> |Example 4=
 
| [[weaponsItems]], [[addWeaponCargo]], [[addWeaponCargoGlobal]], [[clearWeaponCargo]], [[getWeaponCargo]], [[addWeaponWithAttachmentsCargoGlobal]] |See Also=
}}
}}
<dl class="command_description">
<!-- BEGIN Note Section -->
<!-- For example:
<dd class="notedate">Posted on Month Day, Year - Time (UTC)</dd>
<dt class="note">'''[[User:User Name|User Name]]'''</dt>
<dd class="note">This is an example note. It is true and verifiable, and contains a little code snippet.
<code>[[if]] ([[_this]] == anExample) [[then]] { [[hint]] "Leave it here for others to read"; };</code></dd>
-->
<!-- END Note Section -->
</dl>
<h3 style="display:none">Bottom Section</h3>
<!-- Appropriate categories go here -->


[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Command Group: Weapons|{{uc:{{PAGENAME}}}}]]
[[Category:Command Group: Containers|{{uc:{{PAGENAME}}}}]]

Revision as of 20:44, 25 November 2019

Hover & click on the images for description

Description

Description:
Adds a weapon into cargo space of a vehicle / box with given attachments / magazines. Ignores available cargo space. If the weapon class has any pre-attached items (LinkedItems), they are removed and new items, supplied via command arguments, are added.
This command has local effect; for a global variant, see addWeaponWithAttachmentsCargoGlobal.
Groups:
Uncategorised

Syntax

Syntax:
container addWeaponWithAttachmentsCargo [[weapon, muzzle, flashlight, optics, [primaryMuzzleMagazine, ammoCount], [secondaryMuzzleMagazine, ammoCount], bipod], weaponsCount]
Parameters:
container: Object - Container to add the weapon to, might be backpack, ammobox or vehicle
[[weapon, muzzle, flashlight, optics, [primaryMuzzleMagazine, ammoCount], [secondaryMuzzleMagazine, ammoCount], bipod], weaponsCount]: Array
[weapon, muzzle, flashlight, optics, [primaryMuzzleMagazine, ammoCount], [secondaryMuzzleMagazine, ammoCount], bipod]: Array in format weaponsItems
weapon: String - Weapon class name. See the topic Category:Weapons for reference about possible values
muzzle: String - Muzzle attachment class name or "" if not needed
flashlight: String - Side rail attachment class name or "" if not needed
optics: String - Top rail attachment class name or "" if not needed
[primaryMuzzleMagazine, ammoCount]: Array - Primary muzzle magazine info or [] if not needed
primaryMuzzleMagazine: String - Magazine class name
ammoCount: Number - Ammo count in magazine (will be clipped in 0 and max mag capacity range)
[secondaryMuzzleMagazine, ammoCount]: Array - Secondary muzzle magazine info or [] if not needed
secondaryMuzzleMagazine: String - Magazine class name
ammoCount: Number - Ammo count in magazine (will be clipped in 0 and max mag capacity range)
bipod: String - Underbarrel rail attachment class name or "" if not needed
weaponsCount: Number - Number of weapons to add
Return Value:
Nothing

Examples

Example 1:
cursorObject addWeaponWithAttachmentsCargo [["arifle_MX_GL_F", "muzzle_snds_H", "", "optic_aco", ["30Rnd_65x39_caseless_mag", 15], ["3Rnd_HE_Grenade_shell", 2], ""], 2];
Example 2:
Add five MX GL rifles with flashlight side attachment and a full 30 rounds magazine loaded into the gun, and full 3Rnd HE grenade magazine loaded into the grenade launcher: cursorObject addWeaponWithAttachmentsCargo [["arifle_MX_GL_F", "", "acc_flashlight", "", ["30Rnd_65x39_caseless_mag", 30], ["3Rnd_HE_Grenade_shell", 2], ""], 5]
Example 3:
Add one MX rifle without any attachments or magazines event though the class has linked items: cursorObject addWeaponWithAttachmentsCargo [["arifle_MX_Holo_pointer_F", "", "", "", [], [], ""], 1];
Example 4:
Add all weapons on player with attachments: { cursorObject addWeaponWithAttachmentsCargo [_x, 1] } forEach weaponsItems player;

Additional Information

See also:
weaponsItemsaddWeaponCargoaddWeaponCargoGlobalclearWeaponCargogetWeaponCargoaddWeaponWithAttachmentsCargoGlobal

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