Jump to content
Sign in to follow this  
drpastah

How to make an object have an inventory?

Recommended Posts

How can I set an object to have an inventory? I'm trying to make a closed military box have an inventory. I need this to work in multiplayer.

Share this post


Link to post
Share on other sites

my_inventory = createVehicle ['weaponholder',[0,0,0],[],0,'NONE']; my_inventory attachTo [my_box,[0,0,0]];

 

 

haven't attempted this before, but something like that might work.

Share this post


Link to post
Share on other sites

my_inventory = createVehicle ['weaponholder',[0,0,0],[],0,'NONE']; my_inventory attachTo [my_box,[0,0,0]];

 

 

haven't attempted this before, but something like that might work.

 

Or not. The actions might not be available because the box shape will block them if weaponholder is inside the shape. To the OP, you can do this by modding config, but that is a different story.

Share this post


Link to post
Share on other sites

Or not. The actions might not be available because the box shape will block them if weaponholder is inside the shape. To the OP, you can do this by modding config, but that is a different story.

And that's not doable by mission alone I read.

Share this post


Link to post
Share on other sites

Something like this may be what your after, place the code in the init of an object that you want to add an ammobox inventory to.

You won't see the box but it will be remotely opened when you use the gear action.

My_Box = createVehicle ["Box_NATO_Wps_F" ,getpos this,[],0,"CAN_COLLIDE"];
My_Box hideobject true;
 this addaction ["Gear",{  Player action ["Gear", My_Box];  hint "Viewing the box...";},[], 6, true, true, "", "(_this distance (_target))<2"];

You can use "GroundWeaponHolder" instead of an ammobox but you will see the items when you place them and you don't get to decide where they are placed around the holder.

 

Not sure it will work as is in MP.

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  

×