Jump to content

NumbNutsJunior

Member
  • Content Count

    60
  • Joined

  • Last visited

  • Medals

Everything posted by NumbNutsJunior

  1. NumbNutsJunior

    Finding all cover objects

    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.
  2. NumbNutsJunior

    Vector creation command

    No engine command would be faster anyways... r*cos(theta) and r*sin(theta) are the most simple calculations you can make.
  3. NumbNutsJunior

    Create Vehicle Spawns

    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.
  4. 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
  5. NumbNutsJunior

    [RELEASE] Active Lockpicking

    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];
  6. NumbNutsJunior

    [RELEASE] Active Lockpicking

    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... };
  7. NumbNutsJunior

    [RELEASE] Active Lockpicking

    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.
  8. 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
  9. NumbNutsJunior

    [RELEASE] Active Lockpicking

    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).
  10. 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
  11. NumbNutsJunior

    [RELEASE] Notification System

    I think that may be a more server/mission specific feature, so it would probably be best to add that on your own. It is really as simple as adding a bool parameter to fn_handleMessage.sqf (maybe between _color and _condition) on whether or not to log that specific notification and if so then add it to the map interface through the diary commands. ... // Parameters params [["_text", ""], ["_duration", 5], ["_priority", 5], ["_color", [0.50, 0, 0]], ["_saveMessage", false], ["_condition", {true}]]; if (_text isEqualTo "") exitWith {}; ... // Save message to map if (_saveMessage) then { // Init private _subjectID = "notification_history"; // Check to create a new subject entry if !(player diarySubjectExists _subjectID) then { // Create new subject entry player createDiarySubject [_subjectID, "Notification History"]; }; // Create a new notification entry private _notificationTitle = format ["%1...", _text select [0, (count _text) min 25]]; player createDiaryRecord [_subjectID, [_notificationTitle, _text]]; }; ... I am not exactly a diary command expert but something like this should work 😅. (it also appeared to combine diary records with same text, so that was neat)
  12. A Notification System A simple notification system with timed hints that are simple and easy to use. Features - Priority message system, messages are sorted from top (highest priority) to bottom (lowest priority). - Personalize each message with whatever color progress timer you want. - Dynamic hint height to hold any length message. - Supports structured text of course. Setup - Define the files found in the example mission into your mission's function library and create any new messages through the script fn_handleMessage.sqf. - You will need to create the rscTitle life_message_hud either through your own system or with the function fn_initMessageHUD.sqf after defining message_hud.hpp in you're mission's rscTitles class. Showcase Download https://github.com/NumbNutsJunior/Notification-System Disclaimer The style of hint produced is not completely original as it was inspired from the types of notifications found on GTA V but the system created for them is designed for arma 3 and to be lightweight and portable across missions. 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
  13. NumbNutsJunior

    [RELEASE] Notification System

    Updated 3/28/2020: Added some file name compatibility. Added a small performance increase to notification queue.
  14. NumbNutsJunior

    Disable ESC key while dialog open

    Put it whatever file the dialog is initially created with ... so once the dialog is created (createDialog), you then assign `_display = findDisplay idd` (idd is usually defined in the hpp file for the dialog). You can use either of the first three code snippets that you quoted, dedmen just revised 7erra's snippet because it is redundant. Its like saying `_boolean = if (condition) then {true} else {false}`. Edit: If you are talking about the hpp/ext file for the "dialog code", then just below where the idd is defined you will want to just add the line: onLoad = "(_this select 0) displayAddEventhandler ['KeyDown', {(_this select 1) isEqualTo 1}];"; ... which just says "add an event handler to the dialog so that when a key is pressed, if that key is equal to 1 (escape key) then override the default behavior (closing the dialog)" onKeyDown = "(_this select 1) isEqualTo 1"; *this should also work the same*
  15. NumbNutsJunior

    Disable ESC key while dialog open

    🤔 _display displayAddEventhandler ["KeyDown", {(_this select 1) isEqualTo 1}]; 💇‍♂️
  16. NumbNutsJunior

    [Help] HoldAction to Classname

    Yeah, there is no real reason to do all that work. The condition gets evaluated every frame regardless if it is defined or not, the default value is just 'true'.
  17. NumbNutsJunior

    [Help] HoldAction to Classname

    The solution is quite simple. When using https://community.bistudio.com/wiki/BIS_fnc_holdActionAdd, the target parameter should be assigned to the player and then inside the conditionShow parameter you check if the player is looking at an object of the desired class name (e.g. ((typeOf cursorObject) isEqualTo "class_name")). Same thing applies to https://community.bistudio.com/wiki/addAction.
  18. Colored Hexes A portable mission that re-introduces colored group indicators to Arma 3. Features - Scriptable group indicators. - Adjustable group indicator colors. Setup - Disable the default group indicators within your server's difficulty settings. - Define the script fn_initColoredHexes.sqf and call it from any initialization function that runs locally on the player once during mission run-time. - Define the pizza_colored_hexes_enabled global variable before calling the hexes initialization script. Showcase Download https://github.com/NumbNutsJunior/Colored-Hexes Disclaimer Re-adding colored group indicators has been done before but the only public version available (that I have found) is under ShackTac's UI mod. This mod almost completes the same task but the vehicle hex position is inaccurate and it is not very lightweight, and so I am releasing this version for those who wish to add colored hexes to their missions with little complexity. I hope you can find some use for it in your missions! Feel free to modify and improve on it of course, but I just ask that you leave the initial author credits. ~ NumbNutsJunior aka Pizza Man
  19. I am unable to collect examples right now because I am on mobile but my issue is that I need to convert the relative position of a 2D control group control to its position relative to the control group's parent display. The reason is because I need to compare the position of a control group control to a display control and I cannot get around having to use a control group. If anyone has any solutions or suggestions, that would be greatly appriciated!
  20. NumbNutsJunior

    Control Posititon Relative Conversion?

    Thank you man. I knew it was something simple, worked perfectly.
  21. NumbNutsJunior

    [RELEASE] Notification System

    Updated 7/18/2019: Added timer conditions Added cleanup for controls Fixed issue related to RemoteExec/RemoteExecCall Use fn_handleMessage with these commands
  22. I am not sure what kinda testing environment you have setup, and from the information given to use it looks like it should work perfectly fine. So rather wasting time playing 20 questions I went ahead and created an example mission for you, recreating exactly what you are trying to do with what you have showed us from your script. My assumption is that your diag_logs are going to a server rpt file and you are just looking in the wrong place because the event handler is assigned to a globally created vehicle and not a player but they would show up in your own rpt files if you ran the mission as the host. Hopefully this helps! https://drive.google.com/open?id=1h4yG0cNClq3MR8-phCTtcA6HHzc_mYnG
  23. The example @Maff gave worked fine for me, the event handler 'fuel' only gets activated when "Triggered when the vehicle's fuel status changes between non-empty and empty or between empty and non-empty." I got your "systemchat 'setfuel 1';" twice, once for when the car ran out of gas and again after the code "(_this select 0) setFuel 1;" ran. Depending on the testing environment you might not get the system chat because the event handler is assigned to the vehicle, not to the player and systemChat has a local effect while setFuel has a global effect. So probably don't base your testing on that alone.
  24. Nothing about this seems to make any sense, I think this is more than just a bracket ... Look at your parameters: this (good) "INIT=" (good) [_proxyThis,]addeventhandler ["Fuel",{(_this select 0) setfuel 1; systemchat "setfuel 1";}]; (bad) addeventhandler takes an object as its first parameter, not an array. "[_proxyThis,]", _proxyThis is undefined (you say its treated as "this" but you still use "this" rather than _proxyThis as the first parameter). "[_proxyThis,]" you have a comma after the first element with no second element of the array Why are you trying to assign an event handler to something as a parameter, unless you are trying to pass the handler id. "addeventhandler ["Fuel",{(_this select 0) setfuel 1; systemchat "setfuel 1";}];" you have a semi colon at the end of the element, that is like saying _array = [1,2,3;]; You should probably do something like what @Maff suggested. Then do some more reading up on the wiki on how to script cause you will get generic error messages for a lot of different problems and will waste your time looking for some missing bracket or semi colon that does not exist.
  25. NumbNutsJunior

    Change Text of an edit box

    Your problem is that in your conditions you are trying to compare text to a number ... // Returns text _am1 = ctrlText _ctrl1; _am2 = ctrlText _ctrl2; _am3 = ctrlText _ctrl3; // Error - checking if text is less than a number if (_am1 < 200) then {_ctrl1 ctrlSetText "200"; player setVariable ["overall_distance",200]}; The very simple fix for this is to parseNumber for those three variables // Returns text _am1 = parseNumber(ctrlText _ctrl1); _am2 = parseNumber(ctrlText _ctrl2); _am3 = parseNumber(ctrlText _ctrl3); // No-error - Checking if a number is less than a number if (_am1 < 200) then {_ctrl1 ctrlSetText "200"; player setVariable ["overall_distance",200]};
×