-
Content Count
65 -
Joined
-
Last visited
-
Medals
Community Reputation
65 ExcellentAbout NumbNutsJunior
-
Rank
Corporal
Recent Profile Visitors
-
[RELEASE] Active Lockpicking
NumbNutsJunior replied to NumbNutsJunior's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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... -
getPos of EVERY object in an array and createVehicle on EVERY position in that array?
NumbNutsJunior replied to RabbitxRabbit's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You are pretty close to your solution already; the position array seems a bit redundant since you are just using the object list to get the position anyways... Just need something like: {"test_EmptyObjectForFireBig" createVehicle (getPosATL _x)} forEach _objectList; // _x is any given object in the object list from nearestObjects Edit: Also, may want to refine your list of nearest objects or check if a fire is already created nearby when creating other fire objects, it could just be a lot of unnecessary effects if there are lots of small objects or something -
GUI 3D Object Direction/Up Vectors (pls help)
NumbNutsJunior replied to NumbNutsJunior's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Yeah, that does sound useful, this is my first time working with GUI objects so I probably should have started doing it that way lol Added github link to post if you can see any other silly vector mistakes maybe (currently lines 189-266) -
GUI 3D Object Direction/Up Vectors (pls help)
NumbNutsJunior replied to NumbNutsJunior's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Unfortunately, this guess didn't solve it, the screwdriver still points down, and out of the screen... I figured it would work similar to the results of my world object testing but which is not what I would expect when using vectorFromTo. I've added a github branch so you can get this context of what's being worked on. I did try to use your old GUI part 6 tutorial for some help initially, another annoying cavet was that the objects in a user defined display, always seem to be placed behind the 2d controls regardless of the order in which they are defined. I was curious how the avatar creator does it but my work around was just creating another gui since I'm using cutRsc and they can have different layers unlike dialog. From more testing, it might be due to the x,y positions not being in the center of the lockpick but there are no commands to get the object bounding box for gui objects... id have to reference an object in the world using boundingBoxReal maybe? Github: https://github.com/NumbNutsJunior/Active-Lockpicking/blob/screwdriver/Lockpicking.VR/hud/functions/fn_hud_lockpick.sqf Thanks again sorry it took so long to reply, I've been away from computer for a bit. -
NumbNutsJunior started following GUI 3D Object Direction/Up Vectors (pls help)
-
GUI 3D Object Direction/Up Vectors (pls help)
NumbNutsJunior posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I am trying to make a 3D object point to a position in GUI. I have the object at `z = 0.25`, I assume that the other 2D controls would be at `z = 0.00`. I have tested in the eden editor with the following code, and it works perfectly fine... // ... private _screw_driver_pos = position screwdriver; private _can_pos = position can; // ... private _dir_vector = _screw_driver_pos vectorFromTo _can_pos; // ... private _random_direction = [random 100, random 100, random 100]; _random_direction = vectorNormalized _random_direction; // ... private _up_vector = _dir_vector vectorCrossProduct _random_direction; _up_vector = vectorNormalized _up_vector; // ... screwdriver setVectorDirAndUp [_dir_vector, _up_vector]; This is the result of that: This is the code when working with the gui controls... // DEBUG debug_control_01 ctrlSetPosition [_screw_driver_tip_position_x, _screw_driver_tip_position_y]; debug_control_01 ctrlCommit 0; // DEBUG debug_control_02 ctrlSetPosition [_screw_driver_position_x, _screw_driver_position_y]; debug_control_02 ctrlCommit 0; // Get the screwdriver's current position and desired tip position private _screw_driver_position = [_screw_driver_position_x, _screw_driver_position_z, _screw_driver_position_y]; private _screw_driver_tip_position = [_screw_driver_tip_position_x, _screw_driver_tip_position_z, _screw_driver_tip_position_y]; // Update the screwdriver's position _screw_driver_object ctrlSetPosition _screw_driver_position; // Calculate the screwdriver's direction based on the tip position private _screw_driver_dir = _screw_driver_position vectorFromTo _screw_driver_tip_position; // ... private _random_direction = [random 100, random 100, random 100]; _random_direction = vectorNormalized _random_direction; // ... private _screw_driver_up = _screw_driver_dir vectorCrossProduct _random_direction; _screw_driver_up = vectorNormalized _screw_driver_up; // Update the screwdriver's direction _screw_driver_object ctrlSetModelDirAndUp [_screw_driver_dir, _screw_driver_up]; This is the result of that: If you understand why this happens or what I need to do to fix this, please help. The screwdriver's tip is supposed to be pointing at the red dot in the lock @Dedmen @killzone_kid Added github branch for more context: https://github.com/NumbNutsJunior/Active-Lockpicking/blob/screwdriver/Lockpicking.VR/hud/functions/fn_hud_lockpick.sqf -
NumbNutsJunior started following [RELEASE] Death Camera, [RELEASE] Active Lockpicking and [RELEASE] Arma Decorators
-
Finding all cover objects
NumbNutsJunior replied to gc8's topic in ARMA 3 - MISSION EDITING & SCRIPTING
you could trying using boundingBoxReal to refine your search with the ClipGeometry or ClipVisual options, and then compare the height of the object to the height of the player or something along those lines. -
Vector creation command
NumbNutsJunior replied to gc8's topic in ARMA 3 - MISSION EDITING & SCRIPTING
No engine command would be faster anyways... r*cos(theta) and r*sin(theta) are the most simple calculations you can make. -
Create Vehicle Spawns
NumbNutsJunior replied to General McTavish's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Sounds a lot like a life server 🤔. Your problem is that you are simply checking if any of the markers across the map have no entities within 50 meters of them and Spawn1 was probably clear of entities every time you tested it. Instead, you should be checking which markers are closest or within 'x' range of the shop that the player is buying from, then using the near entities command to check if the spawn point is blocked by another vehicle or something. -
[RELEASE] Active Lockpicking
NumbNutsJunior replied to NumbNutsJunior's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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]; -
[RELEASE] Active Lockpicking
NumbNutsJunior replied to NumbNutsJunior's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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... }; -
[RELEASE] Active Lockpicking
NumbNutsJunior replied to NumbNutsJunior's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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. -
[RELEASE] Active Lockpicking
NumbNutsJunior replied to NumbNutsJunior's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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). -
NumbNutsJunior changed their profile photo
-
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 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
- 12 replies
-
- 16
-
Arma Decorators A vanilla SQF extension implementing python style decorators. 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. - With this particular project, having "not been completely fleshed out" means that it may contain security bugs (although I don't think it does). - - I have done extensive testing but I would advise only experienced scripters to use this if you plan on implementing it on any public servers. Features - Implement a subscript into any other script through config file attributes (eg. anti-cheat, logging, ect) - Add custom meta-data into any script during compilation. Setup - Define the files found in the example mission into your mission's function library. - Within your function library, copy and implement the example mission's "Decorators" category/class. - - Exclude trackCalls & trackRuntime unless you want these example decorators hanging around. - For any function you want to decorate, provide a decorators[] array attribute containing a list of decorator script names as strings. - Within your mission's description.ext, set allowFunctionsRecompile = true. This process essentially just adds one more recompile pass. - - All config, campaign, and mission function libraries will be compileFinal on the second pass (unless explicitly set otherwise). Showcase Download https://github.com/NumbNutsJunior/Arma-Decorators 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
-
A Death Camera A smooth tracking camera to watch your dead body. 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 - Smooth tracking (updates on each frame as a camera should) - Auto adjusting camera distance based on objects obstructing view. - Camera should always target correct dead body as of recent fix: https://feedback.bistudio.com/T148420. Setup - Define the files found in the example mission into your mission's function library and call fn_deathCamera whenever your player dies/respawns. - Either pass the player's dead body to fn_deathCamera, add a new parameter and update life_dead_body at the beginning of the script or update life_dead_body before calling fn_deathCamera. Showcase Download https://github.com/NumbNutsJunior/Death-Camera 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
- 1 reply
-
- 2