mirror of
https://github.com/FlightControl-Master/MOOSE_MISSIONS.git
synced 2025-08-15 10:37:46 +00:00
Updated Moose.lua
This commit is contained in:
@@ -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()
|
||||
@@ -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 )
|
||||
|
||||
|
||||
@@ -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 ) } )
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -1,58 +1,58 @@
|
||||
-------------------------------------------------------------------------
|
||||
-- SET-SCENERY-100 - Scenery Set From Zone
|
||||
-------------------------------------------------------------------------
|
||||
-- Documentation
|
||||
--
|
||||
-- SET_SCENERY: https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Set.html##(SET_SCENERY)
|
||||
--
|
||||
-------------------------------------------------------------------------
|
||||
-- Join the game master slot initially, and then the Tank in
|
||||
-- Combined Arms after a few seconds. Shoot and destroy on of the tanks
|
||||
-- ahead.
|
||||
-------------------------------------------------------------------------
|
||||
-- Date: November 2022
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
-- Get our ZONE object and draw it
|
||||
local zone = ZONE:FindByName("OilTankZone")
|
||||
zone:DrawZone(-1,{0,0,1},nil,nil,nil,1)
|
||||
-- Create a SET_SCENERY from the map objects in the zone
|
||||
local oilstation = SET_SCENERY:NewFromZone(zone)
|
||||
-- we'll use this SET for further filtering
|
||||
local oiltanks = SET_SCENERY:New()
|
||||
|
||||
-- An Airbase has a lot of map objects, but we only want to have tanks
|
||||
oilstation:ForEachScenery(
|
||||
function(object)
|
||||
local scenery = object --Wrapper.Scenery#SCENERY
|
||||
local name = scenery:GetName()
|
||||
local desc = scenery:GetDesc()
|
||||
BASE:I({desc.typeName})
|
||||
if string.find(string.lower(desc.typeName),"tank") then
|
||||
oiltanks:AddObject(scenery)
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
-- Count how many we have
|
||||
local NumberTanks0 = oiltanks:CountAlive()
|
||||
-- user flag OilTanks will be zero initially
|
||||
local flag = USERFLAG:New("OilTanks")
|
||||
flag:Set(0)
|
||||
|
||||
-- Function to check number of alive tanks regularly
|
||||
function CheckOnOilTanks(TankSet,InitialNo,Threshold)
|
||||
local NumberTanks = TankSet:CountAlive()
|
||||
MESSAGE:New("Oil Tanks alive: "..NumberTanks,15,"OilTanks"):ToAll()
|
||||
if NumberTanks <= InitialNo*Threshold then
|
||||
-- Success!
|
||||
MESSAGE:New("Success! Oil Tanks have been diminished!",15,"OilTanks"):ToAll()
|
||||
-- Set a Flag in Mission Editor
|
||||
flag:Set(999)
|
||||
end
|
||||
end
|
||||
|
||||
-- Create a timer to run the check function
|
||||
local TankTimer = TIMER:New(CheckOnOilTanks,oiltanks,NumberTanks0,0.2)
|
||||
-- check every minute
|
||||
TankTimer:Start(10,30,3600)
|
||||
-------------------------------------------------------------------------
|
||||
-- SET-SCENERY-100 - Scenery Set From Zone
|
||||
-------------------------------------------------------------------------
|
||||
-- Documentation
|
||||
--
|
||||
-- SET_SCENERY: https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Set.html##(SET_SCENERY)
|
||||
--
|
||||
-------------------------------------------------------------------------
|
||||
-- Join the game master slot initially, and then the Tank in
|
||||
-- Combined Arms after a few seconds. Shoot and destroy on of the tanks
|
||||
-- ahead.
|
||||
-------------------------------------------------------------------------
|
||||
-- Date: November 2022
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
-- Get our ZONE object and draw it
|
||||
local zone = ZONE:FindByName("OilTankZone")
|
||||
zone:DrawZone(-1,{0,0,1},nil,nil,nil,1)
|
||||
-- Create a SET_SCENERY from the map objects in the zone
|
||||
local oilstation = SET_SCENERY:NewFromZone(zone)
|
||||
-- we'll use this SET for further filtering
|
||||
local oiltanks = SET_SCENERY:New()
|
||||
|
||||
-- An Airbase has a lot of map objects, but we only want to have tanks
|
||||
oilstation:ForEachScenery(
|
||||
function(object)
|
||||
local scenery = object --Wrapper.Scenery#SCENERY
|
||||
local name = scenery:GetName()
|
||||
local desc = scenery:GetDesc()
|
||||
BASE:I({desc.typeName})
|
||||
if string.find(string.lower(desc.typeName),"tank") then
|
||||
oiltanks:AddObject(scenery)
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
-- Count how many we have
|
||||
local NumberTanks0 = oiltanks:CountAlive()
|
||||
-- user flag OilTanks will be zero initially
|
||||
local flag = USERFLAG:New("OilTanks")
|
||||
flag:Set(0)
|
||||
|
||||
-- Function to check number of alive tanks regularly
|
||||
function CheckOnOilTanks(TankSet,InitialNo,Threshold)
|
||||
local NumberTanks = TankSet:CountAlive()
|
||||
MESSAGE:New("Oil Tanks alive: "..NumberTanks,15,"OilTanks"):ToAll()
|
||||
if NumberTanks <= InitialNo*Threshold then
|
||||
-- Success!
|
||||
MESSAGE:New("Success! Oil Tanks have been diminished!",15,"OilTanks"):ToAll()
|
||||
-- Set a Flag in Mission Editor
|
||||
flag:Set(999)
|
||||
end
|
||||
end
|
||||
|
||||
-- Create a timer to run the check function
|
||||
local TankTimer = TIMER:New(CheckOnOilTanks,oiltanks,NumberTanks0,0.2)
|
||||
-- check every minute
|
||||
TankTimer:Start(10,30,3600)
|
||||
|
||||
@@ -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())
|
||||
|
||||
|
||||
@@ -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 )
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user