Jump to content

group or unit id for parachute of ejected pilot


wolle

Recommended Posts

Does anyone know: after a pilot ejects a parachute is visible in the sim. Is this a regular group/unit that gets created, and if so, how can I find its group and/or unit id with the scripting engine?

[sIGPIC][/sIGPIC]

 

Intel Core I7 4820K @4.3 GHz, Asus P9X79 motherboard, 16 GB RAM @ 933 MHz, NVidia GTX 1070 with 8 GB VRAM, Windows 10 Pro

Link to comment
Share on other sites

A new object is created, but not a unit/group. Basically you have to use an event handler to get the runtime ID of the ejected pilot and from there you can use getPosition() and a few others on it. The same basic premise exists for weapons like missiles, bombs, and bullets.

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

A new object is created, but not a unit/group. Basically you have to use an event handler to get the runtime ID of the ejected pilot and from there you can use getPosition() and a few others on it. The same basic premise exists for weapons like missiles, bombs, and bullets.

 

Hi Grimes,

 

You'll have to help me a little more (if your time permits). According to the scripting wiki part one, an event is a list with the following structure:

 

Event = {

id = enum world.event,

time = Time,

initiator = Unit,

target = Unit,

place = Unit,

subPlace = enum world.BirthPlace,

weapon = Weapon

}

 

Which of these gives me the object id of the parachute? My goal is to follow the position of the parachute. It is very easy to follow the position of the burning plane, using:

 

Unit.getPosition(event.initiator)

 

What would be the corresponding command to get the position of the parachute?

[sIGPIC][/sIGPIC]

 

Intel Core I7 4820K @4.3 GHz, Asus P9X79 motherboard, 16 GB RAM @ 933 MHz, NVidia GTX 1070 with 8 GB VRAM, Windows 10 Pro

Link to comment
Share on other sites

Object.getPosition(event.initiator)

 

Negative, Grimes. This simply gives the burning plane coordinates, and this command ceases to exist as soon as the burning plane hits the ground (see attached simple test mission)

LandEventHandler.miz

[sIGPIC][/sIGPIC]

 

Intel Core I7 4820K @4.3 GHz, Asus P9X79 motherboard, 16 GB RAM @ 933 MHz, NVidia GTX 1070 with 8 GB VRAM, Windows 10 Pro

Link to comment
Share on other sites

  • 8 months later...

Try world.searchObjects

http://wiki.hoggit.us/view/Part_1#world

Intelligent discourse can only begin with the honest admission of your own fallibility.

Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/

Lua scripts and mods:

MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616

Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979

Now includes remote server administration tools for kicking, banning, loading missions, etc.

Link to comment
Share on other sites

  • 4 years later...

Nope.

 

world.searchObjects does not retrieve the ejected pilot within the perimiters of the plane ... Only the plane is shown as found.

 

I search using:

 

{ Object.Category.UNIT, Object.Category.STATIC, Object.Category.SCENERY, Object.Category.WEAPON }

----

 

local PilotUnit = nil
   
   self:ScheduleOnce( 1, 
     function()
       
       -- Search for the ejected pilot
   
       local PlaneCoord = PlaneUnit:GetCoordinate()
       
       local SphereSearch = {
        id = world.VolumeType.SPHERE,
         params = {
          point = PlaneCoord:GetVec3(),
          radius = 100,
         }
         
       }
        
       --- @param Dcs.DCSWrapper.Unit#Unit FoundDCSUnit
       -- @param Wrapper.Group#GROUP ReportGroup
       -- @param Set#SET_GROUP ReportSetGroup
       local FindEjectedPilot = function( FoundDCSUnit )
           
         local UnitName = FoundDCSUnit:getName()
           
         self:E( { "Units near Plane:", UnitName } )
         
         PilotUnit = UNIT:Register( UnitName )
         
         return true
       end
       
       world.searchObjects( { Object.Category.UNIT, Object.Category.STATIC, Object.Category.SCENERY, Object.Category.WEAPON }, SphereSearch, FindEjectedPilot )

       self.CSAR[CSARName] = {} 
       self.CSAR[CSARName].PilotUnit = PlaneUnit
       self.CSAR[CSARName].Task = nil
 
     end
   )

 

So I'll just spawn an infantry as a replacement.

Maybe a point for ED to pickup in a future release.

 

Make the ejected pilot a manageable group within the sim ...

 

If anyone can help, by my guest ...

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Link to comment
Share on other sites

  • Recently Browsing   0 members

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