diff --git a/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua b/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua index 764affad3..f3e4a7dbe 100644 --- a/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua +++ b/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua @@ -1,5 +1,5 @@ env.info( '*** MOOSE STATIC INCLUDE START *** ' ) -env.info( 'Moose Generation Timestamp: 20170119_1944' ) +env.info( 'Moose Generation Timestamp: 20170120_1818' ) local base = _G Include = {} @@ -24683,7 +24683,7 @@ end --- Single-Player:**Yes** / Mulit-Player:**Yes** / AI:**Yes** / Human:**No** / Types:**Air** -- **Air Patrolling or Staging.** -- --- ![Banner Image](..\Presentations\AI_Patrol\Dia1.JPG) +-- ![Banner Image](..\Presentations\AI_PATROL\Dia1.JPG) -- -- -- === @@ -24692,34 +24692,34 @@ end -- -- The @{#AI_PATROL_ZONE} class implements the core functions to patrol a @{Zone} by an AI @{Controllable} or @{Group}. -- --- ![Process](..\Presentations\AI_Patrol\Dia3.JPG) +-- ![Process](..\Presentations\AI_PATROL\Dia3.JPG) -- -- The AI_PATROL_ZONE is assigned a @{Group} and this must be done before the AI_PATROL_ZONE process can be started using the **Start** event. -- --- ![Process](..\Presentations\AI_Patrol\Dia4.JPG) +-- ![Process](..\Presentations\AI_PATROL\Dia4.JPG) -- -- The AI will fly towards the random 3D point within the patrol zone, using a random speed within the given altitude and speed limits. -- Upon arrival at the 3D point, a new random 3D point will be selected within the patrol zone using the given limits. -- --- ![Process](..\Presentations\AI_Patrol\Dia5.JPG) +-- ![Process](..\Presentations\AI_PATROL\Dia5.JPG) -- -- This cycle will continue. -- --- ![Process](..\Presentations\AI_Patrol\Dia6.JPG) +-- ![Process](..\Presentations\AI_PATROL\Dia6.JPG) -- -- During the patrol, the AI will detect enemy targets, which are reported through the **Detected** event. -- --- ![Process](..\Presentations\AI_Patrol\Dia9.JPG) +-- ![Process](..\Presentations\AI_PATROL\Dia9.JPG) -- ---- Note that the enemy is not engaged! To model enemy engagement, either tailor the **Detected** event, or -- use derived AI_ classes to model AI offensive or defensive behaviour. -- --- ![Process](..\Presentations\AI_Patrol\Dia10.JPG) +-- ![Process](..\Presentations\AI_PATROL\Dia10.JPG) -- -- Until a fuel or damage treshold has been reached by the AI, or when the AI is commanded to RTB. -- When the fuel treshold has been reached, the airplane will fly towards the nearest friendly airbase and will land. -- --- ![Process](..\Presentations\AI_Patrol\Dia11.JPG) +-- ![Process](..\Presentations\AI_PATROL\Dia11.JPG) -- -- ## 1.1) AI_PATROL_ZONE constructor -- @@ -24727,7 +24727,7 @@ end -- -- ## 1.2) AI_PATROL_ZONE is a FSM -- --- ![Process](..\Presentations\AI_Patrol\Dia2.JPG) +-- ![Process](..\Presentations\AI_PATROL\Dia2.JPG) -- -- ### 1.2.1) AI_PATROL_ZONE States -- @@ -25556,7 +25556,7 @@ end --- Single-Player:**Yes** / Mulit-Player:**Yes** / AI:**Yes** / Human:**No** / Types:**Air** -- **Provide Close Air Support to friendly ground troops.** -- --- ![Banner Image](..\Presentations\AI_Cas\Dia1.JPG) +-- ![Banner Image](..\Presentations\AI_CAS\Dia1.JPG) -- -- -- === @@ -25568,35 +25568,35 @@ end -- The @{#AI_CAS_ZONE} class implements the core functions to provide Close Air Support in an Engage @{Zone} by an AIR @{Controllable} or @{Group}. -- The AI_CAS_ZONE runs a process. It holds an AI in a Patrol Zone and when the AI is commanded to engage, it will fly to an Engage Zone. -- --- ![HoldAndEngage](..\Presentations\AI_Cas\Dia3.JPG) +-- ![HoldAndEngage](..\Presentations\AI_CAS\Dia3.JPG) -- -- The AI_CAS_ZONE is assigned a @{Group} and this must be done before the AI_CAS_ZONE process can be started through the **Start** event. -- --- ![Start Event](..\Presentations\AI_Cas\Dia4.JPG) +-- ![Start Event](..\Presentations\AI_CAS\Dia4.JPG) -- -- Upon started, The AI will **Route** itself towards the random 3D point within a patrol zone, -- using a random speed within the given altitude and speed limits. -- Upon arrival at the 3D point, a new random 3D point will be selected within the patrol zone using the given limits. -- This cycle will continue until a fuel or damage treshold has been reached by the AI, or when the AI is commanded to RTB. -- --- ![Route Event](..\Presentations\AI_Cas\Dia5.JPG) +-- ![Route Event](..\Presentations\AI_CAS\Dia5.JPG) -- -- When the AI is commanded to provide Close Air Support (through the event **Engage**), the AI will fly towards the Engage Zone. -- Any target that is detected in the Engage Zone will be reported and will be destroyed by the AI. -- --- ![Engage Event](..\Presentations\AI_Cas\Dia6.JPG) +-- ![Engage Event](..\Presentations\AI_CAS\Dia6.JPG) -- -- The AI will detect the targets and will only destroy the targets within the Engage Zone. -- --- ![Engage Event](..\Presentations\AI_Cas\Dia7.JPG) +-- ![Engage Event](..\Presentations\AI_CAS\Dia7.JPG) -- -- Every target that is destroyed, is reported< by the AI. -- --- ![Engage Event](..\Presentations\AI_Cas\Dia8.JPG) +-- ![Engage Event](..\Presentations\AI_CAS\Dia8.JPG) -- -- Note that the AI does not know when the Engage Zone is cleared, and therefore will keep circling in the zone. -- --- ![Engage Event](..\Presentations\AI_Cas\Dia9.JPG) +-- ![Engage Event](..\Presentations\AI_CAS\Dia9.JPG) -- -- Until it is notified through the event **Accomplish**, which is to be triggered by an observing party: -- @@ -25606,18 +25606,18 @@ end -- * a condition -- * others ... -- --- ![Engage Event](..\Presentations\AI_Cas\Dia10.JPG) +-- ![Engage Event](..\Presentations\AI_CAS\Dia10.JPG) -- -- When the AI has accomplished the CAS, it will fly back to the Patrol Zone. -- --- ![Engage Event](..\Presentations\AI_Cas\Dia11.JPG) +-- ![Engage Event](..\Presentations\AI_CAS\Dia11.JPG) -- -- It will keep patrolling there, until it is notified to RTB or move to another CAS Zone. -- It can be notified to go RTB through the **RTB** event. -- -- When the fuel treshold has been reached, the airplane will fly towards the nearest friendly airbase and will land. -- --- ![Engage Event](..\Presentations\AI_Cas\Dia12.JPG) +-- ![Engage Event](..\Presentations\AI_CAS\Dia12.JPG) -- -- # 1.1) AI_CAS_ZONE constructor -- @@ -25625,7 +25625,7 @@ end -- -- ## 1.2) AI_CAS_ZONE is a FSM -- --- ![Process](..\Presentations\AI_Cas\Dia2.JPG) +-- ![Process](..\Presentations\AI_CAS\Dia2.JPG) -- -- ### 1.2.1) AI_CAS_ZONE States -- @@ -26072,43 +26072,43 @@ end --- Single-Player:**Yes** / Mulit-Player:**Yes** / AI:**Yes** / Human:**No** / Types:**Air** -- **Execute Combat Air Patrol (CAP).** -- --- ![Banner Image](..\Presentations\AI_Cap\Dia1.JPG) +-- ![Banner Image](..\Presentations\AI_CAP\Dia1.JPG) -- -- -- === -- --- # 1) @{#AI_CAP_ZONE} class, extends @{AI.AI_Cap#AI_PATROL_ZONE} +-- # 1) @{#AI_CAP_ZONE} class, extends @{AI.AI_CAP#AI_PATROL_ZONE} -- -- The @{#AI_CAP_ZONE} class implements the core functions to patrol a @{Zone} by an AI @{Controllable} or @{Group} -- and automatically engage any airborne enemies that are within a certain range or within a certain zone. -- --- ![Process](..\Presentations\AI_Cap\Dia3.JPG) +-- ![Process](..\Presentations\AI_CAP\Dia3.JPG) -- -- The AI_CAP_ZONE is assigned a @{Group} and this must be done before the AI_CAP_ZONE process can be started using the **Start** event. -- --- ![Process](..\Presentations\AI_Cap\Dia4.JPG) +-- ![Process](..\Presentations\AI_CAP\Dia4.JPG) -- -- The AI will fly towards the random 3D point within the patrol zone, using a random speed within the given altitude and speed limits. -- Upon arrival at the 3D point, a new random 3D point will be selected within the patrol zone using the given limits. -- --- ![Process](..\Presentations\AI_Cap\Dia5.JPG) +-- ![Process](..\Presentations\AI_CAP\Dia5.JPG) -- -- This cycle will continue. -- --- ![Process](..\Presentations\AI_Cap\Dia6.JPG) +-- ![Process](..\Presentations\AI_CAP\Dia6.JPG) -- -- During the patrol, the AI will detect enemy targets, which are reported through the **Detected** event. -- --- ![Process](..\Presentations\AI_Cap\Dia9.JPG) +-- ![Process](..\Presentations\AI_CAP\Dia9.JPG) -- -- When enemies are detected, the AI will automatically engage the enemy. -- --- ![Process](..\Presentations\AI_Cap\Dia10.JPG) +-- ![Process](..\Presentations\AI_CAP\Dia10.JPG) -- -- Until a fuel or damage treshold has been reached by the AI, or when the AI is commanded to RTB. -- When the fuel treshold has been reached, the airplane will fly towards the nearest friendly airbase and will land. -- --- ![Process](..\Presentations\AI_Cap\Dia13.JPG) +-- ![Process](..\Presentations\AI_CAP\Dia13.JPG) -- -- ## 1.1) AI_CAP_ZONE constructor -- @@ -26116,7 +26116,7 @@ end -- -- ## 1.2) AI_CAP_ZONE is a FSM -- --- ![Process](..\Presentations\AI_Cap\Dia2.JPG) +-- ![Process](..\Presentations\AI_CAP\Dia2.JPG) -- -- ### 1.2.1) AI_CAP_ZONE States -- @@ -26137,17 +26137,17 @@ end -- -- ## 1.3) Set the Range of Engagement -- --- ![Range](..\Presentations\AI_Cap\Dia11.JPG) +-- ![Range](..\Presentations\AI_CAP\Dia11.JPG) -- -- An optional range can be set in meters, -- that will define when the AI will engage with the detected airborne enemy targets. -- The range can be beyond or smaller than the range of the Patrol Zone. -- The range is applied at the position of the AI. --- Use the method @{AI.AI_Cap#AI_CAP_ZONE.SetEngageRange}() to define that range. +-- Use the method @{AI.AI_CAP#AI_CAP_ZONE.SetEngageRange}() to define that range. -- -- ## 1.4) Set the Zone of Engagement -- --- ![Zone](..\Presentations\AI_Cap\Dia12.JPG) +-- ![Zone](..\Presentations\AI_CAP\Dia12.JPG) -- -- An optional @{Zone} can be set, -- that will define when the AI will engage with the detected airborne enemy targets. diff --git a/Moose Mission Setup/Moose.lua b/Moose Mission Setup/Moose.lua index 764affad3..f3e4a7dbe 100644 --- a/Moose Mission Setup/Moose.lua +++ b/Moose Mission Setup/Moose.lua @@ -1,5 +1,5 @@ env.info( '*** MOOSE STATIC INCLUDE START *** ' ) -env.info( 'Moose Generation Timestamp: 20170119_1944' ) +env.info( 'Moose Generation Timestamp: 20170120_1818' ) local base = _G Include = {} @@ -24683,7 +24683,7 @@ end --- Single-Player:**Yes** / Mulit-Player:**Yes** / AI:**Yes** / Human:**No** / Types:**Air** -- **Air Patrolling or Staging.** -- --- ![Banner Image](..\Presentations\AI_Patrol\Dia1.JPG) +-- ![Banner Image](..\Presentations\AI_PATROL\Dia1.JPG) -- -- -- === @@ -24692,34 +24692,34 @@ end -- -- The @{#AI_PATROL_ZONE} class implements the core functions to patrol a @{Zone} by an AI @{Controllable} or @{Group}. -- --- ![Process](..\Presentations\AI_Patrol\Dia3.JPG) +-- ![Process](..\Presentations\AI_PATROL\Dia3.JPG) -- -- The AI_PATROL_ZONE is assigned a @{Group} and this must be done before the AI_PATROL_ZONE process can be started using the **Start** event. -- --- ![Process](..\Presentations\AI_Patrol\Dia4.JPG) +-- ![Process](..\Presentations\AI_PATROL\Dia4.JPG) -- -- The AI will fly towards the random 3D point within the patrol zone, using a random speed within the given altitude and speed limits. -- Upon arrival at the 3D point, a new random 3D point will be selected within the patrol zone using the given limits. -- --- ![Process](..\Presentations\AI_Patrol\Dia5.JPG) +-- ![Process](..\Presentations\AI_PATROL\Dia5.JPG) -- -- This cycle will continue. -- --- ![Process](..\Presentations\AI_Patrol\Dia6.JPG) +-- ![Process](..\Presentations\AI_PATROL\Dia6.JPG) -- -- During the patrol, the AI will detect enemy targets, which are reported through the **Detected** event. -- --- ![Process](..\Presentations\AI_Patrol\Dia9.JPG) +-- ![Process](..\Presentations\AI_PATROL\Dia9.JPG) -- ---- Note that the enemy is not engaged! To model enemy engagement, either tailor the **Detected** event, or -- use derived AI_ classes to model AI offensive or defensive behaviour. -- --- ![Process](..\Presentations\AI_Patrol\Dia10.JPG) +-- ![Process](..\Presentations\AI_PATROL\Dia10.JPG) -- -- Until a fuel or damage treshold has been reached by the AI, or when the AI is commanded to RTB. -- When the fuel treshold has been reached, the airplane will fly towards the nearest friendly airbase and will land. -- --- ![Process](..\Presentations\AI_Patrol\Dia11.JPG) +-- ![Process](..\Presentations\AI_PATROL\Dia11.JPG) -- -- ## 1.1) AI_PATROL_ZONE constructor -- @@ -24727,7 +24727,7 @@ end -- -- ## 1.2) AI_PATROL_ZONE is a FSM -- --- ![Process](..\Presentations\AI_Patrol\Dia2.JPG) +-- ![Process](..\Presentations\AI_PATROL\Dia2.JPG) -- -- ### 1.2.1) AI_PATROL_ZONE States -- @@ -25556,7 +25556,7 @@ end --- Single-Player:**Yes** / Mulit-Player:**Yes** / AI:**Yes** / Human:**No** / Types:**Air** -- **Provide Close Air Support to friendly ground troops.** -- --- ![Banner Image](..\Presentations\AI_Cas\Dia1.JPG) +-- ![Banner Image](..\Presentations\AI_CAS\Dia1.JPG) -- -- -- === @@ -25568,35 +25568,35 @@ end -- The @{#AI_CAS_ZONE} class implements the core functions to provide Close Air Support in an Engage @{Zone} by an AIR @{Controllable} or @{Group}. -- The AI_CAS_ZONE runs a process. It holds an AI in a Patrol Zone and when the AI is commanded to engage, it will fly to an Engage Zone. -- --- ![HoldAndEngage](..\Presentations\AI_Cas\Dia3.JPG) +-- ![HoldAndEngage](..\Presentations\AI_CAS\Dia3.JPG) -- -- The AI_CAS_ZONE is assigned a @{Group} and this must be done before the AI_CAS_ZONE process can be started through the **Start** event. -- --- ![Start Event](..\Presentations\AI_Cas\Dia4.JPG) +-- ![Start Event](..\Presentations\AI_CAS\Dia4.JPG) -- -- Upon started, The AI will **Route** itself towards the random 3D point within a patrol zone, -- using a random speed within the given altitude and speed limits. -- Upon arrival at the 3D point, a new random 3D point will be selected within the patrol zone using the given limits. -- This cycle will continue until a fuel or damage treshold has been reached by the AI, or when the AI is commanded to RTB. -- --- ![Route Event](..\Presentations\AI_Cas\Dia5.JPG) +-- ![Route Event](..\Presentations\AI_CAS\Dia5.JPG) -- -- When the AI is commanded to provide Close Air Support (through the event **Engage**), the AI will fly towards the Engage Zone. -- Any target that is detected in the Engage Zone will be reported and will be destroyed by the AI. -- --- ![Engage Event](..\Presentations\AI_Cas\Dia6.JPG) +-- ![Engage Event](..\Presentations\AI_CAS\Dia6.JPG) -- -- The AI will detect the targets and will only destroy the targets within the Engage Zone. -- --- ![Engage Event](..\Presentations\AI_Cas\Dia7.JPG) +-- ![Engage Event](..\Presentations\AI_CAS\Dia7.JPG) -- -- Every target that is destroyed, is reported< by the AI. -- --- ![Engage Event](..\Presentations\AI_Cas\Dia8.JPG) +-- ![Engage Event](..\Presentations\AI_CAS\Dia8.JPG) -- -- Note that the AI does not know when the Engage Zone is cleared, and therefore will keep circling in the zone. -- --- ![Engage Event](..\Presentations\AI_Cas\Dia9.JPG) +-- ![Engage Event](..\Presentations\AI_CAS\Dia9.JPG) -- -- Until it is notified through the event **Accomplish**, which is to be triggered by an observing party: -- @@ -25606,18 +25606,18 @@ end -- * a condition -- * others ... -- --- ![Engage Event](..\Presentations\AI_Cas\Dia10.JPG) +-- ![Engage Event](..\Presentations\AI_CAS\Dia10.JPG) -- -- When the AI has accomplished the CAS, it will fly back to the Patrol Zone. -- --- ![Engage Event](..\Presentations\AI_Cas\Dia11.JPG) +-- ![Engage Event](..\Presentations\AI_CAS\Dia11.JPG) -- -- It will keep patrolling there, until it is notified to RTB or move to another CAS Zone. -- It can be notified to go RTB through the **RTB** event. -- -- When the fuel treshold has been reached, the airplane will fly towards the nearest friendly airbase and will land. -- --- ![Engage Event](..\Presentations\AI_Cas\Dia12.JPG) +-- ![Engage Event](..\Presentations\AI_CAS\Dia12.JPG) -- -- # 1.1) AI_CAS_ZONE constructor -- @@ -25625,7 +25625,7 @@ end -- -- ## 1.2) AI_CAS_ZONE is a FSM -- --- ![Process](..\Presentations\AI_Cas\Dia2.JPG) +-- ![Process](..\Presentations\AI_CAS\Dia2.JPG) -- -- ### 1.2.1) AI_CAS_ZONE States -- @@ -26072,43 +26072,43 @@ end --- Single-Player:**Yes** / Mulit-Player:**Yes** / AI:**Yes** / Human:**No** / Types:**Air** -- **Execute Combat Air Patrol (CAP).** -- --- ![Banner Image](..\Presentations\AI_Cap\Dia1.JPG) +-- ![Banner Image](..\Presentations\AI_CAP\Dia1.JPG) -- -- -- === -- --- # 1) @{#AI_CAP_ZONE} class, extends @{AI.AI_Cap#AI_PATROL_ZONE} +-- # 1) @{#AI_CAP_ZONE} class, extends @{AI.AI_CAP#AI_PATROL_ZONE} -- -- The @{#AI_CAP_ZONE} class implements the core functions to patrol a @{Zone} by an AI @{Controllable} or @{Group} -- and automatically engage any airborne enemies that are within a certain range or within a certain zone. -- --- ![Process](..\Presentations\AI_Cap\Dia3.JPG) +-- ![Process](..\Presentations\AI_CAP\Dia3.JPG) -- -- The AI_CAP_ZONE is assigned a @{Group} and this must be done before the AI_CAP_ZONE process can be started using the **Start** event. -- --- ![Process](..\Presentations\AI_Cap\Dia4.JPG) +-- ![Process](..\Presentations\AI_CAP\Dia4.JPG) -- -- The AI will fly towards the random 3D point within the patrol zone, using a random speed within the given altitude and speed limits. -- Upon arrival at the 3D point, a new random 3D point will be selected within the patrol zone using the given limits. -- --- ![Process](..\Presentations\AI_Cap\Dia5.JPG) +-- ![Process](..\Presentations\AI_CAP\Dia5.JPG) -- -- This cycle will continue. -- --- ![Process](..\Presentations\AI_Cap\Dia6.JPG) +-- ![Process](..\Presentations\AI_CAP\Dia6.JPG) -- -- During the patrol, the AI will detect enemy targets, which are reported through the **Detected** event. -- --- ![Process](..\Presentations\AI_Cap\Dia9.JPG) +-- ![Process](..\Presentations\AI_CAP\Dia9.JPG) -- -- When enemies are detected, the AI will automatically engage the enemy. -- --- ![Process](..\Presentations\AI_Cap\Dia10.JPG) +-- ![Process](..\Presentations\AI_CAP\Dia10.JPG) -- -- Until a fuel or damage treshold has been reached by the AI, or when the AI is commanded to RTB. -- When the fuel treshold has been reached, the airplane will fly towards the nearest friendly airbase and will land. -- --- ![Process](..\Presentations\AI_Cap\Dia13.JPG) +-- ![Process](..\Presentations\AI_CAP\Dia13.JPG) -- -- ## 1.1) AI_CAP_ZONE constructor -- @@ -26116,7 +26116,7 @@ end -- -- ## 1.2) AI_CAP_ZONE is a FSM -- --- ![Process](..\Presentations\AI_Cap\Dia2.JPG) +-- ![Process](..\Presentations\AI_CAP\Dia2.JPG) -- -- ### 1.2.1) AI_CAP_ZONE States -- @@ -26137,17 +26137,17 @@ end -- -- ## 1.3) Set the Range of Engagement -- --- ![Range](..\Presentations\AI_Cap\Dia11.JPG) +-- ![Range](..\Presentations\AI_CAP\Dia11.JPG) -- -- An optional range can be set in meters, -- that will define when the AI will engage with the detected airborne enemy targets. -- The range can be beyond or smaller than the range of the Patrol Zone. -- The range is applied at the position of the AI. --- Use the method @{AI.AI_Cap#AI_CAP_ZONE.SetEngageRange}() to define that range. +-- Use the method @{AI.AI_CAP#AI_CAP_ZONE.SetEngageRange}() to define that range. -- -- ## 1.4) Set the Zone of Engagement -- --- ![Zone](..\Presentations\AI_Cap\Dia12.JPG) +-- ![Zone](..\Presentations\AI_CAP\Dia12.JPG) -- -- An optional @{Zone} can be set, -- that will define when the AI will engage with the detected airborne enemy targets. diff --git a/Moose Test Missions/ZON - Zones/ZON-510 - Send message if Clients fly the first time in the Polygon Zones/ZON-510 - Send message if Clients fly the first time in the Polygon Zones.lua b/Moose Test Missions/ZON - Zones/ZON-510 - Send message if Clients fly the first time in the Polygon Zones/ZON-510 - Send message if Clients fly the first time in the Polygon Zones.lua new file mode 100644 index 000000000..39dd57319 --- /dev/null +++ b/Moose Test Missions/ZON - Zones/ZON-510 - Send message if Clients fly the first time in the Polygon Zones/ZON-510 - Send message if Clients fly the first time in the Polygon Zones.lua @@ -0,0 +1,80 @@ +-- Name: ZON-510 - Send message if Clients fly the first time in the Polygon Zones +-- Author: Wingthor and FlightControl +-- Date Created: 20 January 2017 +-- +-- # Situation: +-- +-- There are a couple of player slots of Su-25Ts, that need to fly through two poly zones. +-- Once a player flies through a poly zone, a message will be sent. But only once. If he flies back through the same zone, +-- nothing is displayed anymore. Unless he logs off and rejoins the mission. +-- +-- # Test cases: +-- +-- + +local PolyZoneGroup1 = GROUP:FindByName("PolyZone1") +local PolyZoneGroup2 = GROUP:FindByName("PolyZone2") + +local PolyZone1 = ZONE_POLYGON:New( "PolyZone1", PolyZoneGroup1 ) +local PolyZone2 = ZONE_POLYGON:New( "PolyZone2", PolyZoneGroup2 ) + +local RedClients = SET_CLIENT:New():FilterCoalitions("red"):FilterStart() + + + +SchedulerInit, SchedulerInitID = SCHEDULER:New( nil, + function() + RedClients:ForEachClient( + function( MooseClient ) + + -- Here we register the state of the client in which step he is in. + -- We set the state of the client "ZoneStep" to 0, indicating that he is not out of the first zone. + local function ResetClientForZone( MooseClient ) + BASE:E("Reset") + MooseClient:SetState( MooseClient, "ZoneStep", "0" ) + end + + BASE:E( { "Alive Init", Client = MooseClient } ) + MooseClient:Alive( ResetClientForZone ) + end + ) + end, {}, 1 +) + +Scheduler, SchedulerID = SCHEDULER:New( nil, + function () + + RedClients:ForEachClientInZone( PolyZone1, + function( MooseClient ) + BASE:E( { Client = MooseClient, State = MooseClient:GetState( MooseClient, "ZoneStep" ) } ) + if MooseClient:GetState( MooseClient, "ZoneStep" ) == "0" then + MooseClient:SetState( MooseClient, "ZoneStep", "1" ) + MESSAGE:New("Lorem Ipsum", 15, "Pilot Update" ):ToClient( MooseClient ) + end + end + ) + + RedClients:ForEachClientNotInZone( PolyZone1, + function( MooseClient ) + BASE:E( { Client = MooseClient, State = MooseClient:GetState( MooseClient, "ZoneStep" ) } ) + if MooseClient:GetState( MooseClient, "ZoneStep" ) == "1" then + MooseClient:SetState( MooseClient, "ZoneStep", "2" ) + MESSAGE:New("Ipsum Ipsum", 15, "Pilot Update" ):ToClient( MooseClient ) + end + end + ) + + RedClients:ForEachClientInZone( PolyZone2, + function( MooseClient ) + BASE:E( { Client = MooseClient, State = MooseClient:GetState( MooseClient, "ZoneStep" ) } ) + if MooseClient:GetState( MooseClient, "ZoneStep" ) == "2" then + MooseClient:SetState( MooseClient, "ZoneStep", "3" ) + MESSAGE:New("Lorem Lorem", 15, "Pilot Update" ):ToClient( MooseClient ) + end + end + ) + + end, {}, 10, 1 + ) + + \ No newline at end of file diff --git a/Moose Test Missions/ZON - Zones/ZON-510 - Send message if Clients fly the first time in the Polygon Zones/ZON-510 - Send message if Clients fly the first time in the Polygon Zones.miz b/Moose Test Missions/ZON - Zones/ZON-510 - Send message if Clients fly the first time in the Polygon Zones/ZON-510 - Send message if Clients fly the first time in the Polygon Zones.miz new file mode 100644 index 000000000..1a83dba9a Binary files /dev/null and b/Moose Test Missions/ZON - Zones/ZON-510 - Send message if Clients fly the first time in the Polygon Zones/ZON-510 - Send message if Clients fly the first time in the Polygon Zones.miz differ