wolle Posted June 4, 2013 Share Posted June 4, 2013 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 More sharing options...
Grimes Posted June 4, 2013 Share Posted June 4, 2013 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 Server, Scripting 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 More sharing options...
wolle Posted June 5, 2013 Author Share Posted June 5, 2013 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 More sharing options...
Grimes Posted June 5, 2013 Share Posted June 5, 2013 Object.getPosition(event.initiator) 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 Link to comment Share on other sites More sharing options...
wolle Posted June 5, 2013 Author Share Posted June 5, 2013 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 More sharing options...
Joyride Posted June 10, 2013 Share Posted June 10, 2013 wolle: have been very interested in this as well. seems like there'd be a way to make it work, but no luck here either. Link to comment Share on other sites More sharing options...
ArturDCS Posted February 23, 2014 Share Posted February 23, 2014 Bump, any more information regarding this? Can I somehow get a reference to the static object [pilot] standing besides the parachute? DCSFlightpanels dcs-insight dcs-bios DCSBIOSBridge BIOSBuddy Link to comment Share on other sites More sharing options...
Speed Posted February 23, 2014 Share Posted February 23, 2014 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 More sharing options...
ArturDCS Posted February 25, 2014 Share Posted February 25, 2014 Try world.searchObjects http://wiki.hoggit.us/view/Part_1#world Yes that could be useful. Can't find any examples though. I am very new to LUA & DCS and unless there are examples I am out in the dark. DCSFlightpanels dcs-insight dcs-bios DCSBIOSBridge BIOSBuddy Link to comment Share on other sites More sharing options...
FlightControl Posted March 31, 2018 Share Posted March 31, 2018 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]| Join MOOSE community on: DISCORD :thumbup: Website of the MOOSE LUA Framework. MOOSE framework Downloads. Check out Example Missions to try out and learn. MOOSE YouTube Channel for live demonstrations and tutorials. [/TABLE] Link to comment Share on other sites More sharing options...
BaD CrC Posted April 1, 2018 Share Posted April 1, 2018 I though the CSAR script was able to handle this? https://www.blacksharkden.com http://discord.gg/blacksharkden Link to comment Share on other sites More sharing options...
Delta99 Posted April 2, 2018 Share Posted April 2, 2018 I though the CSAR script was able to handle this? It just spawns a new unit as far as I know. My Missions: Valley Patrol Mission :: Valley Escort Mission :: A2A Engagements Link to comment Share on other sites More sharing options...
feefifofum Posted April 2, 2018 Share Posted April 2, 2018 Correct, it gets the position at the moment of ejection and spawns a standard infantry unit there. THE GEORGIAN WAR - OFFICIAL F-15C DLC Link to comment Share on other sites More sharing options...
Recommended Posts