Updated Moose.lua

This commit is contained in:
funkyfranky
2024-01-01 22:48:35 +00:00
parent d0ce19b779
commit 966a374f98
150 changed files with 6601 additions and 6601 deletions

View File

@@ -1,16 +1,16 @@
BlueAirbaseSet = SET_AIRBASE:New():FilterCoalitions("blue"):FilterStart()
RedAirbaseSet = SET_AIRBASE:New():FilterCoalitions("red"):FilterStart()
RedAirbaseHelipadSet = SET_AIRBASE:New():FilterCoalitions("red"):FilterCategories("helipad"):FilterStart()
BlueAirbaseShipSet = SET_AIRBASE:New():FilterCoalitions("blue"):FilterCategories("ship"):FilterStart()
BlueAirbaseSet:Flush()
RedAirbaseSet:Flush()
RedAirbaseHelipadSet:Flush()
BlueAirbaseSet = SET_AIRBASE:New():FilterCoalitions("blue"):FilterStart()
RedAirbaseSet = SET_AIRBASE:New():FilterCoalitions("red"):FilterStart()
RedAirbaseHelipadSet = SET_AIRBASE:New():FilterCoalitions("red"):FilterCategories("helipad"):FilterStart()
BlueAirbaseShipSet = SET_AIRBASE:New():FilterCoalitions("blue"):FilterCategories("ship"):FilterStart()
BlueAirbaseSet:Flush()
RedAirbaseSet:Flush()
RedAirbaseHelipadSet:Flush()
BlueAirbaseShipSet:Flush()

View File

@@ -1,34 +1,34 @@
---
-- Name: SET-102 - Test SET_GROUP object against ZONE
-- Author: FlightControl
-- Date Created: 31 Mar 2017
--
-- # Situation:
--
-- A ZONE has been defined, and the SET_GROUP object is checked against the zone.
--
-- # Test cases:
--
-- 1. Observe the zone perimeter, and place the SET_GROUP object in or out of the zone.
-- 2. Observe the results of the functions.
SetGroupObject = SET_GROUP:New():FilterCoalitions("blue"):FilterPrefixes("Group Object"):FilterStart()
Zone = ZONE:New( "Zone" )
SetGroupObject:ForEachGroupCompletelyInZone( Zone,
function( GroupObject )
GroupObject:E( { GroupObject:GetName(), "I am completely in Zone" } )
end )
SetGroupObject:ForEachGroupPartlyInZone( Zone,
function( GroupObject )
GroupObject:E( { GroupObject:GetName(), "I am partially in Zone" } )
end )
SetGroupObject:ForEachGroupNotInZone( Zone,
function( GroupObject )
GroupObject:E( { GroupObject:GetName(), "I am not in Zone" } )
end )
---
-- Name: SET-102 - Test SET_GROUP object against ZONE
-- Author: FlightControl
-- Date Created: 31 Mar 2017
--
-- # Situation:
--
-- A ZONE has been defined, and the SET_GROUP object is checked against the zone.
--
-- # Test cases:
--
-- 1. Observe the zone perimeter, and place the SET_GROUP object in or out of the zone.
-- 2. Observe the results of the functions.
SetGroupObject = SET_GROUP:New():FilterCoalitions("blue"):FilterPrefixes("Group Object"):FilterStart()
Zone = ZONE:New( "Zone" )
SetGroupObject:ForEachGroupCompletelyInZone( Zone,
function( GroupObject )
GroupObject:E( { GroupObject:GetName(), "I am completely in Zone" } )
end )
SetGroupObject:ForEachGroupPartlyInZone( Zone,
function( GroupObject )
GroupObject:E( { GroupObject:GetName(), "I am partially in Zone" } )
end )
SetGroupObject:ForEachGroupNotInZone( Zone,
function( GroupObject )
GroupObject:E( { GroupObject:GetName(), "I am not in Zone" } )
end )

View File

@@ -1,24 +1,24 @@
---
-- Name: ZON-103 - Test if GROUP object is in ZONE
-- Author: FlightControl
-- Date Created: 31 Mar 2017
--
-- # Situation:
--
-- A ZONE has been defined, and it is checked if a GROUP object is within the zone.
--
-- # Test cases:
--
-- 1. Observe the zone perimeter, and place the GROUP object in or out of the zone.
-- 2. Observe the results of the functions.
GroupObject = GROUP:FindByName( "Group Object" )
Zone = ZONE:New( "Zone" )
Zone:E( { "Group is completely in Zone:", GroupObject:IsCompletelyInZone( Zone ) } )
Zone:E( { "Group is partially in Zone:", GroupObject:IsPartlyInZone( Zone ) } )
Zone:E( { "Group is not in Zone:", GroupObject:IsNotInZone( Zone ) } )
---
-- Name: ZON-103 - Test if GROUP object is in ZONE
-- Author: FlightControl
-- Date Created: 31 Mar 2017
--
-- # Situation:
--
-- A ZONE has been defined, and it is checked if a GROUP object is within the zone.
--
-- # Test cases:
--
-- 1. Observe the zone perimeter, and place the GROUP object in or out of the zone.
-- 2. Observe the results of the functions.
GroupObject = GROUP:FindByName( "Group Object" )
Zone = ZONE:New( "Zone" )
Zone:E( { "Group is completely in Zone:", GroupObject:IsCompletelyInZone( Zone ) } )
Zone:E( { "Group is partially in Zone:", GroupObject:IsPartlyInZone( Zone ) } )
Zone:E( { "Group is not in Zone:", GroupObject:IsNotInZone( Zone ) } )

