Jump to content
NumbNutsJunior

[RELEASE] Active Lockpicking

Recommended Posts

Active Lockpicking

A Skyrim style lockpicking mini-game for Arma 3.

 

 

 

Disclaimer

This release is part of a series of releases containing projects that I have not completely fleshed out or implemented into any dedicated server environment. I am releasing these projects because I have stopped playing and scripting for Arma 3, but I figured that this project was interesting enough that others may want to implement them into their missions. That being said, use them as you will and enjoy.

 

Features

- An alternate random chance force pick.

- Customizable difficulty levels.

Setup

- Define the files found in the example mission into your mission's function library.
- Include hud_lockpick and hud_default into your mission's description.ext's RscTitles.

- Implement key handlers into your mission's respective key handling scripts in order for GUI controls to function properly.
- Call fn_hud_lockpick from a lockpick script which implements your mission's vehicle/door/crate lock system.
- - Needs to be called from a spawned environment (canSuspend). 

Showcase

 

as3yaE7.png


Download
https://github.com/NumbNutsJunior/Active-Lockpicking


I hope you can find some use for it in your missions, feel free to modify and improve the system of course but just ask to leave my initial author credits.
~ NumbNutsJunior aka Pizza Man

  • Like 11
  • Thanks 5

Share this post


Link to post
Share on other sites

What a fun little script! I already see a situation where the player needs to pick a lock and teammates have to provide cover/security...or try not to raise alarms in case of an "incognito" state/mission. Good job, mate.

  • Like 2

Share this post


Link to post
Share on other sites

Hello. Can you add to the script so that the equipment of the cars is also closed?

Share this post


Link to post
Share on other sites
10 hours ago, topden said:

Hello. Can you add to the script so that the equipment of the cars is also closed?

Not quite sure what you mean by "equipment of the cars", but if the car is locked then the inventory should also be inaccessable.

 

The script itself is just the lockpicking mini-game where when you call the script fn_hud_lockpick from a spawned enviornment, the function will return a bool with true for lockpick success and false for failure. You can use the mini-game in any fashion you want, I simply included the car as an example where fn_hud_lockpick was called by fn_lockpick (a general purpose lockpick action handler).

Share this post


Link to post
Share on other sites
5 hours ago, NumbNutsJunior said:
Сам скрипт - это просто мини-игра с отмычкой, где при вызове скрипта fn_hud_lockpick из порожденной среды функция возвращает bool с true для успеха отмычки и false для неудачи. Вы можете использовать мини-игру любым удобным вам способом, я просто включил автомобиль в качестве примера, где fn_hud_lockpick был вызван fn_lockpick (обработчик действий lockpick общего назначения).

Hello, this is a very cool script, but I do not understand how to apply it to the closed doors of vanilla buildings....

Share this post


Link to post
Share on other sites
7 hours ago, NumbNutsJunior said:

Not quite sure what you mean by "equipment of the cars", but if the car is locked then the inventory should also be inaccessable. 

 

 

