Jump to content

Bomb impact from point distance?


Recommended Posts

Is it possible to set a readout to tell where the bomb hit (bearing and distance) from a trigger zone of 1 meter?

 

Very useful to train CCIP and to assess accuracy under wind conditions.

AWAITING ED NEW DAMAGE MODEL IMPLEMENTATION FOR WW2 BIRDS

 

Fat T is above, thin T is below. Long T is faster, Short T is slower. Open triangle is AWACS, closed triangle is your own sensors. Double dash is friendly, Single dash is enemy. Circle is friendly. Strobe is jammer. Strobe to dash is under 35 km. HDD is 7 times range key. Radar to 160 km, IRST to 10 km. Stay low, but never slow.

Link to comment
Share on other sites

Yes, but you gotta do some math. In pseudo code you are going to have to track weapons fired and keep using the function land.getIP() on the weapon until it no longer exists. From there you have to compare the distance between the trigger zone and the landing point. Then build a string based on comparing those two points in Bearing Range format.

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

Link to comment
Share on other sites

AWAITING ED NEW DAMAGE MODEL IMPLEMENTATION FOR WW2 BIRDS

 

Fat T is above, thin T is below. Long T is faster, Short T is slower. Open triangle is AWACS, closed triangle is your own sensors. Double dash is friendly, Single dash is enemy. Circle is friendly. Strobe is jammer. Strobe to dash is under 35 km. HDD is 7 times range key. Radar to 160 km, IRST to 10 km. Stay low, but never slow.

Link to comment
Share on other sites

This is from the FC3 MP mission "Sokhoi Surprise" and was made by Speed. It might get you pointed in the right direction. Basically it tracks all BetAB_500 bombs fired and checks to see if the bombs landed in a polygon defining the runway. Actually several polygons because he split the runway up into segments. The track_wpns function checks to see if the bomb still exists, if so update its position and velocity vector. If it doesn't exist then check the last known data and get the impact point based on that information, also remove that weapon so its no longer tracked. Hope it might help.

 

   local tracked_wpns = {}
   
   local shotHandler = function(event)
       if event.id == world.event.S_EVENT_SHOT then
           if event.weapon then 
               local wpn = event.weapon
               if wpn:isExist() then
                   local wpnName = wpn:getTypeName()
                   if wpnName and type(wpnName) == 'string' and (wpnName:find('BetAB_500')) then
                       local init = event.initiator
                       local init_name = ''
                       if init:isExist() then
                           init_name = init:getName()
                       end
                       tracked_wpns[event.weapon.id_] = { wpn = wpn, init = init_name, pos = wpn:getPosition().p, dir = wpn:getPosition().x }
                   end
               end
           end
       end
   end
   mist.addEventHandler(shotHandler)

   local function track_wpns()
       mist.scheduleFunction(track_wpns, {}, timer.getTime() + 0.05)  -- reschedule first
       
       for wpn_id_, wpnData in pairs(tracked_wpns) do
           if wpnData.wpn:isExist() then  -- just update position and direction.
               wpnData.pos = wpnData.wpn:getPosition().p
               wpnData.dir = wpnData.wpn:getPosition().x
           else -- wpn no longer exists, must be dead.
               tracked_wpns[wpn_id_] = nil -- remove from tracked weapons first.
               local ip = land.getIP(wpnData.pos, wpnData.dir, 20)  -- terrain intersection point with weapon's nose.  Only search out 20 meters though.
               local impactPoint
               if not ip then -- use last position
                   impactPoint = wpnData.pos
               else -- use intersection point
                   impactPoint = ip
               end
               for i = 1, #segmentPolys do
                   if mist.pointInPolygon(impactPoint, segmentPolys[i]) then -- weapon impacted in runway segment!
                       runwayHits[i][#runwayHits[i] + 1] = wpnData.init
                   end
               end
           end
       end
   end
   
   track_wpns()

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

Link to comment
Share on other sites

  • 3 weeks later...

thanks Grimes. I'll see if I can use it properly.

AWAITING ED NEW DAMAGE MODEL IMPLEMENTATION FOR WW2 BIRDS

 

Fat T is above, thin T is below. Long T is faster, Short T is slower. Open triangle is AWACS, closed triangle is your own sensors. Double dash is friendly, Single dash is enemy. Circle is friendly. Strobe is jammer. Strobe to dash is under 35 km. HDD is 7 times range key. Radar to 160 km, IRST to 10 km. Stay low, but never slow.

Link to comment
Share on other sites

Bunyap Sims did a virtual Hawgsmoke a little while back and he devised a system for scoring bombing accuracy...

 

hmm. must've missed it considering I am subscribed to him. I'll look for it. thanks for the tip.

AWAITING ED NEW DAMAGE MODEL IMPLEMENTATION FOR WW2 BIRDS

 

Fat T is above, thin T is below. Long T is faster, Short T is slower. Open triangle is AWACS, closed triangle is your own sensors. Double dash is friendly, Single dash is enemy. Circle is friendly. Strobe is jammer. Strobe to dash is under 35 km. HDD is 7 times range key. Radar to 160 km, IRST to 10 km. Stay low, but never slow.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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