View File

@@ -1,17 +1,17 @@
---
-- Name: SET-103 - Test SET_GROUP players added and deleted
-- Author: FlightControl
-- Date Created: 31 Mar 2017
--
-- # Situation:
--
-- Multiple groups of ground vehicles have been defined.
-- There are collected in a SET_GROUP.
-- A human player is jumping into the seat on one of these vehicles of the SET_GROUP.
--
-- # Test cases:
--
-- 1. Observe the player added and deleted from the SET_GROUP depending on the behaviour.
SetGroupObject = SET_GROUP:New():FilterCoalitions("blue"):FilterPrefixes("Group Object"):FilterStart()
---
-- Name: SET-103 - Test SET_GROUP players added and deleted
-- Author: FlightControl
-- Date Created: 31 Mar 2017
--
-- # Situation:
--
-- Multiple groups of ground vehicles have been defined.
-- There are collected in a SET_GROUP.
-- A human player is jumping into the seat on one of these vehicles of the SET_GROUP.
--
-- # Test cases:
--
-- 1. Observe the player added and deleted from the SET_GROUP depending on the behaviour.
SetGroupObject = SET_GROUP:New():FilterCoalitions("blue"):FilterPrefixes("Group Object"):FilterStart()

View File

@@ -1,3 +1,3 @@
SetClient = SET_CLIENT:New():FilterCoalitions("blue"):FilterCategories("plane"):FilterCountries("USA"):FilterStart()
SetClient = SET_CLIENT:New():FilterCoalitions("blue"):FilterCategories("plane"):FilterCountries("USA"):FilterStart()

View File

