Jump to content

zofo1963

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by zofo1963

  1. 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 ??
  2. Hi, Using LoGetWorldObjects in Export.lua to export objects data in LuaExportAfterNextFrame function. Is there a way to detect destroyed or crash objects ?
×
×
  • Create New...