addWeaponWithAttachmentsCargo: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Fix template error)
(Implement latest changes)
Line 4: Line 4:
| arma3dev |Game=
| arma3dev |Game=


|1.93|Game Version=
|1.95|Game Version=


|arg= global |Arguments in MP=
|arg= global |Arguments in MP=
Line 12: Line 12:


|  
|  
Add a weapon into cargo space of vehicles, but with pre-attached attachments/magazines. Ignores available cargo space.<br><br>
Add a weapon into cargo space of vehicles, but with pre-attached attachments/magazines. Ignores available cargo space.<br>
This clears all pre-attached items if the weapon class has LinkedItems.<br><br>


{{Important|
{{Important|
Line 22: Line 23:
| container addWeaponWithAttachmentsCargo [weapon, muzzleAttachment, sideAttachment, topAttachment, bipodAttachment, [(primaryMagazine), (primaryAmmoCount), (secondaryMagazine), (secondaryAmmoCount)], (count)] |SYNTAX=
| container addWeaponWithAttachmentsCargo [weapon, muzzleAttachment, sideAttachment, topAttachment, bipodAttachment, [(primaryMagazine), (primaryAmmoCount), (secondaryMagazine), (secondaryAmmoCount)], (count)] |SYNTAX=


|p1= container: [[Object]] - container to add the weapon to, might be backpack, ammobox or vehicle. |Parameter 1=
|p1= container: [[Object]] - Container to add the weapon to, might be backpack, ammobox or vehicle. |Parameter 1=


|p2= weapon: [[String]] - weapon classname. See the topic [[:Category:Weapons]] for reference about possible values. |Parameter 2=
|p2= weapon: [[String]] - Weapon classname. See the topic [[:Category:Weapons]] for reference about possible values. |Parameter 2=


|p3= muzzleAttachment: [[String]] - Muzzle attachment classname. If you don't want any just supply empty string. |Parameter 3=
|p3= muzzleAttachment: [[String]] - Muzzle attachment classname. If you don't want any just supply empty string. |Parameter 3=
Line 36: Line 37:
|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=
|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=


|p8= primaryAmmoCount (Optional): [[Number]] - Ammo count in primary magazine if you want default you can just omit this parameter. <br>
|p8= primaryAmmoCount (Optional): [[Number]] - Ammo count in primary magazine. If you want a full magazine you can use -1. |Parameter 8=
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=
|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=


|p10= secondaryAmmoCount (Optional): [[Number]] - Ammo count in secondary magazine if you want default you can just omit this parameter. |Parameter 10=
|p10= secondaryAmmoCount (Optional): [[Number]] - Ammo count in secondary magazine. If you want a full magazine you can use -1. |Parameter 10=


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

Revision as of 18:51, 5 June 2019

-wrong parameter ("arma3dev") defined!-[[:Category:Introduced with arma3dev version 1.95|1.95]]
Hover & click on the images for description

Description

Description:
Add a weapon into cargo space of vehicles, but with pre-attached attachments/magazines. Ignores available cargo space.
This clears all pre-attached items if the weapon class has LinkedItems.

The cargo object this is applied on can be remote. But only local player will see the changed inventory.
You most likely want addWeaponWithAttachmentsCargoGlobal in any multiplayer scenario
Groups:
Uncategorised

Syntax

Syntax:
container addWeaponWithAttachmentsCargo [weapon, muzzleAttachment, sideAttachment, topAttachment, bipodAttachment, [(primaryMagazine), (primaryAmmoCount), (secondaryMagazine), (secondaryAmmoCount)], (count)]
Parameters:
container: Object - Container to add the weapon to, might be backpack, ammobox or vehicle.
weapon: String - Weapon classname. See the topic Category:Weapons for reference about possible values.
muzzleAttachment: String - Muzzle attachment classname. If you don't want any just supply empty string.
sideAttachment: String - Side rail attachment classname. If you don't want any just supply empty string.
topAttachment: String - Top rail attachment classname. If you don't want any just supply empty string.
bipodAttachment: String - Underbarrel rail attachment classname. If you don't want any just supply empty string.
primaryMagazine (Optional): String - Primary magazine classname. If you don't want any just supply empty string or leave the whole magazine array empty.
primaryAmmoCount (Optional): Number - Ammo count in primary magazine. If you want a full magazine you can use -1.
secondaryMagazine (Optional): String - Secondary magazine classname. If you don't want any just supply empty string or leave the whole magazine array empty.
secondaryAmmoCount (Optional): Number - Ammo count in secondary magazine. If you want a full magazine you can use -1.
count (Optional): Number - Number of weapons to add. Default is 1.
Return Value:
Nothing

Examples

Example 1:
cursorTarget addWeaponWithAttachmentsCargo ["arifle_MX_GL_F", "muzzle_snds_H", "acc_flashlight", "optic_aco", "", ["30Rnd_65x39_caseless_mag", 15, "3Rnd_HE_Grenade_shell", 2], 2]
Example 2:
cursorTarget addWeaponWithAttachmentsCargo ["arifle_MX_GL_F", "", "acc_flashlight", "", "", ["30Rnd_65x39_caseless_mag", 30, "3Rnd_HE_Grenade_shell"], 2] 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 3:
cursorTarget addWeaponWithAttachmentsCargo ["arifle_MX_GL_F", "", "", "", "", []] Same as a simple addWeaponCargo. This is the minimum number of arguments you need to supply.

Additional Information

See also:
addWeaponWithAttachmentsCargoGlobaladdWeaponCargoaddWeaponCargoGlobalclearWeaponCargogetWeaponCargo,

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

[[Category:Introduced with arma3dev version 1.95]][[ Category: arma3dev: New Scripting Commands | ADDWEAPONWITHATTACHMENTSCARGO]][[ Category: arma3dev: Scripting Commands | ADDWEAPONWITHATTACHMENTSCARGO]]

Bottom Section