Jump to content
Guitox

[Multi] Locked Backpack not possible ?

Recommended Posts

Hi,

 

For few hours I'm trying to lock a Backpack to prevent somebody from taking it.

The backpack is only for interior decoration.

Obviously I tried to Disable Simulation, addEventHandler, removeAction etc... but nothing seems to work...

 

So, is it possible to lock a backpack  :)  ?

Share this post


Link to post
Share on other sites

Just tried, and enableSimulation worked fine.

 

https://youtu.be/qyBRj8pq9MA

 

Even if I test in SP, in MP it works also just fine - I am using it to disable regular inventory on boxes, with attached Arsenal.

 

Also you may want to wait till 1.58 release, there you may just create unsimulated object using just backpack's 3d model - createSimpleObject, AFAIR.

  • Like 1

Share this post


Link to post
Share on other sites

Hmm... weird. It works with cursorTarget but if I put this in init :

this enableSimulation false;

It doesn't work. Why ??

Share this post


Link to post
Share on other sites

Enable SImulation for Backpack seems broken. Look :

 

 
You know what I mean ?

Share this post


Link to post
Share on other sites

you should disable simulation for ground weapon holder, not backpack. cursorobject reported groundweaponholder, not backpack

  • Like 1

Share this post


Link to post
Share on other sites

you should disable simulation for ground weapon holder, not backpack. cursorobject reported groundweaponholder, not backpack

 

Okay thanks ! So, I tried to init BP with no simulation for groundweaponholder but doesn't work... is it possible to init groundweaponholder object with no simulation ? I don't really understand how to do that :huh:

Share this post


Link to post
Share on other sites

You should create groundweaponholder with script, then put backpack into it, and disable simulation for groundweaponholder

like this

_gwh = "GrounWeaponHolder" createVechile position player;
_gwh addBackpackCargo ["Backpack classname",1];
_gwh enableSimulation false;

try this in editor's debug console

 

for init field of backpack in mission you may try smth like this

_gwh = this nearEntities ["GroundWeaponHolder",1];
(_gwh select 0) enableSimulation false;
  • Like 1

Share this post


Link to post
Share on other sites

Thanks for advice it works !

 

I put this in invisible object init (near BP's) :

returnBP = (nearestObjects [this, ["GroundWeaponHolder"], 5]);
{ 
	_x enableSimulation false;
} forEach returnBP;

Now I'm trying to adjust BP's position with :

returnBP = (nearestObjects [this, ["GroundWeaponHolder"], 5]);
{
	_x enableSimulation false;
	_x setPos [(getPos _x select 0) +0.13, (getPos _x select 1) -0.65, (getPos _x select 2) +1];
	_x setVectorDirAndUp [[0,0,-1],[0,-1,0]];

} forEach returnBP;

It works but if somebody try to take a Backpack, it disappears. I think it's due to the "Take" Action player that reset position object if enableSim is false but I'm not sure...

Share this post


Link to post
Share on other sites

Then I will recommend to create a backpack within init script (say init.sqf or initServer.sqf)

Share this post


Link to post
Share on other sites

Then I will recommend to create a backpack within init script (say init.sqf or initServer.sqf)

 

 Okay I'll do it, thanks !

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

×