The Kill event has been inconsistently firing for me since the patch that changed up Event functionality.
What I see now is the following. In a simple mission with scripting to show each Hit, Kill, and Unit Lost event I get something like the following:
null
Hit and Lost show up for all four targets. However, Kill is only showing up some of the time. Prior to the patch I would always get the Kill event (when a unit is killed by a weapon). Now its inconsistently firing.
The script code is as follows:
EventHandlerHit = EVENTHANDLER:New()
EventHandlerHit:HandleEvent(EVENTS.Hit)
function EventHandlerHit:OnEventHit(EventData)
MESSAGE:New( EventData.TgtUnitName .. " was hit." , 300):ToAll()
end
EventHandlerKill = EVENTHANDLER:New()
EventHandlerKill:HandleEvent(EVENTS.Kill)
function EventHandlerKill:OnEventKill(EventData)
MESSAGE:New( EventData.TgtUnitName .. " was killed." , 300):ToAll()
end
EventHandlerLost = EVENTHANDLER:New()
EventHandlerLost:HandleEvent(EVENTS.UnitLost)
function EventHandlerLost:OnEventUnitLost(EventData)
MESSAGE:New( EventData.IniUnitName .. " was lost." , 300):ToAll()
end
As a side note. I've conducted this particular test several times. The Kill event never shows up for the Flankers. However, it sometimes shows up for the Fencers (though not always). This has happened often enough that I think there is a correlation between the event not firing and the type of aircraft involved.
Mission file is also attached.
LuaEventTesting2.miz