@@ -1,163 +1,163 @@
SetVehicles = SET_GROUP:New()
SetVehicles:AddGroupsByName( { "Vehicle A", "Vehicle B", "Vehicle C" } )
SetVehicles:ForEachGroup(
--- @param Wrapper.Group#GROUP MooseGroup
function( MooseGroup )
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
local UnitAction = UnitData -- Wrapper.Unit#UNIT
UnitAction:SmokeGreen()
end
end
)
SetBluePlanesGroup = SET_GROUP:New()
:FilterCoalitions( "blue" )
:FilterCategories( "plane" )
:FilterStart()
SetNorthKoreaGroup = SET_GROUP:New()
:FilterCountries( "RUSSIA" )
:FilterStart()
SetSAMGroup = SET_GROUP:New()
:FilterPrefixes( "SAM" )
:FilterStart()
:SetIteratorIntervals( 5, 10 )
SetGroundGroup = SET_GROUP:New()
:FilterCategories( "ground" )
:FilterStart()
SetGroundGroup:Flush()
SpawnUS_Plane = SPAWN:New( 'Spawn Test USA Plane')
GroupUS_Plane = SpawnUS_Plane:Spawn()
SpawnUS_Vehicle = SPAWN:New( 'Spawn Test USA Vehicle')
GroupUS_Vehicle = SpawnUS_Vehicle:Spawn()
SpawnUS_Ship = SPAWN:New( 'Spawn Test USA Ship')
GroupUS_Ship = SpawnUS_Ship:Spawn()
SpawnRU_Vehicle = SPAWN:New( 'Spawn Test RUSSIA Vehicle')
GroupRU_Vehicle = SpawnRU_Vehicle:Spawn()
SpawnRU_Ship = SPAWN:New( 'Spawn Test RUSSIA Ship')
GroupRU_Ship = SpawnRU_Ship:Spawn()
SpawnM2A2_AttackVehicle = SPAWN:New( 'Spawn Test M2A2 Attack Vehicle' ):InitRandomizeUnits( true, 10, 4 )
SpawnSAM_AttackVehicle = SPAWN:New( 'Spawn Test SAM Attack Vehicle' ):InitRandomizeUnits( true, 10, 4 )
for i = 1, 30 do
GroupM2A2_AttackVehicle = SpawnM2A2_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") )
GroupSAM_AttackVehicle = SpawnSAM_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") )
end
SetVehicleCompletely = SET_GROUP:New()
:FilterPrefixes( "Spawn Vehicle Zone Completely" )
:FilterStart()
SetVehiclePartly = SET_GROUP:New()
:FilterPrefixes( "Spawn Vehicle Zone Partly" )
:FilterStart()
SetVehicleNot = SET_GROUP:New()
:FilterPrefixes( "Spawn Vehicle Zone Not" )
:FilterStart()
Spawn_Vehicle_Zone_Completely = SPAWN:New( 'Spawn Vehicle Zone Completely' ):InitRandomizeUnits( true, 10, 4)
Spawn_Vehicle_Zone_Partly = SPAWN:New( 'Spawn Vehicle Zone Partly' ):InitRandomizeUnits( true, 10, 4 )
Spawn_Vehicle_Zone_Not = SPAWN:New( 'Spawn Vehicle Zone Not' ):InitRandomizeUnits( true, 10, 4 )
for i = 1, 30 do
Spawn_Vehicle_Zone_Completely:SpawnInZone( ZONE:New("Spawn Zone Completely") )
Spawn_Vehicle_Zone_Partly:SpawnInZone( ZONE:New("Spawn Zone Partly") )
Spawn_Vehicle_Zone_Not:SpawnInZone( ZONE:New("Spawn Zone Not") )
end
--DBBlue:TraceDatabase()
--SCHEDULER:New( DBBluePlanes, DBBluePlanes.Flush, { }, 1 )
--SCHEDULER:New( DBRedVehicles, DBRedVehicles.Flush, { }, 1 )
--SCHEDULER:New( DBShips, DBShips.Flush, { }, 1 )
--SCHEDULER:New( DBBelgium, DBBelgium.Flush, { }, 1 )
--SCHEDULER:New( DBNorthKorea, DBNorthKorea.Flush, { }, 1 )
--SCHEDULER:New( DBKA50Vinson, DBKA50Vinson.Flush, { }, 1 )
--
--SCHEDULER:New( DBBluePlanesGroup, DBBluePlanesGroup.Flush, { }, 1 )
--SCHEDULER:New( DBNorthKoreaGroup, DBNorthKoreaGroup.Flush, { }, 1 )
SetBluePlanesGroup:ForEachGroup(
--- @param Wrapper.Group#GROUP MooseGroup
function( MooseGroup )
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
local UnitAction = UnitData -- Wrapper.Unit#UNIT
UnitAction:SmokeBlue()
end
end
)
SetNorthKoreaGroup:ForEachGroup(
--- @param Wrapper.Group#GROUP MooseGroup
function( MooseGroup )
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
local UnitAction = UnitData -- Wrapper.Unit#UNIT
UnitAction:SmokeRed()
end
end
)
SetSAMGroup:ForEachGroup(
--- @param Wrapper.Group#GROUP MooseGroup
function( MooseGroup )
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
local UnitAction = UnitData -- Wrapper.Unit#UNIT
UnitAction:SmokeOrange()
end
end
)
GroupZoneCompletely = GROUP:FindByName( "Zone Completely" )
GroupZonePartly = GROUP:FindByName( "Zone Partly" )
GroupZoneNot = GROUP:FindByName( "Zone Not" )
ZoneCompletely = ZONE_POLYGON:New( "Zone Completely", GroupZoneCompletely ):SmokeZone( SMOKECOLOR.White )
ZonePartly = ZONE_POLYGON:New( "Zone Partly", GroupZonePartly ):SmokeZone( SMOKECOLOR.White )
ZoneNot = ZONE_POLYGON:New( "Zone Not", GroupZoneNot ):SmokeZone( SMOKECOLOR.White )
SetVehicleCompletely:ForEachGroupCompletelyInZone( ZoneCompletely,
--- @param Wrapper.Group#GROUP MooseGroup
function( MooseGroup )
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
local UnitAction = UnitData -- Wrapper.Unit#UNIT
UnitAction:SmokeBlue()
end
end
)
SetVehiclePartly:ForEachGroupPartlyInZone( ZonePartly,
--- @param Wrapper.Group#GROUP MooseGroup
function( MooseGroup )
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
local UnitAction = UnitData -- Wrapper.Unit#UNIT
UnitAction:SmokeBlue()
end
end
)
SetVehicleNot:ForEachGroupNotInZone( ZoneNot,
--- @param Wrapper.Group#GROUP MooseGroup
function( MooseGroup )
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
local UnitAction = UnitData -- Wrapper.Unit#UNIT
UnitAction:SmokeBlue()
end
end
)
SetVehicles = SET_GROUP:New()
SetVehicles:AddGroupsByName( { "Vehicle A", "Vehicle B", "Vehicle C" } )
SetVehicles:ForEachGroup(
--- @param Wrapper.Group#GROUP MooseGroup
function( MooseGroup )
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
local UnitAction = UnitData -- Wrapper.Unit#UNIT
UnitAction:SmokeGreen()
end
end
)
SetBluePlanesGroup = SET_GROUP:New()
:FilterCoalitions( "blue" )
:FilterCategories( "plane" )
:FilterStart()
SetNorthKoreaGroup = SET_GROUP:New()
:FilterCountries( "RUSSIA" )
:FilterStart()
SetSAMGroup = SET_GROUP:New()
:FilterPrefixes( "SAM" )
:FilterStart()
:SetIteratorIntervals( 5, 10 )
SetGroundGroup = SET_GROUP:New()
:FilterCategories( "ground" )
:FilterStart()
SetGroundGroup:Flush()
SpawnUS_Plane = SPAWN:New( 'Spawn Test USA Plane')
GroupUS_Plane = SpawnUS_Plane:Spawn()
SpawnUS_Vehicle = SPAWN:New( 'Spawn Test USA Vehicle')
GroupUS_Vehicle = SpawnUS_Vehicle:Spawn()
SpawnUS_Ship = SPAWN:New( 'Spawn Test USA Ship')
GroupUS_Ship = SpawnUS_Ship:Spawn()
SpawnRU_Vehicle = SPAWN:New( 'Spawn Test RUSSIA Vehicle')
GroupRU_Vehicle = SpawnRU_Vehicle:Spawn()
SpawnRU_Ship = SPAWN:New( 'Spawn Test RUSSIA Ship')
GroupRU_Ship = SpawnRU_Ship:Spawn()
SpawnM2A2_AttackVehicle = SPAWN:New( 'Spawn Test M2A2 Attack Vehicle' ):InitRandomizeUnits( true, 10, 4 )
SpawnSAM_AttackVehicle = SPAWN:New( 'Spawn Test SAM Attack Vehicle' ):InitRandomizeUnits( true, 10, 4 )
for i = 1, 30 do
GroupM2A2_AttackVehicle = SpawnM2A2_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") )
GroupSAM_AttackVehicle = SpawnSAM_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") )
end
SetVehicleCompletely = SET_GROUP:New()
:FilterPrefixes( "Spawn Vehicle Zone Completely" )
:FilterStart()
SetVehiclePartly = SET_GROUP:New()
:FilterPrefixes( "Spawn Vehicle Zone Partly" )
:FilterStart()
SetVehicleNot = SET_GROUP:New()
:FilterPrefixes( "Spawn Vehicle Zone Not" )
:FilterStart()
Spawn_Vehicle_Zone_Completely = SPAWN:New( 'Spawn Vehicle Zone Completely' ):InitRandomizeUnits( true, 10, 4)
Spawn_Vehicle_Zone_Partly = SPAWN:New( 'Spawn Vehicle Zone Partly' ):InitRandomizeUnits( true, 10, 4 )
Spawn_Vehicle_Zone_Not = SPAWN:New( 'Spawn Vehicle Zone Not' ):InitRandomizeUnits( true, 10, 4 )
for i = 1, 30 do
Spawn_Vehicle_Zone_Completely:SpawnInZone( ZONE:New("Spawn Zone Completely") )
Spawn_Vehicle_Zone_Partly:SpawnInZone( ZONE:New("Spawn Zone Partly") )
Spawn_Vehicle_Zone_Not:SpawnInZone( ZONE:New("Spawn Zone Not") )
end
--DBBlue:TraceDatabase()
--SCHEDULER:New( DBBluePlanes, DBBluePlanes.Flush, { }, 1 )
--SCHEDULER:New( DBRedVehicles, DBRedVehicles.Flush, { }, 1 )
--SCHEDULER:New( DBShips, DBShips.Flush, { }, 1 )
--SCHEDULER:New( DBBelgium, DBBelgium.Flush, { }, 1 )
--SCHEDULER:New( DBNorthKorea, DBNorthKorea.Flush, { }, 1 )
--SCHEDULER:New( DBKA50Vinson, DBKA50Vinson.Flush, { }, 1 )
--
--SCHEDULER:New( DBBluePlanesGroup, DBBluePlanesGroup.Flush, { }, 1 )
--SCHEDULER:New( DBNorthKoreaGroup, DBNorthKoreaGroup.Flush, { }, 1 )
SetBluePlanesGroup:ForEachGroup(
--- @param Wrapper.Group#GROUP MooseGroup
function( MooseGroup )
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
local UnitAction = UnitData -- Wrapper.Unit#UNIT
UnitAction:SmokeBlue()
end
end
)
SetNorthKoreaGroup:ForEachGroup(
--- @param Wrapper.Group#GROUP MooseGroup
function( MooseGroup )
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
local UnitAction = UnitData -- Wrapper.Unit#UNIT
UnitAction:SmokeRed()
end
end
)
SetSAMGroup:ForEachGroup(
--- @param Wrapper.Group#GROUP MooseGroup
function( MooseGroup )
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
local UnitAction = UnitData -- Wrapper.Unit#UNIT
UnitAction:SmokeOrange()
end
end
)
GroupZoneCompletely = GROUP:FindByName( "Zone Completely" )
GroupZonePartly = GROUP:FindByName( "Zone Partly" )
GroupZoneNot = GROUP:FindByName( "Zone Not" )
ZoneCompletely = ZONE_POLYGON:New( "Zone Completely", GroupZoneCompletely ):SmokeZone( SMOKECOLOR.White )
ZonePartly = ZONE_POLYGON:New( "Zone Partly", GroupZonePartly ):SmokeZone( SMOKECOLOR.White )
ZoneNot = ZONE_POLYGON:New( "Zone Not", GroupZoneNot ):SmokeZone( SMOKECOLOR.White )
SetVehicleCompletely:ForEachGroupCompletelyInZone( ZoneCompletely,
--- @param Wrapper.Group#GROUP MooseGroup
function( MooseGroup )
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
local UnitAction = UnitData -- Wrapper.Unit#UNIT
UnitAction:SmokeBlue()
end
end
)
SetVehiclePartly:ForEachGroupPartlyInZone( ZonePartly,
--- @param Wrapper.Group#GROUP MooseGroup
function( MooseGroup )
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
local UnitAction = UnitData -- Wrapper.Unit#UNIT
UnitAction:SmokeBlue()
end
end
)
SetVehicleNot:ForEachGroupNotInZone( ZoneNot,
--- @param Wrapper.Group#GROUP MooseGroup
function( MooseGroup )
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
local UnitAction = UnitData -- Wrapper.Unit#UNIT
UnitAction:SmokeBlue()
end
end
)

