Jump to content
bumyplum

Backpack GrounderWeaponHolder

Recommended Posts

I'm attempting to place a players backpack on the ground with the items content still in it, how ever i'm unable to make the backpack place on the ground, this is the script im attempting to use

 

_holder = createVehicle ["GroundWeaponHolder", getPosATL player, [], 0, "CAN_COLLIDE"];
_ContainerV = backpack player;
_holder addItemCargoGlobal [_ContainerV, 1];


Any input would be helpful, thanks.

Share this post


Link to post
Share on other sites
1 hour ago, Dedmen said:

A backpack is not an item.
https://community.bistudio.com/wiki/addBackpackCargoGlobal

Also that won't keep the content. If you want to keep the content then use

https://community.bistudio.com/wiki/action

To make the player drop his backpack.

1

_holder = createVehicle ["GroundWeaponHolder", getPosATL player, [], 0, "CAN_COLLIDE"];
_ContainerV = Vest player;
_holder addItemCargoGlobal [_ContainerV, 1];
_droppedContainer = (((everyContainer _holder) select 0) select 1);
{_droppedContainer addItemCargoGlobal [_x, 1];}forEach (VestItems player);


Thats the whole script. is there no way to do it with a backpack then

Share this post


Link to post
Share on other sites
14 minutes ago, bumyplum said:

is there no way to do it with a backpack then


As Dedmen already explained it I will repeat what he said:

Use addBackpackCargoGlobal instead of addItemCargoGlobal as backpack is not an item
change vestItems to backpackItems naturally

Share this post


Link to post
Share on other sites
4 hours ago, bumyplum said:

I'm attempting to place a players backpack on the ground with the items content still in it, how ever i'm unable to make the backpack place on the ground, this is the script im attempting to use

 

Any input would be helpful, thanks.

 

If I'm right, you don't want to create the backpack, but just drop it.
You could use the dropBag action and follow the example here.

  • Like 1

Share this post


Link to post
Share on other sites

_holder = createVehicle ["GroundWeaponHolder", getPosATL player, [], 0, "CAN_COLLIDE"];
_ContainerB = backpack player;
_holder addBackpackCargoGlobal [_ContainerB, 1];
_droppedContainer = (((everyContainer _holder) select 0) select 1);
{_droppedContainer addItemCargoGlobal [_x, 1];}forEach (backpackItems player);

 

 

------------------------- Works

Share this post


Link to post
Share on other sites

_gwh = createVehicle ["Weapon_Empty", getPosATL player, [], 0, "CAN_COLLIDE"];
player action ["DropBag", _gwh, typeOf unitBackpack player];

 

If you don't want to multiply backpack and play the drop anim.

  • Like 2

Share this post


Link to post
Share on other sites
3 hours ago, pierremgi said:

_gwh = createVehicle ["Weapon_Empty", getPosATL player, [], 0, "CAN_COLLIDE"];
player action ["DropBag", _gwh, typeOf unitBackpack player];

 

If you don't want to multiply backpack and play the drop anim.

How would i place all the attach ments of a weapon on the floor but not the weapon using a script

Share this post


Link to post
Share on other sites

Code is slightly different. Something like:
 

 _gwh = createVehicle ["WeaponHolderSimulated_scripted", getPosATL player vectorAdd [0,0.5,0.3], [], 0, "CAN_COLLIDE"];
player action ["DropBag", _gwh, typeOf unitBackpack player];
_currentWItems = (player weaponAccessories currentWeapon player) select {_x != ""};
call {
  if (currentWeapon player == primaryWeapon player) exitWith {removeAllPrimaryWeaponItems player};
  if (currentWeapon player == HandGunWeapon player) exitWith {removeAllHandGunItems player};
 };
{_gwh addItemCargoGlobal [_x,1]} count _currentWItems;

 

  • Like 2

Share this post


Link to post
Share on other sites
14 minutes ago, pierremgi said:

Code is slightly different. Something like:
 


 _gwh = createVehicle ["WeaponHolderSimulated_scripted", getPosATL player vectorAdd [0,0.5,0.3], [], 0, "CAN_COLLIDE"];
player action ["DropBag", _gwh, typeOf unitBackpack player];
_currentWItems = (player weaponAccessories currentWeapon player) select {_x != ""};
call {
  if (currentWeapon player == primaryWeapon player) exitWith {removeAllPrimaryWeaponItems player};
  if (currentWeapon player == HandGunWeapon player) exitWith {removeAllHandGunItems player};
 };
{_gwh addItemCargoGlobal [_x,1]} count _currentWItems;

 

Why when i use this script does it not remove the uniform at the end etc

 

 _gwh = createVehicle ["WeaponHolderSimulated_scripted", getPosATL player vectorAdd [0,0.5,0.3], [], 0, "CAN_COLLIDE"];

_currentWItems = (player weaponAccessories currentWeapon player) select {_x != ""};

{_gwh addItemCargoGlobal [_x,1]} count _currentWItems;