inventory. yes. but inventory open((

Share this post


Link to post
Share on other sites

Updated 3/3/2021:
- Implemented force pick concept (remove/comment out key handler for F and remove control listing to disable).
- Tweaked the pick so that it will not break while the lock is rotating counter-clockwise.

  • Thanks 1

Share this post


Link to post
Share on other sites

Amazing amazing script! Very immersive! 

 

May I ask, can we use this on regular doors or was it just designed for vehicles?

Share this post


Link to post
Share on other sites
3 hours ago, LSValmont said:

Amazing amazing script! Very immersive! 

 

May I ask, can we use this on regular doors or was it just designed for vehicles?

 

You can use this on regular doors... the game does not provide a convenient way for opening the doors of vanilla or even placed buildings but since this seems to be a common want, I'll try to provide a script for doing that. The mini-game itself, when called from a spawned environment, will suspend the currently running (calling) script and return a bool if the "lockpick" (mini-game) a was success or fail.

You could do virtually whatever you want with it:

// Calling script is not suspend safe
if (!canSuspend) exitWith {};

// Attempt to lockpick
if ([] call pizza_fnc_hud_lockpick) then { // Script suspends at this line until the mini-game is complete

	// Unlock car..
	// Open door of building...
	// Launch nuclear missle and kill everyone in the mission...
};

 

  • Thanks 1

Share this post


Link to post
Share on other sites

I like the subliminal messaging in your script:   "call pizza"

mmmmm

unless it's Pizza the Hut, he's a dangerous gangster

 

oh and great job on the lockpicking UI, looks like 4K Skyrim addon

 

  • Like 1
  • Haha 2

Share this post


Link to post
Share on other sites
On 1/21/2021 at 8:19 PM, MblIIIkA said:

Hello, this is a very cool script, but I do not understand how to apply it to the closed doors of vanilla buildings....

 

On 3/6/2021 at 5:46 PM, LSValmont said:

Amazing amazing script! Very immersive! 

 

May I ask, can we use this on regular doors or was it just designed for vehicles?

 

Mission: https://github.com/NumbNutsJunior/Active-Lockpicking/tree/master/Other Examples

Here is a script that will provide the selection name for whatever you are currently looking at (limited to 100 meters). I have used this script within an example mission on the GitHub to show how you can unlock, lock, open, and close vanilla doors (functions\actions\fn_lockpick.sqf). The process can be slightly different depending on what object your are trying to animate, but this should work for most if not all building and tower doors (fn_lockpick in example mission is limited to objects of type "house").

// Author: Pizza Man & wiki example
// File: fn_findTargetSelection.sqf
// Description: Return the selection name of current camera target.

// Find object at center of screen (similar to cursorObject)
private _ray_begin = AGLToASL (positionCameraToWorld [0,0,0]);
private _ray_end = AGLToASL (positionCameraToWorld [0,0,100]);
private _parent_object_intersections = lineIntersectsSurfaces [_ray_begin, _ray_end, vehicle player, player, true, 1, "FIRE", "NONE"];
if ((count _parent_object_intersections) isEqualTo 0) exitWith {[objNull, "", []]};

// Check if intersected object contains indexable pieces (skeleton)
private _parent_object = (_parent_object_intersections select 0) param [3, objNull];
if !((getModelInfo _parent_object) select 2) exitWith {[objNull, "", []]};

// Check if initial ray intersected any selections of parent object's skeleton
private _skeleton_intersections = [_parent_object, "FIRE"] intersect [ASLToAGL _ray_begin, ASLToAGL _ray_end];
if ((count _skeleton_intersections) isEqualTo 0) exitWith {[objNull, "", []]};

// Init selection from skeleton intersections
(_skeleton_intersections select 0) params [["_selection", ""]];
if (_selection isEqualTo "") exitWith {[objNull, "", []]};

// Return
[_parent_object, _selection, _parent_object selectionPosition _selection];

 

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Updated 7/21/2024:
- Added screwdriver 3D GUI object to act as device pushing the lock
- Added difficulty parameters
- Changed so lockpicks "take damage" the longer they are under stress outside of the sweet spot range
- Change the speed the lockpick rotates for more control at higher difficulties

If anyone has a better solution to this disgusting portion of code for getting the correct x, y position of the screwdriver and setting its direction due to the depth/projection perspective please suggest. fn_hud_lockpick.sqf

// ...
private _screw_driver_distance_to_center_of_screen = [_screw_driver_position_x_prime, _screw_driver_position_y_prime] vectorDistance [0.5, 0.5];
private _screw_driver_tip_distance_to_center_of_screen = [_screw_driver_tip_position_x, _screw_driver_tip_position_y] vectorDistance [0.5, 0.5];

// ...
private _screw_driver_position_adjusted_x = _screw_driver_position_x_prime - (0.75 * (pixelW * pixelGridNoUIScale)) - (5 * (pixelW * pixelGridNoUIScale) * _screw_driver_distance_to_center_of_screen);
private _screw_driver_position_adjusted_y = _screw_driver_position_y_prime - (7 * (pixelH * pixelGridNoUIScale) * _screw_driver_distance_to_center_of_screen);

// ...
private _rotation_percentage = _current_lock_angle / 90;
private _screw_driver_tip_position_adjusted_x = _screw_driver_tip_position_x - (0.75 * (pixelW * pixelGridNoUIScale)) + (1.00 * (pixelW * pixelGridNoUIScale) * _rotation_percentage);
private _screw_driver_tip_position_adjusted_y = _screw_driver_tip_position_y + (0.50 * (pixelH * pixelGridNoUIScale)) + (0.75 * (pixelH * pixelGridNoUIScale) * _rotation_percentage);

Unfortunately, the scripting discord was of no help even for open-source community projects...
5UCIG5M.png

  • Like 1

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

×