MorrisTheCat Posted November 16, 2023 Posted November 16, 2023 This may have been asked before but I can’t find an answer. What is the best way to detect a bullet or gunfire from an aircraft (hornet) in a zone? There are conditions for missiles and bombs but I don’t see one for bullet fire. Thanks!
Grimes Posted November 17, 2023 Posted November 17, 2023 You have to use scripting to do it and unfortunately it isn't as straight forward as using the same type of script with other weapons. I've got a script sitting around somewhere that mostly traces where the bullets end up. It would be trivial to add an "in zone" check with it, but gotta find it first. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
MorrisTheCat Posted November 17, 2023 Author Posted November 17, 2023 Oh I see. Would be great if you could share the script!
Squiggs Posted May 10, 2024 Posted May 10, 2024 On 11/17/2023 at 1:04 PM, Grimes said: You have to use scripting to do it and unfortunately it isn't as straight forward as using the same type of script with other weapons. I've got a script sitting around somewhere that mostly traces where the bullets end up. It would be trivial to add an "in zone" check with it, but gotta find it first. Sorry to necro this thread, but did you ever find it? I too would find it useful.
Grimes Posted May 10, 2024 Posted May 10, 2024 Nope. Gist of it is to use https://wiki.hoggitworld.com/view/DCS_event_shooting_start event to start calling https://wiki.hoggitworld.com/view/DCS_func_searchObjects on a point around the aircraft and every few milliseconds searching for weapons. You add any missing shells to a table. Use https://wiki.hoggitworld.com/view/DCS_event_shooting_end to stop the check for world.searchObjects. Meanwhile you have another function that runs however often you want checking, updating the position, and removing shells as they cease to exist. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
Squiggs Posted May 11, 2024 Posted May 11, 2024 (edited) Looking at that documentation you provided and the example, if we wanted to have the player perform a gun run on a treeline or something could we not simply use: world.searchObjects(Object.Category.WEAPON, volS, ifFound) //where the WEAPON is say the GAU-8 and obviously the function called would be different from that in the documentation //and simply have it return true which triggers a message/flag/whatever we want saying the gun run was successful And have it run every 5 seconds or so to check for successful impacts? Rather than every few milliseconds in order to save performance? I'm thinking of a video I saw of Balitc Dragon's Raven One campaign where in one of the missions the player has to shoot near some enemy gunboats with their gun. Once they do the gunboats run away. There is no need to check if the player is the one firing (because no one else will be doing so) only to check if F18 gun rounds are landing in the desired area. Edited May 11, 2024 by Squiggs
VR Flight Guy in PJ Pants Posted June 30, 2024 Posted June 30, 2024 Any example script how S_EVENT_SHOOTING_START event can be used? I am working on a mission where the blue must wait for the red to shoot first or the game ends. Thanks in advanced. I Fly, Therefore I Am. One cannot go around not saying "Thank you" every time these days, can't you? YouTube: https://www.youtube.com/channel/UCc9BDi-STaqgWsjNiHbW0fA
Recommended Posts