View File

@@ -1,163 +1,163 @@
SetVehicles = SET_GROUP:New()
SetVehicles:AddGroupsByName( { "Vehicle A", "Vehicle B", "Vehicle C" } )
SetVehicles:ForEachGroup(
--- @param Wrapper.Group#GROUP MooseGroup
function( MooseGroup )
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
local UnitAction = UnitData -- Wrapper.Unit#UNIT
UnitAction:SmokeGreen()
end
end
)
SetBluePlanesGroup = SET_GROUP:New()
:FilterCoalitions( "blue" )
:FilterCategories( "plane" )
:FilterStart()
SetNorthKoreaGroup = SET_GROUP:New()
:FilterCountries( "RUSSIA" )
:FilterStart()
SetSAMGroup = SET_GROUP:New()
:FilterPrefixes( "SAM" )
:FilterStart()
:SetIteratorIntervals( 5, 10 )
SetGroundGroup = SET_GROUP:New()
:FilterCategories( "ground" )
:FilterStart()
SetGroundGroup:Flush()
SpawnUS_Plane = SPAWN:New( 'Spawn Test USA Plane')
GroupUS_Plane = SpawnUS_Plane:Spawn()
SpawnUS_Vehicle = SPAWN:New( 'Spawn Test USA Vehicle')
GroupUS_Vehicle = SpawnUS_Vehicle:Spawn()
SpawnUS_Ship = SPAWN:New( 'Spawn Test USA Ship')
GroupUS_Ship = SpawnUS_Ship:Spawn()
SpawnRU_Vehicle = SPAWN:New( 'Spawn Test RUSSIA Vehicle')
GroupRU_Vehicle = SpawnRU_Vehicle:Spawn()
SpawnRU_Ship = SPAWN:New( 'Spawn Test RUSSIA Ship')
GroupRU_Ship = SpawnRU_Ship:Spawn()
SpawnM2A2_AttackVehicle = SPAWN:New( 'Spawn Test M2A2 Attack Vehicle' ):InitRandomizeUnits( true, 10, 4 )
SpawnSAM_AttackVehicle = SPAWN:New( 'Spawn Test SAM Attack Vehicle' ):InitRandomizeUnits( true, 10, 4 )
for i = 1, 30 do
GroupM2A2_AttackVehicle = SpawnM2A2_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") )
GroupSAM_AttackVehicle = SpawnSAM_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") )
end
SetVehicleCompletely = SET_GROUP:New()
:FilterPrefixes( "Spawn Vehicle Zone Completely" )
:FilterStart()
SetVehiclePartly = SET_GROUP:New()
:FilterPrefixes( "Spawn Vehicle Zone Partly" )
:FilterStart()
SetVehicleNot = SET_GROUP:New()
:FilterPrefixes( "Spawn Vehicle Zone Not" )
:FilterStart()
Spawn_Vehicle_Zone_Completely = SPAWN:New( 'Spawn Vehicle Zone Completely' ):InitRandomizeUnits( true, 10, 4)
Spawn_Vehicle_Zone_Partly = SPAWN:New( 'Spawn Vehicle Zone Partly' ):InitRandomizeUnits( true, 10, 4 )
Spawn_Vehicle_Zone_Not = SPAWN:New( 'Spawn Vehicle Zone Not' ):InitRandomizeUnits( true, 10, 4 )
for i = 1, 30 do
Spawn_Vehicle_Zone_Completely:SpawnInZone( ZONE:New("Spawn Zone Completely") )
Spawn_Vehicle_Zone_Partly:SpawnInZone( ZONE:New("Spawn Zone Partly") )
Spawn_Vehicle_Zone_Not:SpawnInZone( ZONE:New("Spawn Zone Not") )
end
--DBBlue:TraceDatabase()
--SCHEDULER:New( DBBluePlanes, DBBluePlanes.Flush, { }, 1 )
--SCHEDULER:New( DBRedVehicles, DBRedVehicles.Flush, { }, 1 )
--SCHEDULER:New( DBShips, DBShips.Flush, { }, 1 )
--SCHEDULER:New( DBBelgium, DBBelgium.Flush, { }, 1 )
--SCHEDULER:New( DBNorthKorea, DBNorthKorea.Flush, { }, 1 )
--SCHEDULER:New( DBKA50Vinson, DBKA50Vinson.Flush, { }, 1 )
--
--SCHEDULER:New( DBBluePlanesGroup, DBBluePlanesGroup.Flush, { }, 1 )
--SCHEDULER:New( DBNorthKoreaGroup, DBNorthKoreaGroup.Flush, { }, 1 )
SetBluePlanesGroup:ForEachGroup(
--- @param Wrapper.Group#GROUP MooseGroup
function( MooseGroup )
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
local UnitAction = UnitData -- Wrapper.Unit#UNIT
UnitAction:SmokeBlue()
end
end
)
SetNorthKoreaGroup:ForEachGroup(
--- @param Wrapper.Group#GROUP MooseGroup
function( MooseGroup )
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
local UnitAction = UnitData -- Wrapper.Unit#UNIT
UnitAction:SmokeRed()
end
end
)
SetSAMGroup:ForEachGroup(
--- @param Wrapper.Group#GROUP MooseGroup
function( MooseGroup )
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
local UnitAction = UnitData -- Wrapper.Unit#UNIT
UnitAction:SmokeOrange()
end
end
)
GroupZoneCompletely = GROUP:FindByName( "Zone Completely" )
GroupZonePartly = GROUP:FindByName( "Zone Partly" )
GroupZoneNot = GROUP:FindByName( "Zone Not" )
ZoneCompletely = ZONE_POLYGON:New( "Zone Completely", GroupZoneCompletely ):SmokeZone( SMOKECOLOR.White )
ZonePartly = ZONE_POLYGON:New( "Zone Partly", GroupZonePartly ):SmokeZone( SMOKECOLOR.White )
ZoneNot = ZONE_POLYGON:New( "Zone Not", GroupZoneNot ):SmokeZone( SMOKECOLOR.White )
SetVehicleCompletely:ForEachGroupCompletelyInZone( ZoneCompletely,
--- @param Wrapper.Group#GROUP MooseGroup
function( MooseGroup )
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
local UnitAction = UnitData -- Wrapper.Unit#UNIT
UnitAction:SmokeBlue()
end
end
)
SetVehiclePartly:ForEachGroupPartlyInZone( ZonePartly,
--- @param Wrapper.Group#GROUP MooseGroup
function( MooseGroup )
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
local UnitAction = UnitData -- Wrapper.Unit#UNIT
UnitAction:SmokeBlue()
end
end
)
SetVehicleNot:ForEachGroupNotInZone( ZoneNot,
--- @param Wrapper.Group#GROUP MooseGroup
function( MooseGroup )
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
local UnitAction = UnitData -- Wrapper.Unit#UNIT
UnitAction:SmokeBlue()
end
end
)
SetVehicles = SET_GROUP:New()
SetVehicles:AddGroupsByName( { "Vehicle A", "Vehicle B", "Vehicle C" } )
SetVehicles:ForEachGroup(
--- @param Wrapper.Group#GROUP MooseGroup
function( MooseGroup )
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
local UnitAction = UnitData -- Wrapper.Unit#UNIT
UnitAction:SmokeGreen()
end
end
)
SetBluePlanesGroup = SET_GROUP:New()
:FilterCoalitions( "blue" )
:FilterCategories( "plane" )
:FilterStart()
SetNorthKoreaGroup = SET_GROUP:New()
:FilterCountries( "RUSSIA" )
:FilterStart()
SetSAMGroup = SET_GROUP:New()
:FilterPrefixes( "SAM" )
:FilterStart()
:SetIteratorIntervals( 5, 10 )
SetGroundGroup = SET_GROUP:New()
:FilterCategories( "ground" )
:FilterStart()
SetGroundGroup:Flush()
SpawnUS_Plane = SPAWN:New( 'Spawn Test USA Plane')
GroupUS_Plane = SpawnUS_Plane:Spawn()
SpawnUS_Vehicle = SPAWN:New( 'Spawn Test USA Vehicle')
GroupUS_Vehicle = SpawnUS_Vehicle:Spawn()
SpawnUS_Ship = SPAWN:New( 'Spawn Test USA Ship')
GroupUS_Ship = SpawnUS_Ship:Spawn()
SpawnRU_Vehicle = SPAWN:New( 'Spawn Test RUSSIA Vehicle')
GroupRU_Vehicle = SpawnRU_Vehicle:Spawn()
SpawnRU_Ship = SPAWN:New( 'Spawn Test RUSSIA Ship')
GroupRU_Ship = SpawnRU_Ship:Spawn()
SpawnM2A2_AttackVehicle = SPAWN:New( 'Spawn Test M2A2 Attack Vehicle' ):InitRandomizeUnits( true, 10, 4 )
SpawnSAM_AttackVehicle = SPAWN:New( 'Spawn Test SAM Attack Vehicle' ):InitRandomizeUnits( true, 10, 4 )
for i = 1, 30 do
GroupM2A2_AttackVehicle = SpawnM2A2_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") )
GroupSAM_AttackVehicle = SpawnSAM_AttackVehicle:SpawnInZone( ZONE:New("Spawn Zone") )
end
SetVehicleCompletely = SET_GROUP:New()
:FilterPrefixes( "Spawn Vehicle Zone Completely" )
:FilterStart()
SetVehiclePartly = SET_GROUP:New()
:FilterPrefixes( "Spawn Vehicle Zone Partly" )
:FilterStart()
SetVehicleNot = SET_GROUP:New()
:FilterPrefixes( "Spawn Vehicle Zone Not" )
:FilterStart()
Spawn_Vehicle_Zone_Completely = SPAWN:New( 'Spawn Vehicle Zone Completely' ):InitRandomizeUnits( true, 10, 4)
Spawn_Vehicle_Zone_Partly = SPAWN:New( 'Spawn Vehicle Zone Partly' ):InitRandomizeUnits( true, 10, 4 )
Spawn_Vehicle_Zone_Not = SPAWN:New( 'Spawn Vehicle Zone Not' ):InitRandomizeUnits( true, 10, 4 )
for i = 1, 30 do
Spawn_Vehicle_Zone_Completely:SpawnInZone( ZONE:New("Spawn Zone Completely") )
Spawn_Vehicle_Zone_Partly:SpawnInZone( ZONE:New("Spawn Zone Partly") )
Spawn_Vehicle_Zone_Not:SpawnInZone( ZONE:New("Spawn Zone Not") )
end
--DBBlue:TraceDatabase()
--SCHEDULER:New( DBBluePlanes, DBBluePlanes.Flush, { }, 1 )
--SCHEDULER:New( DBRedVehicles, DBRedVehicles.Flush, { }, 1 )
--SCHEDULER:New( DBShips, DBShips.Flush, { }, 1 )
--SCHEDULER:New( DBBelgium, DBBelgium.Flush, { }, 1 )
--SCHEDULER:New( DBNorthKorea, DBNorthKorea.Flush, { }, 1 )
--SCHEDULER:New( DBKA50Vinson, DBKA50Vinson.Flush, { }, 1 )
--
--SCHEDULER:New( DBBluePlanesGroup, DBBluePlanesGroup.Flush, { }, 1 )
--SCHEDULER:New( DBNorthKoreaGroup, DBNorthKoreaGroup.Flush, { }, 1 )
SetBluePlanesGroup:ForEachGroup(
--- @param Wrapper.Group#GROUP MooseGroup
function( MooseGroup )
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
local UnitAction = UnitData -- Wrapper.Unit#UNIT
UnitAction:SmokeBlue()
end
end
)
SetNorthKoreaGroup:ForEachGroup(
--- @param Wrapper.Group#GROUP MooseGroup
function( MooseGroup )
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
local UnitAction = UnitData -- Wrapper.Unit#UNIT
UnitAction:SmokeRed()
end
end
)
SetSAMGroup:ForEachGroup(
--- @param Wrapper.Group#GROUP MooseGroup
function( MooseGroup )
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
local UnitAction = UnitData -- Wrapper.Unit#UNIT
UnitAction:SmokeOrange()
end
end
)
GroupZoneCompletely = GROUP:FindByName( "Zone Completely" )
GroupZonePartly = GROUP:FindByName( "Zone Partly" )
GroupZoneNot = GROUP:FindByName( "Zone Not" )
ZoneCompletely = ZONE_POLYGON:New( "Zone Completely", GroupZoneCompletely ):SmokeZone( SMOKECOLOR.White )
ZonePartly = ZONE_POLYGON:New( "Zone Partly", GroupZonePartly ):SmokeZone( SMOKECOLOR.White )
ZoneNot = ZONE_POLYGON:New( "Zone Not", GroupZoneNot ):SmokeZone( SMOKECOLOR.White )
SetVehicleCompletely:ForEachGroupCompletelyInZone( ZoneCompletely,
--- @param Wrapper.Group#GROUP MooseGroup
function( MooseGroup )
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
local UnitAction = UnitData -- Wrapper.Unit#UNIT
UnitAction:SmokeBlue()
end
end
)
SetVehiclePartly:ForEachGroupPartlyInZone( ZonePartly,
--- @param Wrapper.Group#GROUP MooseGroup
function( MooseGroup )
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
local UnitAction = UnitData -- Wrapper.Unit#UNIT
UnitAction:SmokeBlue()
end
end
)
SetVehicleNot:ForEachGroupNotInZone( ZoneNot,
--- @param Wrapper.Group#GROUP MooseGroup
function( MooseGroup )
for UnitId, UnitData in pairs( MooseGroup:GetUnits() ) do
local UnitAction = UnitData -- Wrapper.Unit#UNIT
UnitAction:SmokeBlue()
end
end
)

