Jump to content

Recommended Posts

Posted

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!

Posted

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 ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

  • 5 months later...
Posted
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.

Posted

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 ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Posted (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 by Squiggs
  • 1 month later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...