Jump to content
Purzel

Lockpick doors with BIS_fnc_holdActionAdd

Recommended Posts

Hi there,
I´ve a question about building-doors...

I set up a house (Land_House_Big_02_F (bungalow)), which has 5 doors named bungalow.
That building has a room which has two entries into one room.
In that room, theres a terminal the players must hack, to gather informations...
For security this room is locked (door-States of door 3 & door 5 are set to locked) with the Eden-Editor as shown for example in

this picture.
How can I put the BIS_fnc_holdActionAdd only on this two doors?

e.g.:


[door5, "Lockpick door", "pictures\holdaction_key.paa", "pictures\holdaction_key.paa", "_this distance _target < 3", "true", {}, {}, {   bungalow setVariable["bis_disabled_Door_5",0,true];    }, {}, [], 5, nil, true, false] call BIS_fnc_holdActionAdd;

 

would be the code if the door would be a single object, but it´s a "child" of the "parent" Land_House_Big_02_F (bungalow)...
So how can I adress door5 itself to show the Lockpick-HoldAction only at door5 ?
(and of course door3 itself)

Thanks for your help!
Purzel

___________________________________________________________________________
In case anyone needs some custom HoldAction-Icons, feel free to use them:
(format: .png, 64 x64 px, just import them to TexView and save as .paa))

holdactionhacku3inj.pngholdactionkeymmfmc.pngholdactionunlockg2i7y.pngholdactionkiste8nc65.pngholdactionkisteentlad3uco3.pngholdactionkisteladenz5ib8.pngholdactiontelefon04enh.pngholdactionunbekanntfaitm.pngholdactionwarnungfaeao.png  and an empty one for your own creations: holdactionleerm7f9s.png

 

Please do NOT quote the icons for traffic reasons in your posts - thanks!
If anyone needs some special HoldAction-icons, just send me a message and I will try to create it for you.

 

 

  • Like 2
  • Thanks 3

Share this post


Link to post
Share on other sites
13 hours ago, Purzel said:

In case anyone needs some custom HoldAction-Icons, feel free to use them:

I cannot answer your main quest man, but certainly  I thank you for those icons!

Share this post


Link to post
Share on other sites

You can try this code in init field of bungalow:
 

[
  this,
  "Lockpick door",
  "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
  "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
  "
    call {  
      private ['_intersects','_select_door'];
      _intersects = ([cursorObject, 'VIEW'] intersect [ASLToATL eyepos player, (screentoworld [0.5,0.5])]);
      _select_door = if (count _intersects > 0 && {(_intersects select 0) select 0 in ['door_3','door_5']}) then [{format ['bis_disabled_%1', (_intersects select 0 select 0)]},{''}];
      if (_this distance _target < 15 && _select_door in ['bis_disabled_door_3','bis_disabled_door_5']) then {
        MGI_select_door = _select_door; true
      } else {false};
    };
    true",
  "true", {}, {},
  {
    if (_target getVariable [MGI_select_door,1] !=0) then {
      _target setVariable[MGI_select_door,0,true]
    } else {
      _target setVariable[MGI_select_door,1,true]
    }
  }, {}, [], 5, nil, false, false
] call BIS_fnc_holdActionAdd;

 

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites

Great!
You´re code is working perfectly!!!
A big Thanks!

I understand what you´re doing there, but I wouldn´t know by myself, how to to find the solution.

Share this post


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

You can try this code in init field of bungalow:

 

Awesome info.

I tried this in the init of the same house referenced above. I get the prompt to "Lockpick door but it doesn't actually unlock. As soon as it reaches the end of the holdaction the same holdaction appears again, I've tried it with the door unlocked and locked in the editor. I was using door 5. I'm assuming only your code in the houses init is all that's required or am I missing something?

 

Appreciate any help and sorry to high jack the thread.

Share this post


Link to post
Share on other sites
1 hour ago, major-stiffy said:

 

Awesome info.

I tried this in the init of the same house referenced above. I get the prompt to "Lockpick door but it doesn't actually unlock.

 

Did you lock it by editor?  You can always try this other code:

 

[this, "Lockpick door", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",  
 "  
 call {   
  private ['_intersects','_select_door'];  
    _intersects = ([cursorObject, 'VIEW'] intersect [ASLToATL eyepos player, (screentoworld [0.5,0.5])]);  
_select_door = if (count _intersects > 0 && {(_intersects select 0) select 0 in ['door_3','door_5']}) then [{format ['%1_sound_source', (_intersects select 0 select 0)]},{''}];
if (_this distance _target < 15 && _select_door in ['door_3_sound_source','door_5_sound_source']) then { MGI_select_door = _select_door; true } else {false};
  };
true   
", "true", {}, {}, {if (_target animationSourcePhase MGI_select_door == 0) then {_target animateSource [MGI_select_door,1]} else {_target animateSource [MGI_select_door, 0] }}, {}, [], 5, nil, false, false] call BIS_fnc_holdActionAdd;

 

 

 

  • Like 1

Share this post


Link to post
Share on other sites
4 hours ago, major-stiffy said:

I've tried it with the door unlocked and locked in the editor.

2 hours ago, pierremgi said:

You can always try this other code:

 

OK, tried your new code above and it worked. Prerequisite requires the door to be locked in the editor.

TBH, I used the code above in a script changing this to bungalow (variable name). Works. :icon14:

 

Next question to just tidy it up is that the action remains on the door even after it's open. Just thought I'd point that out.

Thanks soooo much for taking the time to respond. I've always wanted to know how this worked.

Also appears these actions work too but have not tried them yet.

     "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa"
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_forceRespawn_ca.paa"
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_hack_ca.paa"
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_revive_ca.paa"
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_reviveMedic_ca.paa"
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_search_ca.paa"
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_takeOff1_ca.paa"
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_takeOff2_ca.paa"
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_unbind_ca.paa"

EDIT: Also the door cannot be closed once open.

Edited by major-stiffy
Added edit
  • Like 1

Share this post


Link to post
Share on other sites

All this information is great and the very last code worked for me perfectly. The previous one was not a success. I had to start all over again when the action was done. How can I add sfx sound to the action itself? 🙂

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

×