From 0b39e1a911e2a3c0e5e9945eca03aa49b2b1e0eb Mon Sep 17 00:00:00 2001
From: Grey-Echo
Date: Fri, 21 Apr 2017 14:07:06 +0200
Subject: [PATCH 01/13] Implement SET_GROUP:HasGroupCompletelyInZone()
---
Moose Development/Moose/Core/Set.lua | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua
index bac65d9aa..4f7d2beff 100644
--- a/Moose Development/Moose/Core/Set.lua
+++ b/Moose Development/Moose/Core/Set.lua
@@ -961,6 +961,30 @@ function SET_GROUP:ForEachGroupNotInZone( ZoneObject, IteratorFunction, ... )
return self
end
+--- Iterate the SET_GROUP and return false if at least one @{Wrapper.Group#GROUP} isn't in the @{Core.Zone#ZONE}
+-- @param #SET_GROUP self
+-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
+-- @return #boolean false if one of the @{Wrapper.Group#GROUP} is not in the @{Core.Zone#ZONE}, true otherwise.
+-- @usage
+-- local MyZone = ZONE:New("Zone1")
+-- local MySetGroup = SET_GROUP:New()
+-- MySetGroup:AddGroupsByName({"Group1", "Group2"})
+--
+-- if MySetGroup:HasGroupCompletelyInZone(MyZone) then
+-- MESSAGE:New("All the SET's GROUP are in zone !", 10):ToAll()
+-- else
+-- MESSAGE:New("Some or all SET's GROUP are outside zone !", 10):ToAll()
+-- end
+function SET_GROUP:HasGroupCompletelyInZone(Zone)
+ self:F2(Zone)
+ local Set = self:GetSet()
+ for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
+ if not GroupData:IsCompletelyInZone(Zone) then
+ return false
+ end
+ end
+ return true
+end
----- Iterate the SET_GROUP and call an interator function for each **alive** player, providing the Group of the player and optional parameters.
---- @param #SET_GROUP self
From 56eaa1679280faeb988ec11dc590e83872f0887d Mon Sep 17 00:00:00 2001
From: Grey-Echo
Date: Fri, 21 Apr 2017 14:16:32 +0200
Subject: [PATCH 02/13] Implement SET_GROUP:IsCompletelyInZone()
---
Moose Development/Moose/Core/Set.lua | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua
index 4f7d2beff..96ad77579 100644
--- a/Moose Development/Moose/Core/Set.lua
+++ b/Moose Development/Moose/Core/Set.lua
@@ -961,10 +961,10 @@ function SET_GROUP:ForEachGroupNotInZone( ZoneObject, IteratorFunction, ... )
return self
end
---- Iterate the SET_GROUP and return false if at least one @{Wrapper.Group#GROUP} isn't in the @{Core.Zone#ZONE}
+--- Iterate the SET_GROUP and return true if all the @{Wrapper.Group#GROUP} are completly in the @{Core.Zone#ZONE}
-- @param #SET_GROUP self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
--- @return #boolean false if one of the @{Wrapper.Group#GROUP} is not in the @{Core.Zone#ZONE}, true otherwise.
+-- @return #boolean true if all the @{Wrapper.Group#GROUP} are completly in the @{Core.Zone#ZONE}, false otherwise
-- @usage
-- local MyZone = ZONE:New("Zone1")
-- local MySetGroup = SET_GROUP:New()
@@ -975,7 +975,7 @@ end
-- else
-- MESSAGE:New("Some or all SET's GROUP are outside zone !", 10):ToAll()
-- end
-function SET_GROUP:HasGroupCompletelyInZone(Zone)
+function SET_GROUP:IsCompletelyInZone(Zone)
self:F2(Zone)
local Set = self:GetSet()
for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
@@ -986,6 +986,21 @@ function SET_GROUP:HasGroupCompletelyInZone(Zone)
return true
end
+--- Iterate the SET_GROUP and return true if at least one of the @{Wrapper.Group#GROUP} is completly inside the @{Core.Zone#ZONE}
+-- @param #SET_GROUP self
+-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
+-- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is completly inside the @{Core.Zone#ZONE}, false otherwise.
+function SET_GROUP:HasGroupCompletelyInZone(Zone)
+ self:F2(Zone)
+ local Set = self:GetSet()
+ for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
+ if GroupData:IsCompletlyInZone(Zone) then
+ return true
+ end
+ end
+ return false
+end
+
----- Iterate the SET_GROUP and call an interator function for each **alive** player, providing the Group of the player and optional parameters.
---- @param #SET_GROUP self
---- @param #function IteratorFunction The function that will be called when there is an alive player in the SET_GROUP. The function needs to accept a GROUP parameter.
From bfda34e94d2cc52c2d7d86679ea7ea0a1a8e7bc9 Mon Sep 17 00:00:00 2001
From: Grey-Echo
Date: Sat, 22 Apr 2017 01:06:35 +0200
Subject: [PATCH 03/13] Implement SET_GROUP:AnyCompletelyInZone
Also renames the 2 previously implemented funcitons
---
Moose Development/Moose/Core/Set.lua | 24 ++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua
index 96ad77579..9827670cf 100644
--- a/Moose Development/Moose/Core/Set.lua
+++ b/Moose Development/Moose/Core/Set.lua
@@ -961,7 +961,7 @@ function SET_GROUP:ForEachGroupNotInZone( ZoneObject, IteratorFunction, ... )
return self
end
---- Iterate the SET_GROUP and return true if all the @{Wrapper.Group#GROUP} are completly in the @{Core.Zone#ZONE}
+--- Iterate the SET_GROUP and return true if all the @{Wrapper.Group#GROUP} are completely in the @{Core.Zone#ZONE}
-- @param #SET_GROUP self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
-- @return #boolean true if all the @{Wrapper.Group#GROUP} are completly in the @{Core.Zone#ZONE}, false otherwise
@@ -975,7 +975,7 @@ end
-- else
-- MESSAGE:New("Some or all SET's GROUP are outside zone !", 10):ToAll()
-- end
-function SET_GROUP:IsCompletelyInZone(Zone)
+function SET_GROUP:AllCompletelyInZone(Zone)
self:F2(Zone)
local Set = self:GetSet()
for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
@@ -986,11 +986,11 @@ function SET_GROUP:IsCompletelyInZone(Zone)
return true
end
---- Iterate the SET_GROUP and return true if at least one of the @{Wrapper.Group#GROUP} is completly inside the @{Core.Zone#ZONE}
+--- Iterate the SET_GROUP and return true if at least one of the @{Wrapper.Group#GROUP} is completely inside the @{Core.Zone#ZONE}
-- @param #SET_GROUP self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
-- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is completly inside the @{Core.Zone#ZONE}, false otherwise.
-function SET_GROUP:HasGroupCompletelyInZone(Zone)
+function SET_GROUP:AnyCompletelyInZone(Zone)
self:F2(Zone)
local Set = self:GetSet()
for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
@@ -1001,6 +1001,22 @@ function SET_GROUP:HasGroupCompletelyInZone(Zone)
return false
end
+
+--- Iterate the SET_GROUP and return true if at least one least one @{#UNIT} of one @{GROUP} of the @{SET_GROUP} is in @{ZONE}
+-- @param #SET_GROUP self
+-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
+-- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is completly inside the @{Core.Zone#ZONE}, false otherwise.
+function SET_GROUP:AnyCompletelyInZone(Zone)
+ self:F2(Zone)
+ local Set = self:GetSet()
+ for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
+ if GroupData:IsPartlyInZone(Zone) then
+ return true
+ end
+ end
+ return false
+end
+
----- Iterate the SET_GROUP and call an interator function for each **alive** player, providing the Group of the player and optional parameters.
---- @param #SET_GROUP self
---- @param #function IteratorFunction The function that will be called when there is an alive player in the SET_GROUP. The function needs to accept a GROUP parameter.
From a0585565835370a45736f75e3771e2f091e2d33d Mon Sep 17 00:00:00 2001
From: Grey-Echo
Date: Sat, 22 Apr 2017 01:12:33 +0200
Subject: [PATCH 04/13] Implement SET_GROUP:NoneInZone()
---
Moose Development/Moose/Core/Set.lua | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua
index 9827670cf..ddb6773da 100644
--- a/Moose Development/Moose/Core/Set.lua
+++ b/Moose Development/Moose/Core/Set.lua
@@ -1006,7 +1006,7 @@ end
-- @param #SET_GROUP self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
-- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is completly inside the @{Core.Zone#ZONE}, false otherwise.
-function SET_GROUP:AnyCompletelyInZone(Zone)
+function SET_GROUP:AnyPartlyInZone(Zone)
self:F2(Zone)
local Set = self:GetSet()
for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
@@ -1017,6 +1017,21 @@ function SET_GROUP:AnyCompletelyInZone(Zone)
return false
end
+--- Iterate the SET_GROUP and return true if no @{GROUP} of the @{SET_GROUP} is in @{ZONE}
+-- @param #SET_GROUP self
+-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
+-- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is completly inside the @{Core.Zone#ZONE}, false otherwise.
+function SET_GROUP:NoneInZone(Zone)
+ self:F2(Zone)
+ local Set = self:GetSet()
+ for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
+ if not GroupData:IsNotInZone(Zone) then -- If the GROUP is in Zone in any way
+ return false
+ end
+ end
+ return true
+end
+
----- Iterate the SET_GROUP and call an interator function for each **alive** player, providing the Group of the player and optional parameters.
---- @param #SET_GROUP self
---- @param #function IteratorFunction The function that will be called when there is an alive player in the SET_GROUP. The function needs to accept a GROUP parameter.
From 02bb76792afad1447b759d118cfc69faa6f0e57c Mon Sep 17 00:00:00 2001
From: Grey-Echo
Date: Sat, 22 Apr 2017 01:16:19 +0200
Subject: [PATCH 05/13] Improve documentation in newly added methods in
SET_GROUP, correct faulty logic in SET_GROUP:AnyPartlyInZone()
---
Moose Development/Moose/Core/Set.lua | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua
index ddb6773da..aed86b81b 100644
--- a/Moose Development/Moose/Core/Set.lua
+++ b/Moose Development/Moose/Core/Set.lua
@@ -1001,16 +1001,15 @@ function SET_GROUP:AnyCompletelyInZone(Zone)
return false
end
-
--- Iterate the SET_GROUP and return true if at least one least one @{#UNIT} of one @{GROUP} of the @{SET_GROUP} is in @{ZONE}
-- @param #SET_GROUP self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
--- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is completly inside the @{Core.Zone#ZONE}, false otherwise.
+-- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is partly or completly inside the @{Core.Zone#ZONE}, false otherwise.
function SET_GROUP:AnyPartlyInZone(Zone)
self:F2(Zone)
local Set = self:GetSet()
for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
- if GroupData:IsPartlyInZone(Zone) then
+ if GroupData:IsPartlyInZone(Zone) or GroupData:IsCompletelyInZone(Zone) then
return true
end
end
@@ -1020,7 +1019,7 @@ end
--- Iterate the SET_GROUP and return true if no @{GROUP} of the @{SET_GROUP} is in @{ZONE}
-- @param #SET_GROUP self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
--- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is completly inside the @{Core.Zone#ZONE}, false otherwise.
+-- @return #boolean true if no @{Wrapper.Group#GROUP} is inside the @{Core.Zone#ZONE} in any way, false otherwise.
function SET_GROUP:NoneInZone(Zone)
self:F2(Zone)
local Set = self:GetSet()
From 497a2c17d032425d86275b172cd088df1d670aab Mon Sep 17 00:00:00 2001
From: Grey-Echo
Date: Sat, 22 Apr 2017 01:22:48 +0200
Subject: [PATCH 06/13] Add @usage tags to all newly added methods
---
Moose Development/Moose/Core/Set.lua | 36 ++++++++++++++++++++++++++--
1 file changed, 34 insertions(+), 2 deletions(-)
diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua
index aed86b81b..7225ff63f 100644
--- a/Moose Development/Moose/Core/Set.lua
+++ b/Moose Development/Moose/Core/Set.lua
@@ -970,7 +970,7 @@ end
-- local MySetGroup = SET_GROUP:New()
-- MySetGroup:AddGroupsByName({"Group1", "Group2"})
--
--- if MySetGroup:HasGroupCompletelyInZone(MyZone) then
+-- if MySetGroup:AllCompletelyInZone(MyZone) then
-- MESSAGE:New("All the SET's GROUP are in zone !", 10):ToAll()
-- else
-- MESSAGE:New("Some or all SET's GROUP are outside zone !", 10):ToAll()
@@ -990,6 +990,16 @@ end
-- @param #SET_GROUP self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
-- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is completly inside the @{Core.Zone#ZONE}, false otherwise.
+-- @usage
+-- local MyZone = ZONE:New("Zone1")
+-- local MySetGroup = SET_GROUP:New()
+-- MySetGroup:AddGroupsByName({"Group1", "Group2"})
+--
+-- if MySetGroup:AnyCompletelyInZone(MyZone) then
+-- MESSAGE:New("At least one GROUP is completely in zone !", 10):ToAll()
+-- else
+-- MESSAGE:New("No GROUP is completely in zone !", 10):ToAll()
+-- end
function SET_GROUP:AnyCompletelyInZone(Zone)
self:F2(Zone)
local Set = self:GetSet()
@@ -1005,6 +1015,16 @@ end
-- @param #SET_GROUP self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
-- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is partly or completly inside the @{Core.Zone#ZONE}, false otherwise.
+-- @usage
+-- local MyZone = ZONE:New("Zone1")
+-- local MySetGroup = SET_GROUP:New()
+-- MySetGroup:AddGroupsByName({"Group1", "Group2"})
+--
+-- if MySetGroup:AnyPartlyInZone(MyZone) then
+-- MESSAGE:New("At least one GROUP has at least one UNIT in zone !", 10):ToAll()
+-- else
+-- MESSAGE:New("No GROUP is completely in zone !", 10):ToAll()
+-- end
function SET_GROUP:AnyPartlyInZone(Zone)
self:F2(Zone)
local Set = self:GetSet()
@@ -1016,10 +1036,22 @@ function SET_GROUP:AnyPartlyInZone(Zone)
return false
end
---- Iterate the SET_GROUP and return true if no @{GROUP} of the @{SET_GROUP} is in @{ZONE}
+--- Iterate the SET_GROUP and return true if no @{GROUP} of the @{SET_GROUP} is in @{ZONE}
+-- This could also be achieved with `not SET_GROUP:AnyPartlyInZone(Zone)`, but it's easier for the
+-- mission designer to add a dedicated method
-- @param #SET_GROUP self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
-- @return #boolean true if no @{Wrapper.Group#GROUP} is inside the @{Core.Zone#ZONE} in any way, false otherwise.
+-- @usage
+-- local MyZone = ZONE:New("Zone1")
+-- local MySetGroup = SET_GROUP:New()
+-- MySetGroup:AddGroupsByName({"Group1", "Group2"})
+--
+-- if MySetGroup:NoneInZone(MyZone) then
+-- MESSAGE:New("No GROUP is completely in zone !", 10):ToAll()
+-- else
+-- MESSAGE:New("At least one GROUP has at least one UNIT in zone !", 10):ToAll()
+-- end
function SET_GROUP:NoneInZone(Zone)
self:F2(Zone)
local Set = self:GetSet()
From 980053916b0924dae7951c80dfa605e845e1118a Mon Sep 17 00:00:00 2001
From: Grey-Echo
Date: Sat, 22 Apr 2017 11:15:16 +0200
Subject: [PATCH 07/13] Solves a bug in GROUP:IsPartlyInZone()
If only the first UNITs of the GROUP where outside the ZONE, the function would still return false
This behaviour is fixed by this commit.
---
Moose Development/Moose/Core/Set.lua | 8 ++++----
Moose Development/Moose/Wrapper/Group.lua | 17 +++++++++--------
2 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua
index 7225ff63f..9bfd27a02 100644
--- a/Moose Development/Moose/Core/Set.lua
+++ b/Moose Development/Moose/Core/Set.lua
@@ -1004,14 +1004,14 @@ function SET_GROUP:AnyCompletelyInZone(Zone)
self:F2(Zone)
local Set = self:GetSet()
for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
- if GroupData:IsCompletlyInZone(Zone) then
+ if GroupData:IsCompletelyInZone(Zone) then
return true
end
end
return false
end
---- Iterate the SET_GROUP and return true if at least one least one @{#UNIT} of one @{GROUP} of the @{SET_GROUP} is in @{ZONE}
+--- Iterate the SET_GROUP and return true if at least one @{#UNIT} of one @{GROUP} of the @{SET_GROUP} is in @{ZONE}
-- @param #SET_GROUP self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
-- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is partly or completly inside the @{Core.Zone#ZONE}, false otherwise.
@@ -1023,7 +1023,7 @@ end
-- if MySetGroup:AnyPartlyInZone(MyZone) then
-- MESSAGE:New("At least one GROUP has at least one UNIT in zone !", 10):ToAll()
-- else
--- MESSAGE:New("No GROUP is completely in zone !", 10):ToAll()
+-- MESSAGE:New("No UNIT of any GROUP is in zone !", 10):ToAll()
-- end
function SET_GROUP:AnyPartlyInZone(Zone)
self:F2(Zone)
@@ -1050,7 +1050,7 @@ end
-- if MySetGroup:NoneInZone(MyZone) then
-- MESSAGE:New("No GROUP is completely in zone !", 10):ToAll()
-- else
--- MESSAGE:New("At least one GROUP has at least one UNIT in zone !", 10):ToAll()
+-- MESSAGE:New("No UNIT of any GROUP is in zone !", 10):ToAll()
-- end
function SET_GROUP:NoneInZone(Zone)
self:F2(Zone)
diff --git a/Moose Development/Moose/Wrapper/Group.lua b/Moose Development/Moose/Wrapper/Group.lua
index 2d845a9f2..3e9e6b5f9 100644
--- a/Moose Development/Moose/Wrapper/Group.lua
+++ b/Moose Development/Moose/Wrapper/Group.lua
@@ -555,22 +555,23 @@ end
function GROUP:IsPartlyInZone( Zone )
self:F2( { self.GroupName, Zone } )
- local PartlyInZone = false
+ local IsOneUnitInZone = false
+ local IsOneUnitOutsideZone = false
for UnitID, UnitData in pairs( self:GetUnits() ) do
local Unit = UnitData -- Wrapper.Unit#UNIT
if Zone:IsVec3InZone( Unit:GetVec3() ) then
- PartlyInZone = true
+ IsOneUnitInZone = true
else
- -- So, if there were groups in the zone found, and suddenly one NOT in the zone,
- -- then the group is partialy in the zone :-)
- if PartlyInZone == true then
- return true
- end
+ IsOneUnitOutsideZone = true
end
end
- return false
+ if IsOneUnitInZone and IsOneUnitOutsideZone then
+ return true
+ else
+ return false
+ end
end
--- Returns true if none of the group units of the group are within a @{Zone}.
From fb6bb635c687cde3e387d90bed3ca98b312f9fa4 Mon Sep 17 00:00:00 2001
From: Grey-Echo
Date: Sat, 22 Apr 2017 11:35:14 +0200
Subject: [PATCH 08/13] Documentation Update
---
docs/Documentation/AI_Designate.html | 77 +++++++
docs/Documentation/AI_Patrol.html | 3 +
docs/Documentation/Base.html | 31 +++
docs/Documentation/Detection.html | 3 +-
docs/Documentation/Fsm.html | 3 +-
docs/Documentation/Movement.html | 4 +
docs/Documentation/Set.html | 248 ++++++++++++++++++++++
docs/Documentation/Spawn.html | 14 +-
docs/Documentation/Spot.html | 300 +++++++++++++++++++++++++--
9 files changed, 653 insertions(+), 30 deletions(-)
diff --git a/docs/Documentation/AI_Designate.html b/docs/Documentation/AI_Designate.html
index b551f163f..e8948271c 100644
--- a/docs/Documentation/AI_Designate.html
+++ b/docs/Documentation/AI_Designate.html
@@ -154,6 +154,12 @@ each detected set of potential targets can be lased or smoked...
AI_DESIGNATE.LaserCodes |
+ |
+
+
+ | AI_DESIGNATE.LaserCodesUsed |
+
+
|
@@ -328,6 +334,12 @@ each detected set of potential targets can be lased or smoked...
| AI_DESIGNATE:onafterLaseOn(From, Event, To, AttackGroup, Index, Duration) |
+ |
+
+
+ | AI_DESIGNATE:onafterLasing(From, Event, To, AttackGroup, Index, Duration) |
+
+
|
@@ -512,6 +524,20 @@ One laser code can be given or an sequence of laser codes through an table...
+
+
+-
+
+
+
+AI_DESIGNATE.LaserCodesUsed
+
+
+-
+
+
+
@@ -1315,6 +1341,57 @@ number> LaserCodes
#AI_DESIGNATE:
+
+
+
+-
+
+
+AI_DESIGNATE:onafterLasing(From, Event, To, AttackGroup, Index, Duration)
+
+
+-
+
+
+
+
Parameters
+
+ -
+
+
From :
+
+
+ -
+
+
Event :
+
+
+ -
+
+
To :
+
+
+ -
+
+
AttackGroup :
+
+
+ -
+
+
Index :
+
+
+ -
+
+
Duration :
+
+
+
+ Return value
+
+#AI_DESIGNATE:
+
+
diff --git a/docs/Documentation/AI_Patrol.html b/docs/Documentation/AI_Patrol.html
index 3f3376551..d80d5e9ce 100644
--- a/docs/Documentation/AI_Patrol.html
+++ b/docs/Documentation/AI_Patrol.html
@@ -951,6 +951,9 @@ Use the method AIPATROLZONE.M
+
+ This table contains the targets detected during patrol.
+
diff --git a/docs/Documentation/Base.html b/docs/Documentation/Base.html
index 30a860472..2a7c7a64b 100644
--- a/docs/Documentation/Base.html
+++ b/docs/Documentation/Base.html
@@ -312,6 +312,12 @@ YYYY-MM-DD: CLASS:NewFunction( Params ) added
| BASE:OnEventCrash(EventData) |
Occurs when any aircraft crashes into the ground and is completely destroyed.
+ |
+
+
+ | BASE:OnEventDead(EventData) |
+
+ Occurs when an object is dead.
|
@@ -1398,6 +1404,31 @@ The EventData structure.
-
+
+BASE:OnEventDead(EventData)
+
+
+-
+
+
Occurs when an object is dead.
+
+
+initiator : The unit that is dead.
+
+ Parameter
+
+
+
+
+-
+
BASE:OnEventEjection(EventData)
diff --git a/docs/Documentation/Detection.html b/docs/Documentation/Detection.html
index f5ebc18d1..5989a6901 100644
--- a/docs/Documentation/Detection.html
+++ b/docs/Documentation/Detection.html
@@ -2187,6 +2187,7 @@ self
-
+ #number
DETECTION_BASE.DetectedItemMax
@@ -2300,7 +2301,7 @@ self
-
- #number
+
DETECTION_BASE.DetectionInterval
diff --git a/docs/Documentation/Fsm.html b/docs/Documentation/Fsm.html
index 7d9bc4a08..9b6918395 100644
--- a/docs/Documentation/Fsm.html
+++ b/docs/Documentation/Fsm.html
@@ -1622,7 +1622,7 @@ A string defining the start state.
-
-
+ #string
FSM._StartState
@@ -1921,7 +1921,6 @@ A string defining the start state.
-
-
FSM.current
diff --git a/docs/Documentation/Movement.html b/docs/Documentation/Movement.html
index 6c410e890..6199b647b 100644
--- a/docs/Documentation/Movement.html
+++ b/docs/Documentation/Movement.html
@@ -213,6 +213,7 @@ on defined intervals (currently every minute).
-
+ #number
MOVEMENT.AliveUnits
@@ -221,6 +222,9 @@ on defined intervals (currently every minute).
+
+
Contains the counter how many units are currently alive
+
diff --git a/docs/Documentation/Set.html b/docs/Documentation/Set.html
index a74f207e9..29ad4f438 100644
--- a/docs/Documentation/Set.html
+++ b/docs/Documentation/Set.html
@@ -349,6 +349,18 @@
| SET_BASE.Filter |
+ |
+
+
+ | SET_BASE:FilterCrashes() |
+
+ Starts the filtering of the Crash events for the collection.
+ |
+
+
+ | SET_BASE:FilterDeads() |
+
+ Starts the filtering of the Dead events for the collection.
|
@@ -715,6 +727,24 @@
| SET_GROUP:AddInDatabase(Event) |
Handles the Database to check on an event (birth) that the Object was added in the Database.
+ |
+
+
+ | SET_GROUP:AllCompletelyInZone(ZoneObject, Zone) |
+
+ Iterate the SET_GROUP and return true if all the Wrapper.Group#GROUP are completely in the Core.Zone#ZONE
+ |
+
+
+ | SET_GROUP:AnyCompletelyInZone(ZoneObject, Zone) |
+
+ Iterate the SET_GROUP and return true if at least one of the Wrapper.Group#GROUP is completely inside the Core.Zone#ZONE
+ |
+
+
+ | SET_GROUP:AnyPartlyInZone(ZoneObject, Zone) |
+
+ Iterate the SET_GROUP and return true if at least one #UNIT of one GROUP of the SET_GROUP is in ZONE
|
@@ -799,6 +829,14 @@
| SET_GROUP:New() |
Creates a new SET_GROUP object, building a set of groups belonging to a coalitions, categories, countries, types or with defined prefix names.
+ |
+
+
+ | SET_GROUP:NoneInZone(ZoneObject, Zone) |
+
+ Iterate the SET_GROUP and return true if no GROUP of the SET_GROUP is in ZONE
+This could also be achieved with not SET_GROUP:AnyPartlyInZone(Zone), but it's easier for the
+mission designer to add a dedicated method
|
@@ -1856,6 +1894,42 @@ Count
+
+
+
+-
+
+
+SET_BASE:FilterCrashes()
+
+
+-
+
+
Starts the filtering of the Crash events for the collection.
+
+ Return value
+
+#SET_BASE:
+self
+
+
+
+
+-
+
+
+SET_BASE:FilterDeads()
+
+
+-
+
+
Starts the filtering of the Dead events for the collection.
+
+ Return value
+
+#SET_BASE:
+self
+
@@ -3412,6 +3486,135 @@ The GROUP
-
+
+SET_GROUP:AllCompletelyInZone(ZoneObject, Zone)
+
+
+-
+
+
Iterate the SET_GROUP and return true if all the Wrapper.Group#GROUP are completely in the Core.Zone#ZONE
+
+ Parameters
+
+ Return value
+
+#boolean:
+true if all the Wrapper.Group#GROUP are completly in the Core.Zone#ZONE, false otherwise
+
+ Usage:
+ local MyZone = ZONE:New("Zone1")
+local MySetGroup = SET_GROUP:New()
+MySetGroup:AddGroupsByName({"Group1", "Group2"})
+
+if MySetGroup:AllCompletelyInZone(MyZone) then
+ MESSAGE:New("All the SET's GROUP are in zone !", 10):ToAll()
+else
+ MESSAGE:New("Some or all SET's GROUP are outside zone !", 10):ToAll()
+end
+
+
+
+
+-
+
+
+SET_GROUP:AnyCompletelyInZone(ZoneObject, Zone)
+
+
+-
+
+
Iterate the SET_GROUP and return true if at least one of the Wrapper.Group#GROUP is completely inside the Core.Zone#ZONE
+
+ Parameters
+
+ Return value
+
+#boolean:
+true if at least one of the Wrapper.Group#GROUP is completly inside the Core.Zone#ZONE, false otherwise.
+
+ Usage:
+ local MyZone = ZONE:New("Zone1")
+local MySetGroup = SET_GROUP:New()
+MySetGroup:AddGroupsByName({"Group1", "Group2"})
+
+if MySetGroup:AnyCompletelyInZone(MyZone) then
+ MESSAGE:New("At least one GROUP is completely in zone !", 10):ToAll()
+else
+ MESSAGE:New("No GROUP is completely in zone !", 10):ToAll()
+end
+
+
+
+
+-
+
+
+SET_GROUP:AnyPartlyInZone(ZoneObject, Zone)
+
+
+-
+
+
Iterate the SET_GROUP and return true if at least one #UNIT of one GROUP of the SET_GROUP is in ZONE
+
+ Parameters
+
+ Return value
+
+#boolean:
+true if at least one of the Wrapper.Group#GROUP is partly or completly inside the Core.Zone#ZONE, false otherwise.
+
+ Usage:
+ local MyZone = ZONE:New("Zone1")
+local MySetGroup = SET_GROUP:New()
+MySetGroup:AddGroupsByName({"Group1", "Group2"})
+
+if MySetGroup:AnyPartlyInZone(MyZone) then
+ MESSAGE:New("At least one GROUP has at least one UNIT in zone !", 10):ToAll()
+else
+ MESSAGE:New("No UNIT of any GROUP is in zone !", 10):ToAll()
+end
+
+
+
+
+-
+
SET_GROUP:FilterCategories(Categories)
@@ -3836,6 +4039,51 @@ DBObject = SET_GROUP:New()
-
+
+SET_GROUP:NoneInZone(ZoneObject, Zone)
+
+
+-
+
+
Iterate the SET_GROUP and return true if no GROUP of the SET_GROUP is in ZONE
+This could also be achieved with not SET_GROUP:AnyPartlyInZone(Zone), but it's easier for the
+mission designer to add a dedicated method
+
+ Parameters
+
+ Return value
+
+#boolean:
+true if no Wrapper.Group#GROUP is inside the Core.Zone#ZONE in any way, false otherwise.
+
+ Usage:
+ local MyZone = ZONE:New("Zone1")
+local MySetGroup = SET_GROUP:New()
+MySetGroup:AddGroupsByName({"Group1", "Group2"})
+
+if MySetGroup:NoneInZone(MyZone) then
+ MESSAGE:New("No GROUP is completely in zone !", 10):ToAll()
+else
+ MESSAGE:New("No UNIT of any GROUP is in zone !", 10):ToAll()
+end
+
+
+
+
+-
+
SET_GROUP:RemoveGroupsByName(RemoveGroupNames)
diff --git a/docs/Documentation/Spawn.html b/docs/Documentation/Spawn.html
index 896cf233e..088a3a7ad 100644
--- a/docs/Documentation/Spawn.html
+++ b/docs/Documentation/Spawn.html
@@ -2113,6 +2113,9 @@ The group that was spawned. You can use this group for further actions.
+
+
Don't repeat the group from Take-Off till Landing and back Take-Off by ReSpawning.
+
@@ -2583,6 +2586,9 @@ when nothing was spawned.
+
+ By default, no InitLimit
+
@@ -2618,7 +2624,7 @@ when nothing was spawned.
-
-
+ #number
SPAWN.SpawnMaxGroups
@@ -2635,7 +2641,7 @@ when nothing was spawned.
-
-
+ #number
SPAWN.SpawnMaxUnitsAlive
@@ -2963,7 +2969,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
-
-
+ #boolean
SPAWN.SpawnUnControlled
@@ -2987,7 +2993,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
-
When the first Spawn executes, all the Groups need to be made visible before start.
+ Flag that indicates if all the Groups of the SpawnGroup need to be visible when Spawned.
diff --git a/docs/Documentation/Spot.html b/docs/Documentation/Spot.html
index a9450d82c..220a12388 100644
--- a/docs/Documentation/Spot.html
+++ b/docs/Documentation/Spot.html
@@ -138,15 +138,21 @@
- | SPOT.ClassName |
-
-
- |
-
-
| SPOT:IsLasing() |
Check if the SPOT is lasing
+ |
+
+
+ | SPOT:LaseOff() |
+
+ LaseOff Trigger for SPOT
+ |
+
+
+ | SPOT:LaseOn() |
+
+ LaseOn Trigger for SPOT
|
@@ -165,6 +171,36 @@
| SPOT:New(Recce, LaserCode, Duration) |
SPOT Constructor.
+ |
+
+
+ | SPOT:OnAfterLaseOff(From, Event, To) |
+
+ LaseOff Handler OnAfter for SPOT
+ |
+
+
+ | SPOT:OnAfterLaseOn(From, Event, To) |
+
+ LaseOn Handler OnAfter for SPOT
+ |
+
+
+ | SPOT:OnBeforeLaseOff(From, Event, To) |
+
+ LaseOff Handler OnBefore for SPOT
+ |
+
+
+ | SPOT:OnBeforeLaseOn(From, Event, To) |
+
+ LaseOn Handler OnBefore for SPOT
+ |
+
+
+ | SPOT:OnEventDead(EventData) |
+
+
|
@@ -189,6 +225,18 @@
| SPOT.Target |
+ |
+
+
+ | SPOT:__LaseOff(Delay) |
+
+ LaseOff Asynchronous Trigger for SPOT
+ |
+
+
+ | SPOT:__LaseOn(Delay) |
+
+ LaseOn Asynchronous Trigger for SPOT
|
@@ -233,20 +281,6 @@
-
- #string
-
-SPOT.ClassName
-
-
--
-
-
-
-
-
-
--
-
SPOT:IsLasing()
@@ -260,6 +294,32 @@
#boolean:
true if it is lasing
+
+
+
+-
+
+
+SPOT:LaseOff()
+
+
+-
+
+
LaseOff Trigger for SPOT
+
+
+
+
+-
+
+
+SPOT:LaseOn()
+
+
+-
+
+
LaseOn Trigger for SPOT
+
@@ -324,6 +384,161 @@ true if it is lasing
#SPOT:
+
+
+
+-
+
+
+SPOT:OnAfterLaseOff(From, Event, To)
+
+
+-
+
+
LaseOff Handler OnAfter for SPOT
+
+ Parameters
+
+ -
+
+
#string From :
+
+
+ -
+
+
#string Event :
+
+
+ -
+
+
#string To :
+
+
+
+
+
+
+-
+
+
+SPOT:OnAfterLaseOn(From, Event, To)
+
+
+-
+
+
LaseOn Handler OnAfter for SPOT
+
+ Parameters
+
+ -
+
+
#string From :
+
+
+ -
+
+
#string Event :
+
+
+ -
+
+
#string To :
+
+
+
+
+
+
+-
+
+
+SPOT:OnBeforeLaseOff(From, Event, To)
+
+
+-
+
+
LaseOff Handler OnBefore for SPOT
+
+ Parameters
+
+ -
+
+
#string From :
+
+
+ -
+
+
#string Event :
+
+
+ -
+
+
#string To :
+
+
+
+ Return value
+
+#boolean:
+
+
+
+
+
+-
+
+
+SPOT:OnBeforeLaseOn(From, Event, To)
+
+
+-
+
+
LaseOn Handler OnBefore for SPOT
+
+ Parameters
+
+ -
+
+
#string From :
+
+
+ -
+
+
#string Event :
+
+
+ -
+
+
#string To :
+
+
+
+ Return value
+
+#boolean:
+
+
+
+
+
+-
+
+
+SPOT:OnEventDead(EventData)
+
+
+-
+
+
+
+
Parameter
+
@@ -343,7 +558,6 @@ true if it is lasing
-
-
SPOT.ScheduleID
@@ -357,7 +571,6 @@ true if it is lasing
-
-
SPOT.Spot
@@ -371,7 +584,6 @@ true if it is lasing
-
-
SPOT.Target
@@ -380,6 +592,48 @@ true if it is lasing
+
+
+
+-
+
+
+SPOT:__LaseOff(Delay)
+
+
+-
+
+
LaseOff Asynchronous Trigger for SPOT
+
+ Parameter
+
+ -
+
+
#number Delay :
+
+
+
+
+
+
+-
+
+
+SPOT:__LaseOn(Delay)
+
+
+-
+
+
LaseOn Asynchronous Trigger for SPOT
+
+ Parameter
+
+ -
+
+
#number Delay :
+
+
+
From 18756eb61e14a66da291c86236762650d3453be5 Mon Sep 17 00:00:00 2001
From: Grey-Echo
Date: Sat, 22 Apr 2017 14:18:39 +0200
Subject: [PATCH 09/13] Implement the new SET_GROUP:AnyPartlyInZone()
---
Moose Development/Moose/Core/Set.lua | 38 ++++++++++++++++++++++++++--
1 file changed, 36 insertions(+), 2 deletions(-)
diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua
index 7a5f0a418..c81b6ef66 100644
--- a/Moose Development/Moose/Core/Set.lua
+++ b/Moose Development/Moose/Core/Set.lua
@@ -1031,7 +1031,7 @@ function SET_GROUP:AnyCompletelyInZone(Zone)
return false
end
---- Iterate the SET_GROUP and return true if at least one @{#UNIT} of one @{GROUP} of the @{SET_GROUP} is in @{ZONE}
+--- Iterate the SET_GROUP and return true if at least one @{#UNIT} of one @{GROUP} of the @{SET_GROUP} is in @{ZONE}
-- @param #SET_GROUP self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
-- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is partly or completly inside the @{Core.Zone#ZONE}, false otherwise.
@@ -1045,7 +1045,7 @@ end
-- else
-- MESSAGE:New("No UNIT of any GROUP is in zone !", 10):ToAll()
-- end
-function SET_GROUP:AnyPartlyInZone(Zone)
+function SET_GROUP:AnyInZone(Zone)
self:F2(Zone)
local Set = self:GetSet()
for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
@@ -1056,6 +1056,40 @@ function SET_GROUP:AnyPartlyInZone(Zone)
return false
end
+--- Iterate the SET_GROUP and return true if at least one @{GROUP} of the @{SET_GROUP} is partly in @{ZONE}.
+-- Will return false if a @{GROUP} is fully in the @{ZONE}
+-- @param #SET_GROUP self
+-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
+-- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is partly or completly inside the @{Core.Zone#ZONE}, false otherwise.
+-- @usage
+-- local MyZone = ZONE:New("Zone1")
+-- local MySetGroup = SET_GROUP:New()
+-- MySetGroup:AddGroupsByName({"Group1", "Group2"})
+--
+-- if MySetGroup:AnyPartlyInZone(MyZone) then
+-- MESSAGE:New("At least one GROUP is partially in the zone, but none are fully in it !", 10):ToAll()
+-- else
+-- MESSAGE:New("No GROUP are in zone, or one GROUP is completely in it !", 10):ToAll()
+-- end
+function SET_GROUP:AnyPartlyInZone(Zone)
+ self:F2(Zone)
+ local IsPartlyInZone = false
+ local Set = self:GetSet()
+ for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
+ if GroupData:IsCompletelyInZone(Zone) then
+ return false
+ elseif GroupData:IsPartlyInZone(Zone) then
+ IsPartlyInZone = true -- at least one GROUP is partly in zone
+ end
+ end
+
+ if IsPartlyInZone then
+ return true
+ else
+ return false
+ end
+end
+
--- Iterate the SET_GROUP and return true if no @{GROUP} of the @{SET_GROUP} is in @{ZONE}
-- This could also be achieved with `not SET_GROUP:AnyPartlyInZone(Zone)`, but it's easier for the
-- mission designer to add a dedicated method
From d0e138b4c792cce3a9d0a7267922986bab16ed22 Mon Sep 17 00:00:00 2001
From: Grey-Echo
Date: Sat, 22 Apr 2017 14:35:51 +0200
Subject: [PATCH 10/13] Implement GROUP:CountInZone() and
SET_GROUP:CountInZone()
---
Moose Development/Moose/Core/Set.lua | 46 +++++++++++++++++++++++
Moose Development/Moose/Wrapper/Group.lua | 18 +++++++++
2 files changed, 64 insertions(+)
diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua
index c81b6ef66..893b28471 100644
--- a/Moose Development/Moose/Core/Set.lua
+++ b/Moose Development/Moose/Core/Set.lua
@@ -1117,6 +1117,52 @@ function SET_GROUP:NoneInZone(Zone)
return true
end
+--- Iterate the SET_GROUP and count how many GROUPs are completely in the Zone
+-- That could easily be done with SET_GROUP:ForEachGroupCompletelyInZone(), but this function
+-- provides an easy to use shortcut...
+-- @param #SET_GROUP self
+-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
+-- @return #number the number of GROUPs completely in the Zone
+-- @usage
+-- local MyZone = ZONE:New("Zone1")
+-- local MySetGroup = SET_GROUP:New()
+-- MySetGroup:AddGroupsByName({"Group1", "Group2"})
+--
+-- MESSAGE:New("There are " .. MySetGroup:CountInZone(MyZone) .. " GROUPs in the Zone !", 10):ToAll()
+function SET_GROUP:CountInZone(Zone)
+ self:F2(Zone)
+ local Count = 0
+ local Set = self:GetSet()
+ for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
+ if GroupData:IsCompletelyInZone(Zone) then
+ Count = Count + 1
+ end
+ end
+ return Count
+end
+
+--- Iterate the SET_GROUP and count how many UNITs are completely in the Zone
+-- @param #SET_GROUP self
+-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
+-- @return #number the number of GROUPs completely in the Zone
+-- @usage
+-- local MyZone = ZONE:New("Zone1")
+-- local MySetGroup = SET_GROUP:New()
+-- MySetGroup:AddGroupsByName({"Group1", "Group2"})
+--
+-- MESSAGE:New("There are " .. MySetGroup:CountUnitInZone(MyZone) .. " UNITs in the Zone !", 10):ToAll()
+function SET_GROUP:CountUnitInZone(Zone)
+ self:F2(Zone)
+ local Count = 0
+ local Set = self:GetSet()
+ for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
+ if GroupData:IsCompletelyInZone(Zone) then
+ Count = Count + 1
+ end
+ end
+ return Count
+end
+
----- Iterate the SET_GROUP and call an interator function for each **alive** player, providing the Group of the player and optional parameters.
---- @param #SET_GROUP self
---- @param #function IteratorFunction The function that will be called when there is an alive player in the SET_GROUP. The function needs to accept a GROUP parameter.
diff --git a/Moose Development/Moose/Wrapper/Group.lua b/Moose Development/Moose/Wrapper/Group.lua
index 3e9e6b5f9..8dae1d5b8 100644
--- a/Moose Development/Moose/Wrapper/Group.lua
+++ b/Moose Development/Moose/Wrapper/Group.lua
@@ -591,6 +591,24 @@ function GROUP:IsNotInZone( Zone )
return true
end
+--- Returns the number of UNITs that are in the @{Zone}
+-- @param #GROUP self
+-- @param Core.Zone#ZONE_BASE Zone The zone to test.
+-- @return #number The number of UNITs that are in the @{Zone}
+function GROUP:CountInZone( Zone )
+ self:F2( {slef.GroupName, Zone} )
+ local Count = 0
+
+ for UnitID, UnitData in pairs( self:GetUnits() ) do
+ local Unit = UnitData -- Wrapper.Unit#UNIT
+ if Zone:IsVec3InZone( Unit:GetVec3() ) then
+ Count = Count + 1
+ end
+ end
+
+ return Count
+end
+
--- Returns if the group is of an air category.
-- If the group is a helicopter or a plane, then this method will return true, otherwise false.
-- @param #GROUP self
From de3f8f529febf6670212bdd42ee6d46c2c2d8fe8 Mon Sep 17 00:00:00 2001
From: Grey-Echo
Date: Sat, 22 Apr 2017 14:38:00 +0200
Subject: [PATCH 11/13] SET_GROUP:CountUnitInZone()
---
Moose Development/Moose/Core/Set.lua | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua
index 893b28471..fbf1fbb70 100644
--- a/Moose Development/Moose/Core/Set.lua
+++ b/Moose Development/Moose/Core/Set.lua
@@ -1156,9 +1156,7 @@ function SET_GROUP:CountUnitInZone(Zone)
local Count = 0
local Set = self:GetSet()
for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
- if GroupData:IsCompletelyInZone(Zone) then
- Count = Count + 1
- end
+ Count = Count + GroupData:CountInZone(Zone)
end
return Count
end
From 09325a8615a7258a22f7a3d989b4e689a72dc5fe Mon Sep 17 00:00:00 2001
From: Grey-Echo
Date: Sat, 22 Apr 2017 14:54:13 +0200
Subject: [PATCH 12/13] Correct inprecise documentation
---
Moose Development/Moose/Core/Set.lua | 2 +-
Moose Development/Moose/Wrapper/Group.lua | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua
index fbf1fbb70..3eec06f0c 100644
--- a/Moose Development/Moose/Core/Set.lua
+++ b/Moose Development/Moose/Core/Set.lua
@@ -1069,7 +1069,7 @@ end
-- if MySetGroup:AnyPartlyInZone(MyZone) then
-- MESSAGE:New("At least one GROUP is partially in the zone, but none are fully in it !", 10):ToAll()
-- else
--- MESSAGE:New("No GROUP are in zone, or one GROUP is completely in it !", 10):ToAll()
+-- MESSAGE:New("No GROUP are in zone, or one (or more) GROUP is completely in it !", 10):ToAll()
-- end
function SET_GROUP:AnyPartlyInZone(Zone)
self:F2(Zone)
diff --git a/Moose Development/Moose/Wrapper/Group.lua b/Moose Development/Moose/Wrapper/Group.lua
index 8dae1d5b8..3964388f1 100644
--- a/Moose Development/Moose/Wrapper/Group.lua
+++ b/Moose Development/Moose/Wrapper/Group.lua
@@ -596,7 +596,7 @@ end
-- @param Core.Zone#ZONE_BASE Zone The zone to test.
-- @return #number The number of UNITs that are in the @{Zone}
function GROUP:CountInZone( Zone )
- self:F2( {slef.GroupName, Zone} )
+ self:F2( {self.GroupName, Zone} )
local Count = 0
for UnitID, UnitData in pairs( self:GetUnits() ) do
From f1a9029bc60d409f3f77b339c54eb64a01e57b61 Mon Sep 17 00:00:00 2001
From: Grey-Echo
Date: Sat, 22 Apr 2017 14:56:30 +0200
Subject: [PATCH 13/13] Documentation update
---
docs/Documentation/AI_Patrol.html | 3 -
docs/Documentation/Cargo.html | 1 -
docs/Documentation/Detection.html | 3 +-
docs/Documentation/Fsm.html | 3 +-
docs/Documentation/Group.html | 33 ++++++
docs/Documentation/Movement.html | 4 -
docs/Documentation/Positionable.html | 1 +
docs/Documentation/Set.html | 154 ++++++++++++++++++++++++++-
docs/Documentation/Spawn.html | 32 ++++--
docs/Documentation/SpawnStatic.html | 1 -
docs/Documentation/Task_Cargo.html | 2 +-
11 files changed, 211 insertions(+), 26 deletions(-)
diff --git a/docs/Documentation/AI_Patrol.html b/docs/Documentation/AI_Patrol.html
index d80d5e9ce..3f3376551 100644
--- a/docs/Documentation/AI_Patrol.html
+++ b/docs/Documentation/AI_Patrol.html
@@ -951,9 +951,6 @@ Use the method AIPATROLZONE.M
-
- This table contains the targets detected during patrol.
-
diff --git a/docs/Documentation/Cargo.html b/docs/Documentation/Cargo.html
index 2b21da531..c4e5754c6 100644
--- a/docs/Documentation/Cargo.html
+++ b/docs/Documentation/Cargo.html
@@ -2847,7 +2847,6 @@ The range till cargo will board.
-
-
CARGO_UNIT.CargoCarrier
diff --git a/docs/Documentation/Detection.html b/docs/Documentation/Detection.html
index 5989a6901..f5ebc18d1 100644
--- a/docs/Documentation/Detection.html
+++ b/docs/Documentation/Detection.html
@@ -2187,7 +2187,6 @@ self
-
- #number
DETECTION_BASE.DetectedItemMax
@@ -2301,7 +2300,7 @@ self
-
-
+ #number
DETECTION_BASE.DetectionInterval
diff --git a/docs/Documentation/Fsm.html b/docs/Documentation/Fsm.html
index 9b6918395..7d9bc4a08 100644
--- a/docs/Documentation/Fsm.html
+++ b/docs/Documentation/Fsm.html
@@ -1622,7 +1622,7 @@ A string defining the start state.
-
- #string
+
FSM._StartState
@@ -1921,6 +1921,7 @@ A string defining the start state.
-
+
FSM.current
diff --git a/docs/Documentation/Group.html b/docs/Documentation/Group.html
index 7404cd7ba..e415e93ed 100644
--- a/docs/Documentation/Group.html
+++ b/docs/Documentation/Group.html
@@ -190,6 +190,12 @@
| GROUP:CopyRoute(Begin, End, Randomize, Radius) |
Return the route of a group by using the Database#DATABASE class.
+ |
+
+
+ | GROUP:CountInZone(Zone) |
+
+ Returns the number of UNITs that are in the Zone
|
@@ -680,6 +686,33 @@ When randomization is on, the randomization is within the radius.
-
+
+GROUP:CountInZone(Zone)
+
+
+-
+
+
Returns the number of UNITs that are in the Zone
+
+ Parameter
+
+ Return value
+
+#number:
+The number of UNITs that are in the Zone
+
+
+
+
+-
+
GROUP:Destroy()
diff --git a/docs/Documentation/Movement.html b/docs/Documentation/Movement.html
index 6199b647b..6c410e890 100644
--- a/docs/Documentation/Movement.html
+++ b/docs/Documentation/Movement.html
@@ -213,7 +213,6 @@ on defined intervals (currently every minute).
-
- #number
MOVEMENT.AliveUnits
@@ -222,9 +221,6 @@ on defined intervals (currently every minute).
-
-
Contains the counter how many units are currently alive
-
diff --git a/docs/Documentation/Positionable.html b/docs/Documentation/Positionable.html
index 2d0a62858..d14bdc539 100644
--- a/docs/Documentation/Positionable.html
+++ b/docs/Documentation/Positionable.html
@@ -1208,6 +1208,7 @@ self
-
+ Core.Spot#SPOT
POSITIONABLE.Spot
diff --git a/docs/Documentation/Set.html b/docs/Documentation/Set.html
index 29ad4f438..e66aac85e 100644
--- a/docs/Documentation/Set.html
+++ b/docs/Documentation/Set.html
@@ -739,12 +739,32 @@
| SET_GROUP:AnyCompletelyInZone(ZoneObject, Zone) |
Iterate the SET_GROUP and return true if at least one of the Wrapper.Group#GROUP is completely inside the Core.Zone#ZONE
+ |
+
+
+ | SET_GROUP:AnyInZone(ZoneObject, Zone) |
+
+ Iterate the SET_GROUP and return true if at least one #UNIT of one GROUP of the SET_GROUP is in ZONE
|
| SET_GROUP:AnyPartlyInZone(ZoneObject, Zone) |
- Iterate the SET_GROUP and return true if at least one #UNIT of one GROUP of the SET_GROUP is in ZONE
+Iterate the SET_GROUP and return true if at least one GROUP of the SET_GROUP is partly in ZONE.
+ |
+
+
+ | SET_GROUP:CountInZone(ZoneObject, Zone) |
+
+ Iterate the SETGROUP and count how many GROUPs are completely in the Zone
+That could easily be done with SETGROUP:ForEachGroupCompletelyInZone(), but this function
+provides an easy to use shortcut...
+ |
+
+
+ | SET_GROUP:CountUnitInZone(ZoneObject, Zone) |
+
+ Iterate the SET_GROUP and count how many UNITs are completely in the Zone
|
@@ -3572,13 +3592,13 @@ end
-
-
-SET_GROUP:AnyPartlyInZone(ZoneObject, Zone)
+
+SET_GROUP:AnyInZone(ZoneObject, Zone)
-
-
Iterate the SET_GROUP and return true if at least one #UNIT of one GROUP of the SET_GROUP is in ZONE
+Iterate the SET_GROUP and return true if at least one #UNIT of one GROUP of the SET_GROUP is in ZONE
Parameters
@@ -3615,6 +3635,132 @@ end
-
+
+SET_GROUP:AnyPartlyInZone(ZoneObject, Zone)
+
+
+-
+
+
Iterate the SET_GROUP and return true if at least one GROUP of the SET_GROUP is partly in ZONE.
+
+
+Will return false if a GROUP is fully in the ZONE
+
+ Parameters
+
+ Return value
+
+#boolean:
+true if at least one of the Wrapper.Group#GROUP is partly or completly inside the Core.Zone#ZONE, false otherwise.
+
+ Usage:
+ local MyZone = ZONE:New("Zone1")
+local MySetGroup = SET_GROUP:New()
+MySetGroup:AddGroupsByName({"Group1", "Group2"})
+
+if MySetGroup:AnyPartlyInZone(MyZone) then
+ MESSAGE:New("At least one GROUP is partially in the zone, but none are fully in it !", 10):ToAll()
+else
+ MESSAGE:New("No GROUP are in zone, or one (or more) GROUP is completely in it !", 10):ToAll()
+end
+
+
+
+
+-
+
+
+SET_GROUP:CountInZone(ZoneObject, Zone)
+
+
+-
+
+
Iterate the SETGROUP and count how many GROUPs are completely in the Zone
+That could easily be done with SETGROUP:ForEachGroupCompletelyInZone(), but this function
+provides an easy to use shortcut...
+
+ Parameters
+
+ Return value
+
+#number:
+the number of GROUPs completely in the Zone
+
+ Usage:
+ local MyZone = ZONE:New("Zone1")
+local MySetGroup = SET_GROUP:New()
+MySetGroup:AddGroupsByName({"Group1", "Group2"})
+
+MESSAGE:New("There are " .. MySetGroup:CountInZone(MyZone) .. " GROUPs in the Zone !", 10):ToAll()
+
+
+
+
+-
+
+
+SET_GROUP:CountUnitInZone(ZoneObject, Zone)
+
+
+-
+
+
Iterate the SET_GROUP and count how many UNITs are completely in the Zone
+
+ Parameters
+
+ Return value
+
+#number:
+the number of GROUPs completely in the Zone
+
+ Usage:
+ local MyZone = ZONE:New("Zone1")
+local MySetGroup = SET_GROUP:New()
+MySetGroup:AddGroupsByName({"Group1", "Group2"})
+
+MESSAGE:New("There are " .. MySetGroup:CountUnitInZone(MyZone) .. " UNITs in the Zone !", 10):ToAll()
+
+
+
+
+-
+
SET_GROUP:FilterCategories(Categories)
diff --git a/docs/Documentation/Spawn.html b/docs/Documentation/Spawn.html
index 088a3a7ad..d7bf6b172 100644
--- a/docs/Documentation/Spawn.html
+++ b/docs/Documentation/Spawn.html
@@ -812,6 +812,12 @@ and any spaces before and after the resulting name are removed.
| SPAWN:_TranslateRotate(SpawnIndex, SpawnRootX, SpawnRootY, SpawnX, SpawnY, SpawnAngle) |
+ |
+
+
+ | SPAWN.uncontrolled |
+
+
|
@@ -2113,9 +2119,6 @@ The group that was spawned. You can use this group for further actions.
-
- Don't repeat the group from Take-Off till Landing and back Take-Off by ReSpawning.
-
@@ -2586,9 +2589,6 @@ when nothing was spawned.
-
- By default, no InitLimit
-
@@ -2624,7 +2624,7 @@ when nothing was spawned.
-
- #number
+
SPAWN.SpawnMaxGroups
@@ -2641,7 +2641,7 @@ when nothing was spawned.
-
- #number
+
SPAWN.SpawnMaxUnitsAlive
@@ -2993,7 +2993,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
-
Flag that indicates if all the Groups of the SpawnGroup need to be visible when Spawned.
+ When the first Spawn executes, all the Groups need to be made visible before start.
@@ -3559,6 +3559,20 @@ True = Continue Scheduler
+
+
+
+-
+
+
+
+SPAWN.uncontrolled
+
+
+-
+
+
+
diff --git a/docs/Documentation/SpawnStatic.html b/docs/Documentation/SpawnStatic.html
index 23a722fcf..50d0ec61a 100644
--- a/docs/Documentation/SpawnStatic.html
+++ b/docs/Documentation/SpawnStatic.html
@@ -444,7 +444,6 @@ ptional) The name of the new static.
-
- #number
SPAWNSTATIC.SpawnIndex
diff --git a/docs/Documentation/Task_Cargo.html b/docs/Documentation/Task_Cargo.html
index 73897fb41..0d3a4ee9b 100644
--- a/docs/Documentation/Task_Cargo.html
+++ b/docs/Documentation/Task_Cargo.html
@@ -453,7 +453,7 @@ based on the tasking capabilities defined in Task#TA
-
- Core.Cargo#CARGO_GROUP
+
FSM_PROCESS.Cargo