zofo1963 Posted December 26, 2018 Posted December 26, 2018 Hi, Using LoGetWorldObjects in Export.lua to export objects data in LuaExportAfterNextFrame function. Is there a way to detect destroyed or crash objects ?
Nero.ger Posted December 30, 2018 Posted December 30, 2018 depending on what you want to accomplish, the MIST-script libary for the Mission(editor) makes a list of destroyed objects and scenery 'controlling' the Ka50 feels like a discussion with the Autopilot and trim system about the flight direction.
zofo1963 Posted December 30, 2018 Author Posted December 30, 2018 I try two solutions in Export.lua : 1. function getUnitsLife() units={} if coalition~=nil then for _, group in pairs(coalition.getGroups(coalition.side.BLUE)) do for _, unit in pairs(group:getUnits()) do local u={} u.name=unit:getName() u.life=unit:getLife() units[u.name]=u.life end end for _, group in pairs(coalition.getGroups(coalition.side.RED)) do for _, unit in pairs(group:getUnits()) do local u={} u.name=unit:getName() u.life=unit:getLife() units[u.name]=u.life end end end end and retrieve life in LuaExportBeforeNextFrame() objects enumerator (I have the UnitName) but coalition seems to be null in Export.lua 2. Using eventhandler but doesn't work in export.lua DEADHandler = {} function DEADHandler:onEvent(event) if event.id == world.event.S_EVENT_CRASH or event.id == world.event.S_EVENT_DEAD then default_output_file:write(string.format("%s\r\n",event.initiator)) end end world.addEventHandler(DEADHandler) I really don't understand why objects like coalition or world are not available in Export.lua ??
Recommended Posts