removeuniform player;
removevest player;
removebackpack player;
removeheadgear player;
removeAllAssignedItems player;
removegoggles player;
removeallweapons player;

Share this post


Link to post
Share on other sites
7 minutes ago, bumyplum said:

Why when i use this script does it not remove the uniform at the end etc

 

 _gwh = createVehicle ["WeaponHolderSimulated_scripted", getPosATL player vectorAdd [0,0.5,0.3], [], 0, "CAN_COLLIDE"];

_currentWItems = (player weaponAccessories currentWeapon player) select {_x != ""};

{_gwh addItemCargoGlobal [_x,1]} count _currentWItems;


removeuniform player;
removevest player;
removebackpack player;
removeheadgear player;
removeAllAssignedItems player;
removegoggles player;
removeallweapons player;

 

You are speaking about backpack, then items on weapon.. now uniform?

What is your goal exactly. I'm confused.

Share this post


Link to post
Share on other sites
12 minutes ago, pierremgi said:

 

You are speaking about backpack, then items on weapon.. now uniform?

What is your goal exactly. I'm confused.

My objective is to remove all of the items of a player and place them on the floor as if your stripping their load out. 
_WeaponP = primaryweapon Player;
_holder addItemCargoGlobal [_WeaponP, 1];
is what i'm using to spawn the weapon on the weapon holder  however it doesn't save the attachments so i was going to make it put the attachments on the floor separately 

Share this post


Link to post
Share on other sites
6 hours ago, bumyplum said:

is what i'm using to spawn the weapon on the weapon holder  however it doesn't save the attachments so i was going to make it put the attachments on the floor separately 

 

13 hours ago, Dedmen said:

If you want to keep the content then use

https://community.bistudio.com/wiki/action

 

What you are trying to do is telling the player to drop all his items.
Why do you delete and re-spawn the same items instead of just telling the player to drop all his items?

 

https://community.bistudio.com/wiki/action/Arma_3_Actions_List#DropWeapon

https://community.bistudio.com/wiki/action/Arma_3_Actions_List#DropBag

 

Vest and Uniform might be a little more work if you wanna drop these too.

  • Like 1

Share this post


Link to post
Share on other sites
14 minutes ago, Dedmen said:

 

 

What you are trying to do is telling the player to drop all his items.
Why do you delete and re-spawn the same items instead of just telling the player to drop all his items?

 

https://community.bistudio.com/wiki/action/Arma_3_Actions_List#DropWeapon

https://community.bistudio.com/wiki/action/Arma_3_Actions_List#DropBag

 

Vest and Uniform might be a little more work if you wanna drop these too.

The players items who are being dropped would  be in restraints, i've got everything else to work how ever the attachments don't drop correctly

 

Share this post


Link to post
Share on other sites
On 2/20/2019 at 10:09 AM, Dedmen said:

 

 

What you are trying to do is telling the player to drop all his items.
Why do you delete and re-spawn the same items instead of just telling the player to drop all his items?

 

https://community.bistudio.com/wiki/action/Arma_3_Actions_List#DropWeapon

https://community.bistudio.com/wiki/action/Arma_3_Actions_List#DropBag

 

Vest and Uniform might be a little more work if you wanna drop these too.

Are you able to explain to me why this snippet of code breaks the rest of my script

 _gwh = createVehicle ["WeaponHolderSimulated_scripted", getPosATL player vectorAdd [0,0.5,0.3], [], 0, "CAN_COLLIDE"];

_currentWItems = (player weaponAccessories currentWeapon player) select {_x != ""};

{_gwh addItemCargoGlobal [_x,1]} count _currentWItems;

Share this post


Link to post
Share on other sites

Break what???

 

0 = [] spawn {
  _gwh = createVehicle ["WeaponHolderSimulated_scripted", getPosATL player vectorAdd [0,0.5,0.3], [], 0, "CAN_COLLIDE"];
 _currentWItems = (player weaponAccessories currentWeapon player) select {_x != ""};
 {_gwh addItemCargoGlobal [_x,1]} count _currentWItems;
player action ["DropWeapon", _gwh, currentWeapon player];
player action ["DropBag", _gwh, typeOf unitBackpack player];
};

 

Note: The 2 lines with _currentWItems are useless with dropWeapon action (at least in Vanilla).

Share this post


Link to post
Share on other sites
34 minutes ago, pierremgi said:

Break what???

 

0 = [] spawn {
  _gwh = createVehicle ["WeaponHolderSimulated_scripted", getPosATL player vectorAdd [0,0.5,0.3], [], 0, "CAN_COLLIDE"];
 _currentWItems = (player weaponAccessories currentWeapon player) select {_x != ""};
 {_gwh addItemCargoGlobal [_x,1]} count _currentWItems;
player action ["DropWeapon", _gwh, currentWeapon player];
player action ["DropBag", _gwh, typeOf unitBackpack player];
};

 

Note: The 2 lines with _currentWItems are useless with dropWeapon action (at least in Vanilla).

Thanks for the help

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×