View File

@@ -1,8 +1,8 @@
-- The mission contains templates, which are late activated groups. Only the active groups should be included.
-- It should count 3 groups in DCS.log.
SetGroup = SET_GROUP:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterActive():FilterOnce()
SetGroup:Flush()
SetGroup:I( { Count = SetGroup:Count() } )
MESSAGE:NewType( "There are " .. SetGroup:Count() .. " groups in the SetGroup.", MESSAGE.Type.Information ):ToAll()
-- The mission contains templates, which are late activated groups. Only the active groups should be included.
-- It should count 3 groups in DCS.log.
SetGroup = SET_GROUP:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterActive():FilterOnce()
SetGroup:Flush()
SetGroup:I( { Count = SetGroup:Count() } )
MESSAGE:NewType( "There are " .. SetGroup:Count() .. " groups in the SetGroup.", MESSAGE.Type.Information ):ToAll()

View File

@@ -1,8 +1,8 @@
-- The mission contains templates, which are late activated groups. All groups should be included.
-- It should count 7 groups in DCS.log.
SetGroup = SET_GROUP:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce()
SetGroup:Flush()
SetGroup:I( { Count = SetGroup:Count() } )
MESSAGE:NewType( "There are " .. SetGroup:Count() .. " groups in the SetGroup.", MESSAGE.Type.Information ):ToAll()
-- The mission contains templates, which are late activated groups. All groups should be included.
-- It should count 7 groups in DCS.log.
SetGroup = SET_GROUP:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce()
SetGroup:Flush()
SetGroup:I( { Count = SetGroup:Count() } )
MESSAGE:NewType( "There are " .. SetGroup:Count() .. " groups in the SetGroup.", MESSAGE.Type.Information ):ToAll()

