Guitox 10 Posted April 3, 2016 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
ussrlongbow 116 Posted April 3, 2016 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. 1 Share this post Link to post Share on other sites
Guitox 10 Posted April 3, 2016 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
Guitox 10 Posted April 4, 2016 Enable SImulation for Backpack seems broken. Look : You know what I mean ? Share this post Link to post Share on other sites
ussrlongbow 116 Posted April 4, 2016 you should disable simulation for ground weapon holder, not backpack. cursorobject reported groundweaponholder, not backpack 1 Share this post Link to post Share on other sites
Guitox 10 Posted April 4, 2016 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
ussrlongbow 116 Posted April 4, 2016 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; 1 Share this post Link to post Share on other sites
Guitox 10 Posted April 4, 2016 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
ussrlongbow 116 Posted April 4, 2016 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
Guitox 10 Posted April 4, 2016 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