mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge pull request #303 from FlightControl-Master/master-fix-ai-cap
Fixes bug sending messages upon a Destroy event
This commit is contained in:
commit
c53b3cd1e0
@ -340,9 +340,12 @@ function AI_CAP_ZONE:onafterStart( Controllable, From, Event, To )
|
|||||||
|
|
||||||
-- Call the parent Start event handler
|
-- Call the parent Start event handler
|
||||||
self:GetParent(self).onafterStart( self, Controllable, From, Event, To )
|
self:GetParent(self).onafterStart( self, Controllable, From, Event, To )
|
||||||
|
self:HandleEvent( EVENTS.Dead )
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- todo: need to fix this global function
|
||||||
|
|
||||||
--- @param Wrapper.Controllable#CONTROLLABLE AIControllable
|
--- @param Wrapper.Controllable#CONTROLLABLE AIControllable
|
||||||
function _NewEngageCapRoute( AIControllable )
|
function _NewEngageCapRoute( AIControllable )
|
||||||
|
|
||||||
@ -505,14 +508,9 @@ end
|
|||||||
-- @param #string From The From State string.
|
-- @param #string From The From State string.
|
||||||
-- @param #string Event The Event string.
|
-- @param #string Event The Event string.
|
||||||
-- @param #string To The To State string.
|
-- @param #string To The To State string.
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
function AI_CAP_ZONE:onafterAccomplish( Controllable, From, Event, To )
|
||||||
function AI_CAP_ZONE:onafterDestroy( Controllable, From, Event, To, EventData )
|
self.Accomplished = true
|
||||||
|
self:SetDetectionOff()
|
||||||
if EventData.IniUnit then
|
|
||||||
self.DetectedUnits[EventData.IniUnit] = nil
|
|
||||||
end
|
|
||||||
|
|
||||||
Controllable:MessageToAll( "Destroyed a target", 15 , "Destroyed!" )
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_CAP_ZONE self
|
--- @param #AI_CAP_ZONE self
|
||||||
@ -520,9 +518,22 @@ end
|
|||||||
-- @param #string From The From State string.
|
-- @param #string From The From State string.
|
||||||
-- @param #string Event The Event string.
|
-- @param #string Event The Event string.
|
||||||
-- @param #string To The To State string.
|
-- @param #string To The To State string.
|
||||||
function AI_CAP_ZONE:onafterAccomplish( Controllable, From, Event, To )
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
self.Accomplished = true
|
function AI_CAP_ZONE:onafterDestroy( Controllable, From, Event, To, EventData )
|
||||||
self:SetDetectionOff()
|
|
||||||
|
if EventData.IniUnit then
|
||||||
|
self.DetectedUnits[EventData.IniUnit] = nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- @param #AI_CAP_ZONE self
|
||||||
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
|
function AI_CAP_ZONE:OnEventDead( EventData )
|
||||||
|
self:F( { "EventDead", EventData } )
|
||||||
|
|
||||||
|
if EventData.IniDCSUnit then
|
||||||
|
if self.DetectedUnits and self.DetectedUnits[EventData.IniUnit] then
|
||||||
|
self:__Destroy( 1, EventData )
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|||||||
@ -350,7 +350,7 @@ function AI_CAS_ZONE:onafterStart( Controllable, From, Event, To )
|
|||||||
|
|
||||||
-- Call the parent Start event handler
|
-- Call the parent Start event handler
|
||||||
self:GetParent(self).onafterStart( self, Controllable, From, Event, To )
|
self:GetParent(self).onafterStart( self, Controllable, From, Event, To )
|
||||||
self:HandleEvent( EVENTS.Dead, self.OnDead )
|
self:HandleEvent( EVENTS.Dead )
|
||||||
|
|
||||||
self:SetDetectionDeactivated() -- When not engaging, set the detection off.
|
self:SetDetectionDeactivated() -- When not engaging, set the detection off.
|
||||||
end
|
end
|
||||||
@ -534,20 +534,6 @@ function AI_CAS_ZONE:onafterEngage( Controllable, From, Event, To, EngageSpeed,
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_CAS_ZONE self
|
|
||||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
|
||||||
-- @param #string From The From State string.
|
|
||||||
-- @param #string Event The Event string.
|
|
||||||
-- @param #string To The To State string.
|
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
|
||||||
function AI_CAS_ZONE:onafterDestroy( Controllable, From, Event, To, EventData )
|
|
||||||
|
|
||||||
if EventData.IniUnit then
|
|
||||||
self.DetectedUnits[EventData.IniUnit] = nil
|
|
||||||
end
|
|
||||||
|
|
||||||
Controllable:MessageToAll( "Destroyed a target", 15 , "Destroyed!" )
|
|
||||||
end
|
|
||||||
|
|
||||||
--- @param #AI_CAS_ZONE self
|
--- @param #AI_CAS_ZONE self
|
||||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||||
@ -559,13 +545,30 @@ function AI_CAS_ZONE:onafterAccomplish( Controllable, From, Event, To )
|
|||||||
self:SetDetectionDeactivated()
|
self:SetDetectionDeactivated()
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_CAS_ZONE self
|
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
|
||||||
function AI_CAS_ZONE:OnDead( EventData )
|
|
||||||
self:T( { "EventDead", EventData } )
|
|
||||||
|
|
||||||
if EventData.IniDCSUnit then
|
--- @param #AI_CAS_ZONE self
|
||||||
self:__Destroy( 1, EventData )
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||||
|
-- @param #string From The From State string.
|
||||||
|
-- @param #string Event The Event string.
|
||||||
|
-- @param #string To The To State string.
|
||||||
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
|
function AI_CAS_ZONE:onafterDestroy( Controllable, From, Event, To, EventData )
|
||||||
|
|
||||||
|
if EventData.IniUnit then
|
||||||
|
self.DetectedUnits[EventData.IniUnit] = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--- @param #AI_CAS_ZONE self
|
||||||
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
|
function AI_CAS_ZONE:OnEventDead( EventData )
|
||||||
|
self:F( { "EventDead", EventData } )
|
||||||
|
|
||||||
|
if EventData.IniDCSUnit then
|
||||||
|
if self.DetectedUnits and self.DetectedUnits[EventData.IniUnit] then
|
||||||
|
self:__Destroy( 1, EventData )
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
|
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
|
||||||
env.info( 'Moose Generation Timestamp: 20170308_2139' )
|
env.info( 'Moose Generation Timestamp: 20170312_0717' )
|
||||||
local base = _G
|
local base = _G
|
||||||
|
|
||||||
Include = {}
|
Include = {}
|
||||||
@ -10561,6 +10561,7 @@ end
|
|||||||
--
|
--
|
||||||
-- The current X, Altitude, Y axis can be retrieved with the methods @{#POINT_VEC2.GetX}(), @{#POINT_VEC2.GetAlt}(), @{#POINT_VEC2.GetY}() respectively.
|
-- The current X, Altitude, Y axis can be retrieved with the methods @{#POINT_VEC2.GetX}(), @{#POINT_VEC2.GetAlt}(), @{#POINT_VEC2.GetY}() respectively.
|
||||||
-- The methods @{#POINT_VEC2.SetX}(), @{#POINT_VEC2.SetAlt}(), @{#POINT_VEC2.SetY}() change the respective axis with a new value.
|
-- The methods @{#POINT_VEC2.SetX}(), @{#POINT_VEC2.SetAlt}(), @{#POINT_VEC2.SetY}() change the respective axis with a new value.
|
||||||
|
-- The current Lat(itude), Alt(itude), Lon(gitude) values can also be retrieved with the methods @{#POINT_VEC2.GetLat}(), @{#POINT_VEC2.GetAlt}(), @{#POINT_VEC2.GetLon}() respectively.
|
||||||
-- The current axis values can be changed by using the methods @{#POINT_VEC2.AddX}(), @{#POINT_VEC2.AddAlt}(), @{#POINT_VEC2.AddY}()
|
-- The current axis values can be changed by using the methods @{#POINT_VEC2.AddX}(), @{#POINT_VEC2.AddAlt}(), @{#POINT_VEC2.AddY}()
|
||||||
-- to add or substract a value from the current respective axis value.
|
-- to add or substract a value from the current respective axis value.
|
||||||
-- Note that the Set and Add methods return the current POINT_VEC2 object, so these manipulation methods can be chained... For example:
|
-- Note that the Set and Add methods return the current POINT_VEC2 object, so these manipulation methods can be chained... For example:
|
||||||
@ -10844,7 +10845,7 @@ function POINT_VEC3:GetRandomVec3InRadius( OuterRadius, InnerRadius )
|
|||||||
|
|
||||||
local RandomVec2 = self:GetRandomVec2InRadius( OuterRadius, InnerRadius )
|
local RandomVec2 = self:GetRandomVec2InRadius( OuterRadius, InnerRadius )
|
||||||
local y = self:GetY() + math.random( InnerRadius, OuterRadius )
|
local y = self:GetY() + math.random( InnerRadius, OuterRadius )
|
||||||
local RandomVec3 = { x = RandomVec2.x, y = y, z = RandomVec2.z }
|
local RandomVec3 = { x = RandomVec2.x, y = y, z = RandomVec2.y }
|
||||||
|
|
||||||
return RandomVec3
|
return RandomVec3
|
||||||
end
|
end
|
||||||
@ -11010,9 +11011,9 @@ function POINT_VEC3:RoutePointAir( AltType, Type, Action, Speed, SpeedLocked )
|
|||||||
self:F2( { AltType, Type, Action, Speed, SpeedLocked } )
|
self:F2( { AltType, Type, Action, Speed, SpeedLocked } )
|
||||||
|
|
||||||
local RoutePoint = {}
|
local RoutePoint = {}
|
||||||
RoutePoint.x = self:GetX()
|
RoutePoint.x = self.x
|
||||||
RoutePoint.y = self:GetZ()
|
RoutePoint.y = self.z
|
||||||
RoutePoint.alt = self:GetY()
|
RoutePoint.alt = self.y
|
||||||
RoutePoint.alt_type = AltType
|
RoutePoint.alt_type = AltType
|
||||||
|
|
||||||
RoutePoint.type = Type
|
RoutePoint.type = Type
|
||||||
@ -11051,8 +11052,8 @@ function POINT_VEC3:RoutePointGround( Speed, Formation )
|
|||||||
self:F2( { Formation, Speed } )
|
self:F2( { Formation, Speed } )
|
||||||
|
|
||||||
local RoutePoint = {}
|
local RoutePoint = {}
|
||||||
RoutePoint.x = self:GetX()
|
RoutePoint.x = self.x
|
||||||
RoutePoint.y = self:GetZ()
|
RoutePoint.y = self.z
|
||||||
|
|
||||||
RoutePoint.action = Formation or ""
|
RoutePoint.action = Formation or ""
|
||||||
|
|
||||||
@ -11253,13 +11254,27 @@ function POINT_VEC2:GetY()
|
|||||||
return self.z
|
return self.z
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Return the altitude of the land at the POINT_VEC2.
|
--- Return the altitude (height) of the land at the POINT_VEC2.
|
||||||
-- @param #POINT_VEC2 self
|
-- @param #POINT_VEC2 self
|
||||||
-- @return #number The land altitude.
|
-- @return #number The land altitude.
|
||||||
function POINT_VEC2:GetAlt()
|
function POINT_VEC2:GetAlt()
|
||||||
return land.getHeight( { x = self.x, y = self.z } )
|
return land.getHeight( { x = self.x, y = self.z } )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Return Return the Lat(itude) coordinate of the POINT_VEC2 (ie: (parent)POINT_VEC3.x).
|
||||||
|
-- @param #POINT_VEC2 self
|
||||||
|
-- @return #number The x coodinate.
|
||||||
|
function POINT_VEC2:GetLat()
|
||||||
|
return self.x
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Return the Lon(gitude) coordinate of the POINT_VEC2 (ie: (parent)POINT_VEC3.z).
|
||||||
|
-- @param #POINT_VEC2 self
|
||||||
|
-- @return #number The y coodinate.
|
||||||
|
function POINT_VEC2:GetLon()
|
||||||
|
return self.z
|
||||||
|
end
|
||||||
|
|
||||||
--- Set the x coordinate of the POINT_VEC2.
|
--- Set the x coordinate of the POINT_VEC2.
|
||||||
-- @param #POINT_VEC2 self
|
-- @param #POINT_VEC2 self
|
||||||
-- @param #number x The x coordinate.
|
-- @param #number x The x coordinate.
|
||||||
@ -11278,6 +11293,15 @@ function POINT_VEC2:SetY( y )
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Set the Lat(itude) coordinate of the POINT_VEC2 (ie: POINT_VEC3.x).
|
||||||
|
-- @param #POINT_VEC2 self
|
||||||
|
-- @param #number x The x coordinate.
|
||||||
|
-- @return #POINT_VEC2
|
||||||
|
function POINT_VEC2:SetLat( x )
|
||||||
|
self.x = x
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- Set the altitude of the POINT_VEC2.
|
--- Set the altitude of the POINT_VEC2.
|
||||||
-- @param #POINT_VEC2 self
|
-- @param #POINT_VEC2 self
|
||||||
-- @param #number Altitude The land altitude. If nothing (nil) is given, then the current land altitude is set.
|
-- @param #number Altitude The land altitude. If nothing (nil) is given, then the current land altitude is set.
|
||||||
@ -11287,6 +11311,15 @@ function POINT_VEC2:SetAlt( Altitude )
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Set the Lon(gitude) coordinate of the POINT_VEC2 (ie: POINT_VEC3.z).
|
||||||
|
-- @param #POINT_VEC2 self
|
||||||
|
-- @param #number y The y coordinate.
|
||||||
|
-- @return #POINT_VEC2
|
||||||
|
function POINT_VEC2:SetLon( z )
|
||||||
|
self.z = z
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- Add to the x coordinate of the POINT_VEC2.
|
--- Add to the x coordinate of the POINT_VEC2.
|
||||||
-- @param #POINT_VEC2 self
|
-- @param #POINT_VEC2 self
|
||||||
-- @param #number x The x coordinate.
|
-- @param #number x The x coordinate.
|
||||||
@ -27883,7 +27916,7 @@ function AI_CAS_ZONE:onafterStart( Controllable, From, Event, To )
|
|||||||
|
|
||||||
-- Call the parent Start event handler
|
-- Call the parent Start event handler
|
||||||
self:GetParent(self).onafterStart( self, Controllable, From, Event, To )
|
self:GetParent(self).onafterStart( self, Controllable, From, Event, To )
|
||||||
self:HandleEvent( EVENTS.Dead, self.OnDead )
|
self:HandleEvent( EVENTS.Dead )
|
||||||
|
|
||||||
self:SetDetectionDeactivated() -- When not engaging, set the detection off.
|
self:SetDetectionDeactivated() -- When not engaging, set the detection off.
|
||||||
end
|
end
|
||||||
@ -28067,20 +28100,6 @@ function AI_CAS_ZONE:onafterEngage( Controllable, From, Event, To, EngageSpeed,
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_CAS_ZONE self
|
|
||||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
|
||||||
-- @param #string From The From State string.
|
|
||||||
-- @param #string Event The Event string.
|
|
||||||
-- @param #string To The To State string.
|
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
|
||||||
function AI_CAS_ZONE:onafterDestroy( Controllable, From, Event, To, EventData )
|
|
||||||
|
|
||||||
if EventData.IniUnit then
|
|
||||||
self.DetectedUnits[EventData.IniUnit] = nil
|
|
||||||
end
|
|
||||||
|
|
||||||
Controllable:MessageToAll( "Destroyed a target", 15 , "Destroyed!" )
|
|
||||||
end
|
|
||||||
|
|
||||||
--- @param #AI_CAS_ZONE self
|
--- @param #AI_CAS_ZONE self
|
||||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||||
@ -28092,13 +28111,30 @@ function AI_CAS_ZONE:onafterAccomplish( Controllable, From, Event, To )
|
|||||||
self:SetDetectionDeactivated()
|
self:SetDetectionDeactivated()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--- @param #AI_CAS_ZONE self
|
||||||
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||||
|
-- @param #string From The From State string.
|
||||||
|
-- @param #string Event The Event string.
|
||||||
|
-- @param #string To The To State string.
|
||||||
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
|
function AI_CAS_ZONE:onafterDestroy( Controllable, From, Event, To, EventData )
|
||||||
|
|
||||||
|
if EventData.IniUnit then
|
||||||
|
self.DetectedUnits[EventData.IniUnit] = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_CAS_ZONE self
|
--- @param #AI_CAS_ZONE self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function AI_CAS_ZONE:OnDead( EventData )
|
function AI_CAS_ZONE:OnEventDead( EventData )
|
||||||
self:T( { "EventDead", EventData } )
|
self:F( { "EventDead", EventData } )
|
||||||
|
|
||||||
if EventData.IniDCSUnit then
|
if EventData.IniDCSUnit then
|
||||||
self:__Destroy( 1, EventData )
|
if self.DetectedUnits and self.DetectedUnits[EventData.IniUnit] then
|
||||||
|
self:__Destroy( 1, EventData )
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -28445,9 +28481,12 @@ function AI_CAP_ZONE:onafterStart( Controllable, From, Event, To )
|
|||||||
|
|
||||||
-- Call the parent Start event handler
|
-- Call the parent Start event handler
|
||||||
self:GetParent(self).onafterStart( self, Controllable, From, Event, To )
|
self:GetParent(self).onafterStart( self, Controllable, From, Event, To )
|
||||||
|
self:HandleEvent( EVENTS.Dead )
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- todo: need to fix this global function
|
||||||
|
|
||||||
--- @param Wrapper.Controllable#CONTROLLABLE AIControllable
|
--- @param Wrapper.Controllable#CONTROLLABLE AIControllable
|
||||||
function _NewEngageCapRoute( AIControllable )
|
function _NewEngageCapRoute( AIControllable )
|
||||||
|
|
||||||
@ -28610,14 +28649,9 @@ end
|
|||||||
-- @param #string From The From State string.
|
-- @param #string From The From State string.
|
||||||
-- @param #string Event The Event string.
|
-- @param #string Event The Event string.
|
||||||
-- @param #string To The To State string.
|
-- @param #string To The To State string.
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
function AI_CAP_ZONE:onafterAccomplish( Controllable, From, Event, To )
|
||||||
function AI_CAP_ZONE:onafterDestroy( Controllable, From, Event, To, EventData )
|
self.Accomplished = true
|
||||||
|
self:SetDetectionOff()
|
||||||
if EventData.IniUnit then
|
|
||||||
self.DetectedUnits[EventData.IniUnit] = nil
|
|
||||||
end
|
|
||||||
|
|
||||||
Controllable:MessageToAll( "Destroyed a target", 15 , "Destroyed!" )
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_CAP_ZONE self
|
--- @param #AI_CAP_ZONE self
|
||||||
@ -28625,12 +28659,25 @@ end
|
|||||||
-- @param #string From The From State string.
|
-- @param #string From The From State string.
|
||||||
-- @param #string Event The Event string.
|
-- @param #string Event The Event string.
|
||||||
-- @param #string To The To State string.
|
-- @param #string To The To State string.
|
||||||
function AI_CAP_ZONE:onafterAccomplish( Controllable, From, Event, To )
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
self.Accomplished = true
|
function AI_CAP_ZONE:onafterDestroy( Controllable, From, Event, To, EventData )
|
||||||
self:SetDetectionOff()
|
|
||||||
|
if EventData.IniUnit then
|
||||||
|
self.DetectedUnits[EventData.IniUnit] = nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- @param #AI_CAP_ZONE self
|
||||||
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
|
function AI_CAP_ZONE:OnEventDead( EventData )
|
||||||
|
self:F( { "EventDead", EventData } )
|
||||||
|
|
||||||
|
if EventData.IniDCSUnit then
|
||||||
|
if self.DetectedUnits and self.DetectedUnits[EventData.IniUnit] then
|
||||||
|
self:__Destroy( 1, EventData )
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
---Single-Player:**Yes** / Multi-Player:**Yes** / AI:**Yes** / Human:**No** / Types:**Ground** --
|
---Single-Player:**Yes** / Multi-Player:**Yes** / AI:**Yes** / Human:**No** / Types:**Ground** --
|
||||||
-- **Management of logical cargo objects, that can be transported from and to transportation carriers.**
|
-- **Management of logical cargo objects, that can be transported from and to transportation carriers.**
|
||||||
--
|
--
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
|
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
|
||||||
env.info( 'Moose Generation Timestamp: 20170309_1200EST' )
|
env.info( 'Moose Generation Timestamp: 20170312_0717' )
|
||||||
local base = _G
|
local base = _G
|
||||||
|
|
||||||
Include = {}
|
Include = {}
|
||||||
@ -27916,7 +27916,7 @@ function AI_CAS_ZONE:onafterStart( Controllable, From, Event, To )
|
|||||||
|
|
||||||
-- Call the parent Start event handler
|
-- Call the parent Start event handler
|
||||||
self:GetParent(self).onafterStart( self, Controllable, From, Event, To )
|
self:GetParent(self).onafterStart( self, Controllable, From, Event, To )
|
||||||
self:HandleEvent( EVENTS.Dead, self.OnDead )
|
self:HandleEvent( EVENTS.Dead )
|
||||||
|
|
||||||
self:SetDetectionDeactivated() -- When not engaging, set the detection off.
|
self:SetDetectionDeactivated() -- When not engaging, set the detection off.
|
||||||
end
|
end
|
||||||
@ -28100,20 +28100,6 @@ function AI_CAS_ZONE:onafterEngage( Controllable, From, Event, To, EngageSpeed,
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_CAS_ZONE self
|
|
||||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
|
||||||
-- @param #string From The From State string.
|
|
||||||
-- @param #string Event The Event string.
|
|
||||||
-- @param #string To The To State string.
|
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
|
||||||
function AI_CAS_ZONE:onafterDestroy( Controllable, From, Event, To, EventData )
|
|
||||||
|
|
||||||
if EventData.IniUnit then
|
|
||||||
self.DetectedUnits[EventData.IniUnit] = nil
|
|
||||||
end
|
|
||||||
|
|
||||||
Controllable:MessageToAll( "Destroyed a target", 15 , "Destroyed!" )
|
|
||||||
end
|
|
||||||
|
|
||||||
--- @param #AI_CAS_ZONE self
|
--- @param #AI_CAS_ZONE self
|
||||||
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||||
@ -28125,13 +28111,30 @@ function AI_CAS_ZONE:onafterAccomplish( Controllable, From, Event, To )
|
|||||||
self:SetDetectionDeactivated()
|
self:SetDetectionDeactivated()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--- @param #AI_CAS_ZONE self
|
||||||
|
-- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM.
|
||||||
|
-- @param #string From The From State string.
|
||||||
|
-- @param #string Event The Event string.
|
||||||
|
-- @param #string To The To State string.
|
||||||
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
|
function AI_CAS_ZONE:onafterDestroy( Controllable, From, Event, To, EventData )
|
||||||
|
|
||||||
|
if EventData.IniUnit then
|
||||||
|
self.DetectedUnits[EventData.IniUnit] = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
--- @param #AI_CAS_ZONE self
|
--- @param #AI_CAS_ZONE self
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
function AI_CAS_ZONE:OnDead( EventData )
|
function AI_CAS_ZONE:OnEventDead( EventData )
|
||||||
self:T( { "EventDead", EventData } )
|
self:F( { "EventDead", EventData } )
|
||||||
|
|
||||||
if EventData.IniDCSUnit then
|
if EventData.IniDCSUnit then
|
||||||
self:__Destroy( 1, EventData )
|
if self.DetectedUnits and self.DetectedUnits[EventData.IniUnit] then
|
||||||
|
self:__Destroy( 1, EventData )
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -28478,9 +28481,12 @@ function AI_CAP_ZONE:onafterStart( Controllable, From, Event, To )
|
|||||||
|
|
||||||
-- Call the parent Start event handler
|
-- Call the parent Start event handler
|
||||||
self:GetParent(self).onafterStart( self, Controllable, From, Event, To )
|
self:GetParent(self).onafterStart( self, Controllable, From, Event, To )
|
||||||
|
self:HandleEvent( EVENTS.Dead )
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- todo: need to fix this global function
|
||||||
|
|
||||||
--- @param Wrapper.Controllable#CONTROLLABLE AIControllable
|
--- @param Wrapper.Controllable#CONTROLLABLE AIControllable
|
||||||
function _NewEngageCapRoute( AIControllable )
|
function _NewEngageCapRoute( AIControllable )
|
||||||
|
|
||||||
@ -28643,14 +28649,9 @@ end
|
|||||||
-- @param #string From The From State string.
|
-- @param #string From The From State string.
|
||||||
-- @param #string Event The Event string.
|
-- @param #string Event The Event string.
|
||||||
-- @param #string To The To State string.
|
-- @param #string To The To State string.
|
||||||
-- @param Core.Event#EVENTDATA EventData
|
function AI_CAP_ZONE:onafterAccomplish( Controllable, From, Event, To )
|
||||||
function AI_CAP_ZONE:onafterDestroy( Controllable, From, Event, To, EventData )
|
self.Accomplished = true
|
||||||
|
self:SetDetectionOff()
|
||||||
if EventData.IniUnit then
|
|
||||||
self.DetectedUnits[EventData.IniUnit] = nil
|
|
||||||
end
|
|
||||||
|
|
||||||
Controllable:MessageToAll( "Destroyed a target", 15 , "Destroyed!" )
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- @param #AI_CAP_ZONE self
|
--- @param #AI_CAP_ZONE self
|
||||||
@ -28658,12 +28659,25 @@ end
|
|||||||
-- @param #string From The From State string.
|
-- @param #string From The From State string.
|
||||||
-- @param #string Event The Event string.
|
-- @param #string Event The Event string.
|
||||||
-- @param #string To The To State string.
|
-- @param #string To The To State string.
|
||||||
function AI_CAP_ZONE:onafterAccomplish( Controllable, From, Event, To )
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
self.Accomplished = true
|
function AI_CAP_ZONE:onafterDestroy( Controllable, From, Event, To, EventData )
|
||||||
self:SetDetectionOff()
|
|
||||||
|
if EventData.IniUnit then
|
||||||
|
self.DetectedUnits[EventData.IniUnit] = nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- @param #AI_CAP_ZONE self
|
||||||
|
-- @param Core.Event#EVENTDATA EventData
|
||||||
|
function AI_CAP_ZONE:OnEventDead( EventData )
|
||||||
|
self:F( { "EventDead", EventData } )
|
||||||
|
|
||||||
|
if EventData.IniDCSUnit then
|
||||||
|
if self.DetectedUnits and self.DetectedUnits[EventData.IniUnit] then
|
||||||
|
self:__Destroy( 1, EventData )
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
---Single-Player:**Yes** / Multi-Player:**Yes** / AI:**Yes** / Human:**No** / Types:**Ground** --
|
---Single-Player:**Yes** / Multi-Player:**Yes** / AI:**Yes** / Human:**No** / Types:**Ground** --
|
||||||
-- **Management of logical cargo objects, that can be transported from and to transportation carriers.**
|
-- **Management of logical cargo objects, that can be transported from and to transportation carriers.**
|
||||||
--
|
--
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user