View File

@@ -1,7 +1,7 @@
SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce()
SetUnit:Flush()
SetUnit:I(SetUnit:Count())
SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce()
SetUnit:Flush()
SetUnit:I(SetUnit:Count())

View File

@@ -1,12 +1,12 @@
SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce()
SetUnit:Flush()
SetUnit:I( { Count = SetUnit:Count() } )
SCHEDULER:New( nil,
function()
SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce()
SetUnit:Flush()
SetUnit:I( { Count = SetUnit:Count() } )
end, {}, 60 )
SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce()
SetUnit:Flush()
SetUnit:I( { Count = SetUnit:Count() } )
SCHEDULER:New( nil,
function()
SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce()
SetUnit:Flush()
SetUnit:I( { Count = SetUnit:Count() } )
end, {}, 60 )

View File

@@ -1,16 +1,16 @@
SCHEDULER:New( nil,
function()
SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce()
SetUnit:Flush()
SetUnit:I( { Count = SetUnit:Count() } )
end, {}, 0, 30 )
GroupPlanes = GROUP:FindByName( "Planes #001" )
GroupPlanes:HandleEvent( EVENTS.EngineShutdown )
function GroupPlanes:OnEventEngineShutdown( EventData )
EventData.IniUnit:Destroy()
SCHEDULER:New( nil,
function()
SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterOnce()
SetUnit:Flush()
SetUnit:I( { Count = SetUnit:Count() } )
end, {}, 0, 30 )
GroupPlanes = GROUP:FindByName( "Planes #001" )
GroupPlanes:HandleEvent( EVENTS.EngineShutdown )
function GroupPlanes:OnEventEngineShutdown( EventData )
EventData.IniUnit:Destroy()
end

View File

@@ -1,8 +1,8 @@
-- The mission contains templates, which are late activated groups. Only the active units should be included.
-- It should count 24 units in DCS.log.
SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterActive():FilterOnce()
SetUnit:Flush()
SetUnit:I( { Count = SetUnit:Count() } )
MESSAGE:NewType( "There are " .. SetUnit:Count() .. " units in the SetUnit.", MESSAGE.Type.Information ):ToAll()
-- The mission contains templates, which are late activated groups. Only the active units should be included.
-- It should count 24 units in DCS.log.
SetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterCategories("ground"):FilterActive():FilterOnce()
SetUnit:Flush()
SetUnit:I( { Count = SetUnit:Count() } )
MESSAGE:NewType( "There are " .. SetUnit:Count() .. " units in the SetUnit.", MESSAGE.Type.Information ):ToAll()