Jump to content
KutPax

[SOLVED] Unlock Cursortarget Door

Recommended Posts

Hiya folks,

I'm trying to make a Picklock script, where you look at a door and it executes the script and gives you a certain % chance of unlocking it.

I want to base this off of a script pierremgi helped me out with a long time ago, I'll list it below.

 

Spoiler

_playerPos = position player;
_nearestBuilding = nearestBuilding player;
_distancetohouse = _playerPos distance _nearestBuilding;
private "_intersects";
private _begin = ASLtoATL eyepos player;
private  _end = _begin vectorAdd (eyeDirection player vectorMultiply 1.5);
{
  _intersects = ([cursorObject, _x] intersect [_begin,_end]);
    if (count (_intersects select 0) > 0) exitwith {_intersects}
 } forEach  ["VIEW","GEOM","FIRE"];
 disableUserInput true;
 if (count (_intersects select 0) > 0) then {Player switchmove "MOCAP_Idle_Stay_CombatPace_Rfl_Push_Kick_LeftLeg"};
 sleep 0.5;
 disableUserInput false; 
 if (count (_intersects select 0) > 0) then {[Player, ["Smash", 50, 1]] remoteExec ["say3D"]};
 private _seed = [1,101] call BIS_fnc_randomInt;
if (_seed >75) exitWith {false};
 if (count (_intersects select 0) > 0) then {[cursortarget, ["DoorKickSound", 65, 1]] remoteExec ["say3D"];};
 _select_door = format ["%1_rot", (_intersects select 0 select 0)];
cursorObject animate [_select_door, 1, 8];


Now instead of the door being breached, I want it to be unlocked. I have tried to work with "bis_disabled_Door_1", only that only refers to a specific door of an object, while I want the cursorobject door to be unlocked.

I'm getting kind of stuck here since I have barely worked with doors in Arma.

If anyone could help me out here, that'd be much appreciated!
 

Share this post


Link to post
Share on other sites

Heya @KutPax, welcome to the forums!

I think you're looking for the lock command.

And before someone beats me to it, this is a damned good script I've used in multiplayer:

Happy mission making!

  • Like 1

Share this post


Link to post
Share on other sites

No, it's a dutch military thing 😉

Also the lock command seems to be for Vehicles, I'm trying to unlock a single door on a building which I am looking directly at (CursorTarget or CursorObject)

Share this post


Link to post
Share on other sites

 

22 minutes ago, KutPax said:

No, it's a dutch military thing 😉

NSFW I assume? :D

Now I agree with you on that the lockpicking scripts I know open doors; they don't unlock them.

But if you look at the forum post link I sent, in the GitHub, you'll see it's got a pretty nifty door detection based on ray intersects from the player skeleton:
https://github.com/NumbNutsJunior/Active-Lockpicking/blob/master/Other Examples/Lockpicking_Doors.Altis/functions/generic/fn_findTargetSelection.sqf

Share this post


Link to post
Share on other sites

That still doesn't work out for me, I'm trying to edit the script I posted in the spoiler, to UNLOCK the door I am looking at, instead of kicking it open and playing an animation on the door so it rotates open with the speed accelerated by x8

Share this post


Link to post
Share on other sites

I disagree. 

I believe you can use that function to identify which door your script needs to unlock. Then use the correct "bis_disabled_Door_x" variable to unlock the door.

Will give it a go when I get home :). 

Share this post


Link to post
Share on other sites

Wow I totally checked out the wrong file, I just read the correct one and you're right, I'm gonna play around with it in a bit!

Share this post


Link to post
Share on other sites

sorry for late reply:

brand new cooked script:

 

 

 

 

  • Like 1

Share this post


Link to post
Share on other sites

Thanks, I'll check it out!

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

×