Jump to content
Sign in to follow this  
Ice_Rhino

Adding Custom Backpack to Vehicle Boot?

Recommended Posts

Hi

I have a custom backpack that contains the following;

this addItemCargo ["FirstAidKit",4];this addItemCargo ["optic_TWS",1];this addItemCargo ["20Rnd_762x51_Mag",2];this additemCargo ["SatchelCharge_Remote_Mag",2];

I want to place this configured back pack into the boot/cargo of a civilian vehicle. How would I go about doing this?

Thanks

IR

  • Like 1

Share this post


Link to post
Share on other sites

Thanks but that does not put the pack I have built into cargo, just empties. Any other ideas?

I am trying to see if this works

---------- Post added at 12:32 ---------- Previous post was at 12:27 ----------

Thanks for the attempt SS, appreciate it

IR

Share this post


Link to post
Share on other sites

Hi

I already have all the gear in the backpack I require, I want to add my backpack with the gear into the Boot/Trunk/Cargo of a civilian car.

Thanks

IR

Share this post


Link to post
Share on other sites

Interesting thread you linked.

Reading through it seems like you basically just need to:

1. Place an AI unit next to the vehicle you want the bag to be in.

2. Equip the AI unit with the bag you want.

3. Add the items to the bag of the AI.

4. Tell the AI to drop the bag.

5. Remove the AI assuming you don't want it

Here's an example script for you (will work from init line of AI):

this addBackpack "B_AssaultPack_blk";
this addItemToBackpack "Rangefinder";
this action ["DropBag", ((getPos this) nearEntities [["LandVehicle"],10]) select 0, backpack this];
this spawn { waitUntil{isNull (unitBackpack _this)}; deleteVehicle _this; };

What it should do:

1. Add a black assault pack to the unit

2. Add rangefinders to the assault pack

3. Tell the unit to put the backpack into the nearest land vehicle (checks within 10m)

4. Delete the unit after it no longer has a backpack on

FYI, you can just replace the second element of the "action" array with the name of your car. I just did it that way as an all-purpose solution.

Edited by SilentSpike

Share this post


Link to post
Share on other sites

You no longer need the AI with the new commands

//list all backpacks in the vehicle
_BPs = everyBackpack _vehicle;

//add a new backpack to the vehicle
_vehicle addBackpackCargoGlobal ["B_AssaultPack_khk", 1];

//Find the added backpack
_BP = (everyBackpack _vehicle) select (count _BPs);  //Last one added

//Fill it with your stuff
_BP addItemCargoGlobal ["FirstAidKit", 2];

  • Thanks 3

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
Sign in to follow this  

×