Merge pull request #285 from FlightControl-Master/master-bugfix

New test mission to test OnEventHit for a SET_UNIT...
This commit is contained in:
Sven Van de Velde 2017-03-06 16:38:36 +01:00 committed by GitHub
commit 3a847fed9b
6 changed files with 34 additions and 5 deletions

View File

@ -492,7 +492,7 @@ function AI_CAS_ZONE:onafterEngage( Controllable, From, Event, To, EngageSpeed,
true true
) )
ToTargetPointVec3:SmokeBlue() --ToTargetPointVec3:SmokeBlue()
EngageRoute[#EngageRoute+1] = ToTargetRoutePoint EngageRoute[#EngageRoute+1] = ToTargetRoutePoint

View File

@ -1,5 +1,5 @@
env.info( '*** MOOSE STATIC INCLUDE START *** ' ) env.info( '*** MOOSE STATIC INCLUDE START *** ' )
env.info( 'Moose Generation Timestamp: 20170306_1142' ) env.info( 'Moose Generation Timestamp: 20170306_1631' )
local base = _G local base = _G
Include = {} Include = {}
@ -27817,7 +27817,7 @@ function AI_CAS_ZONE:onafterEngage( Controllable, From, Event, To, EngageSpeed,
true true
) )
ToTargetPointVec3:SmokeBlue() --ToTargetPointVec3:SmokeBlue()
EngageRoute[#EngageRoute+1] = ToTargetRoutePoint EngageRoute[#EngageRoute+1] = ToTargetRoutePoint

View File

@ -1,5 +1,5 @@
env.info( '*** MOOSE STATIC INCLUDE START *** ' ) env.info( '*** MOOSE STATIC INCLUDE START *** ' )
env.info( 'Moose Generation Timestamp: 20170306_1142' ) env.info( 'Moose Generation Timestamp: 20170306_1631' )
local base = _G local base = _G
Include = {} Include = {}
@ -27817,7 +27817,7 @@ function AI_CAS_ZONE:onafterEngage( Controllable, From, Event, To, EngageSpeed,
true true
) )
ToTargetPointVec3:SmokeBlue() --ToTargetPointVec3:SmokeBlue()
EngageRoute[#EngageRoute+1] = ToTargetRoutePoint EngageRoute[#EngageRoute+1] = ToTargetRoutePoint

View File

@ -0,0 +1,29 @@
---
-- Name: EVT-600 - OnEventHit Example with a Set of Units
-- Author: FlightControl
-- Date Created: 6 Mar 2017
--
-- # Situation:
--
-- A plane is flying in the air and shoots an missile to a ground target.
-- It will shoot a couple of tanks units that are part of a Set.
--
-- # Test cases:
--
-- 1. Observe the plane shooting the missile.
-- 2. Observe when the plane hits a tank, a dcs.log entry is written in the logging.
-- 4. Observe the tanks hitting the targets and the messages appear.
-- 3. Check the contents of the fields of the S_EVENT_HIT entries.
local Plane = UNIT:FindByName( "Plane" )
local UnitSet = SET_UNIT:New():FilterPrefixes( "Tank" ):FilterStart()
UnitSet:HandleEvent( EVENTS.Hit )
function UnitSet:OnEventHit( EventData )
Plane:MessageToAll( "I just hit a tank! " .. EventData.IniUnit:GetName(), 15, "Alert!" )
end