This commit is contained in:
FlightControl 2018-10-20 05:38:54 +02:00
commit 4a28f1f742
1328 changed files with 21039 additions and 0 deletions

81
.AppVeyor/appveyor.yml Normal file
View File

@ -0,0 +1,81 @@
version: 0.0.1.{build}
shallow_clone: false
skip_branch_with_pr: false
skip_commits:
message: /!nobuild/
skip_tags: false
environment:
access_token_documentation:
secure: JVBVVL8uJUcLXN+48eRdELEeCGOGCCaMzCqutsUqNuaZ/KblG5ZTt7+LV4UKv/0f
platform:
- x64
init:
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
throw "There are newer queued builds for this pull request, failing early." }
# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
install:
# Outcomment if lua environment invalidates and needs to be reinstalled, otherwise all will run from the cache.
- call choco install 7zip.commandline
cache:
- C:\ProgramData\chocolatey\lib
- C:\ProgramData\chocolatey\bin
build_script:
- ps: |
git checkout "$env:appveyor_repo_branch" 2>&1
git clone -q --depth=1 -b "$env:appveyor_repo_branch" https://github.com/FlightControl-Master/MOOSE_INCLUDE.git c:\Projects\Moose_Include
git clone -q --depth=1 -b "$env:appveyor_repo_branch" https://github.com/FlightControl-Master/MOOSE_MISSIONS_UNPACKED.git c:\Projects\Moose_Missions_Unpacked
dir c:\Projects
$Exclude=@("LICENSE","README.md","\.*")
Get-ChildItem . -directory -exclude "$Exclude" | git rm -r $_.FullName
dir
foreach( $file in Get-ChildItem "c:\Projects\Moose_Missions_Unpacked" -Filter Moose.lua -Recurse | % { $_.FullName } )
{
Write-Host "file : $file"
Copy-Item -Path c:\Projects\Moose_Include\Moose_Include_Static\Moose.lua -Destination $file
}
foreach( $dir_packed in Get-ChildItem "c:\Projects\Moose_Missions_Unpacked" -Filter _unpacked -Recurse -Directory | % { $_.FullName } )
{
Write-Host "dir_packed : $dir_packed"
$dir = $dir_packed.ToString().Replace( "\_unpacked","" )
$miz = $dir_packed.ToString().Replace( "\_unpacked","" )
$miz = $miz + "\" + ( Split-Path -Path "$miz" -Leaf )
$miz = $miz + ".miz"
Write-Host "miz : $miz"
$to_dir = $dir.Replace("C:\Projects\Moose_Missions_Unpacked\","")
Write-Host "to_dir : $to_dir"
7z a -r -y -tzip -bb0 "$miz" "$dir_packed/*" >$null 2>&1
Remove-Item -Path "$dir_packed" -Force -Recurse
Remove-Item -Path "$dir\*.bat" -Force -Recurse
#dir "$dir"
mkdir -Path "$to_dir" -Force
Copy-Item "$dir\*" -Destination "$to_dir" -Recurse -Force
}
echo "Commit to GITHUB"
git config --global credential.helper store
Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:access_token_documentation):x-oauth-basic@github.com`n"
git config --global user.email "sven.van.de.velde@telenet.be"
git config --global user.name "FlightControl-User"
git add . 2>&1
git commit -m "MOOSE demonstration missions [skip ci]" 2>&1
git push origin "$env:appveyor_repo_branch" 2>&1
dir
artifacts:
on_finish:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

13
.Clean/Clean.cmd Normal file
View File

@ -0,0 +1,13 @@
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .Appveyor/.
git add .Clean/.
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin https://github.com/FlightControl-Master/MOOSE_MISSIONS.git
git push -u --force origin master
git push -u --force origin develop

11
.project Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>MOOSE_MISSIONS</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>

View File

@ -0,0 +1,3 @@
local PlanesClientSet = SET_CLIENT:New():FilterCategories( "plane" ):FilterStart()
local AirbasePolice = AIRBASEPOLICE_CAUCASUS:New( PlanesClientSet )

View File

@ -0,0 +1,10 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
$dir
$file
cd "_unpacked"
. 7z a -r -y -tzip "..\$file.miz" *
cd ..

View File

@ -0,0 +1,7 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
Remove-Item .\_unpacked -Force -Recurse
md "_unpacked"
cd "_unpacked"
. 7z x -r -y "..\$file.miz" *

View File

@ -0,0 +1,3 @@
local PlanesClientSet = SET_CLIENT:New():FilterCategories( "plane" ):FilterStart()
local AirbasePolice = AIRBASEPOLICE_NEVADA:New( PlanesClientSet )

View File

@ -0,0 +1,10 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
$dir
$file
cd "_unpacked"
. 7z a -r -y -tzip "..\$file.miz" *
cd ..

View File

@ -0,0 +1,7 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
Remove-Item .\_unpacked -Force -Recurse
md "_unpacked"
cd "_unpacked"
. 7z x -r -y "..\$file.miz" *

View File

@ -0,0 +1,28 @@
---
-- Name: AIB-001 - Spawned AI
-- Author: FlightControl
-- Date Created: 07 Dec 2016
--
-- # Situation:
--
-- For the red coalition, 2 client slots are foreseen.
-- We test the AI spawning frequency, validating the number of spawned AI,
-- matching the amount of players that not have joined the mission.
-- When players join, AI should fly to the nearest home base.
--
-- # Test cases:
--
-- 1. If no player is logging into the red slots, 2 red AI planes should be alive.
-- 2. If a player joins one red slot, one red AI plane should return to the nearest home base.
-- 3. If two players join the red slots, no AI plane should be spawned, and all airborne AI planes should return to the nearest home base.
-- Define the SET of CLIENTs from the red coalition. This SET is filled during startup.
RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" )
-- Define the SPAWN object for the red AI plane template.
-- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off.
-- If a blocked plane exists, this red plane will be ReSpawned.
RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 )
-- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter.
RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn )

View File

@ -0,0 +1,10 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
$dir
$file
cd "_unpacked"
. 7z a -r -y -tzip "..\$file.miz" *
cd ..

View File

@ -0,0 +1,7 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
Remove-Item .\_unpacked -Force -Recurse
md "_unpacked"
cd "_unpacked"
. 7z x -r -y "..\$file.miz" *

View File

@ -0,0 +1,43 @@
-- Name: AIB-002 - Patrol AI.lua
-- Author: FlightControl
-- Date Created: 7 December 2016
--
-- # Situation:
--
-- For the red coalition, 2 client slots are foreseen.
-- For those players that have not joined the mission, red AI is spawned.
-- The red AI should start patrolling an area until fuel is empty and return to the home base.
--
-- # Test cases:
--
-- 1. If no player is logging into the red slots, 2 red AI planes should be alive.
-- 2. If a player joins one red slot, one red AI plane should return to the nearest home base.
-- 3. If two players join the red slots, no AI plane should be spawned, and all airborne AI planes should return to the nearest home base.
-- 4. Spawned AI should take-off from the airbase, and start patrolling the area around Anapa.
-- 5. When the AI is out-of-fuel, it should report it is returning to the home base, and land at Anapa.
-- Define the SET of CLIENTs from the red coalition. This SET is filled during startup.
RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" )
-- Define the SPAWN object for the red AI plane template.
-- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off.
-- If a blocked plane exists, this red plane will be ReSpawned.
RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 )
-- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter.
RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn )
local PatrolZones = {}
function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
local PatrolZoneGroup = GROUP:FindByName( "PatrolZone" )
local PatrolZone = ZONE_POLYGON:New( "PatrolZone", PatrolZoneGroup )
PatrolZones[AIGroup] = AI_PATROL_ZONE:New( PatrolZone, 3000, 6000, 400, 600 )
PatrolZones[AIGroup]:ManageFuel( 0.2, 60 )
PatrolZones[AIGroup]:SetControllable( AIGroup )
PatrolZones[AIGroup]:__Start( 5 )
end

View File

@ -0,0 +1,10 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
$dir
$file
cd "_unpacked"
. 7z a -r -y -tzip "..\$file.miz" *
cd ..

View File

@ -0,0 +1,7 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
Remove-Item .\_unpacked -Force -Recurse
md "_unpacked"
cd "_unpacked"
. 7z x -r -y "..\$file.miz" *

View File

@ -0,0 +1,24 @@
RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" )
RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 )
RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn )
RU_AirbasesSet = SET_AIRBASE:New():FilterCoalitions("red"):FilterStart()
RU_AirbasesSet:Flush()
RU_AI_Balancer:ReturnToNearestAirbases( 10000, RU_AirbasesSet )
US_PlanesClientSet = SET_CLIENT:New():FilterCountries( "USA" ):FilterCategories( "plane" )
US_PlanesSpawn = SPAWN:New( "AI US" ):InitCleanUp( 20 )
US_AI_Balancer = AI_BALANCER:New( US_PlanesClientSet, US_PlanesSpawn )
--RU_AI_Balancer:ReturnToHomeAirbase( 10000 )
--local PatrolZoneGroup = GROUP:FindByName( "Patrol Zone Blue" )
--local PatrolZoneBlue = ZONE_POLYGON:New( "PatrolZone", PatrolZoneGroup )
--local PatrolZoneB = AI_PATROL_ZONE:New( PatrolZoneBlue, 3000, 6000, 900, 1100 ):ManageFuel( 0.2, 180 )
--US_AI_Balancer:SetPatrolZone( PatrolZoneB )
--
--local PatrolZoneGroup = GROUP:FindByName( "Patrol Zone Red" )
--local PatrolZoneRed = ZONE_POLYGON:New( "PatrolZone", PatrolZoneGroup )
--local PatrolZoneR = AI_PATROL_ZONE:New( PatrolZoneRed, 3000, 6000, 900, 1100 ):ManageFuel( 0.2, 180 )
--RU_AI_Balancer:SetPatrolZone( PatrolZoneR )

View File

@ -0,0 +1,10 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
$dir
$file
cd "_unpacked"
. 7z a -r -y -tzip "..\$file.miz" *
cd ..

View File

@ -0,0 +1,7 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
Remove-Item .\_unpacked -Force -Recurse
md "_unpacked"
cd "_unpacked"
. 7z x -r -y "..\$file.miz" *

View File

@ -0,0 +1,47 @@
-- Name: AIB-004 - Respawn Test when Destroyed.lua
-- Author: FlightControl
-- Date Created: 7 January 2017
--
-- # Situation:
--
-- For the red coalition, 2 client slots are foreseen.
-- For those players that have not joined the mission, red AI is spawned.
-- The red AI should start patrolling an area.
--
-- The blue side has SAMs nearby.
-- Once the red AI takes off, the red AI is attacked by the blue SAMs.
-- Red AI should be killed and once that happens, a Respawn of the group should happen!
-- The Respawn happens through the InitCleanUp() API of SPAWN.
--
-- # Test cases:
--
-- 1. If no player is logging into the red slots, 2 red AI planes should be alive.
-- 2. If a player joins one red slot, one red AI plane should return to the nearest home base.
-- 3. If two players join the red slots, no AI plane should be spawned, and all airborne AI planes should return to the nearest home base.
-- 4. Monitor that once a red AI is destroyed, that it ReSpawns...
-- Define the SET of CLIENTs from the red coalition. This SET is filled during startup.
RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" )
-- Define the SPAWN object for the red AI plane template.
-- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off.
-- If a blocked plane exists, this red plane will be ReSpawned.
RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 )
-- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter.
RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn )
function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
local PatrolZoneGroup = GROUP:FindByName( "PatrolZone" )
local PatrolZone = ZONE_POLYGON:New( "PatrolZone", PatrolZoneGroup )
local Patrol = AI_PATROL_ZONE:New( PatrolZone, 3000, 6000, 400, 600 )
Patrol:ManageFuel( 0.2, 60 )
Patrol:SetControllable( AIGroup )
Patrol:__Start( 5 )
end

View File

@ -0,0 +1,10 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
$dir
$file
cd "_unpacked"
. 7z a -r -y -tzip "..\$file.miz" *
cd ..

View File

@ -0,0 +1,7 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
Remove-Item .\_unpacked -Force -Recurse
md "_unpacked"
cd "_unpacked"
. 7z x -r -y "..\$file.miz" *

View File

@ -0,0 +1,51 @@
-- Name: AIB-005 - Patrol AI and Randomize Zones
-- Author: FlightControl
-- Date Created: 10 Jan 2016
--
-- # Situation:
--
-- For the red coalition, 2 client slots are foreseen.
-- For those players that have not joined the mission, red AI is spawned.
-- The red AI should start patrolling an area until fuel is empty and return to the home base.
-- For each AI being spawned, ensure that they fly to a random zone defined within the mission editor.
-- Right now there are two patrol zones defined, so the AI should start patrolliing in one of these zones.
--
-- # Test cases:
--
-- 1. If no player is logging into the red slots, 2 red AI planes should be alive.
-- 2. If a player joins one red slot, one red AI plane should return to the nearest home base.
-- 3. If two players join the red slots, no AI plane should be spawned, and all airborne AI planes should return to the nearest home base.
-- 4. Spawned AI should take-off from the airbase, and start patrolling the area around Anapa.
-- 5. When the AI is out-of-fuel, it should report it is returning to the home base, and land at Anapa.
-- 6. Ensure that you see the AI patrol in one of the two zones ...
-- Define the SET of CLIENTs from the red coalition. This SET is filled during startup.
RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" )
-- Define the SPAWN object for the red AI plane template.
-- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off.
-- If a blocked plane exists, this red plane will be ReSpawned.
RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 )
-- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter.
RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn )
-- Create the first polygon zone ...
PatrolZoneGroup1 = GROUP:FindByName( "PatrolZone1" )
PatrolZone1 = ZONE_POLYGON:New( "PatrolZone1", PatrolZoneGroup1 )
-- Create the second polygon zone ...
PatrolZoneGroup2 = GROUP:FindByName( "PatrolZone2" )
PatrolZone2 = ZONE_POLYGON:New( "PatrolZone2", PatrolZoneGroup2 )
-- Now, create an array of these zones ...
PatrolZoneArray = { PatrolZone1, PatrolZone2 }
function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
local Patrol = AI_PATROL_ZONE:New( PatrolZoneArray[math.random( 1, 2 )], 3000, 6000, 400, 600 )
Patrol:ManageFuel( 0.2, 60 )
Patrol:SetControllable( AIGroup )
Patrol:Start()
end

View File

@ -0,0 +1,10 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
$dir
$file
cd "_unpacked"
. 7z a -r -y -tzip "..\$file.miz" *
cd ..

View File

@ -0,0 +1,7 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
Remove-Item .\_unpacked -Force -Recurse
md "_unpacked"
cd "_unpacked"
. 7z x -r -y "..\$file.miz" *

View File

@ -0,0 +1,43 @@
-- Name: AIB-005 - Patrol AI and Randomize Zones
-- Author: FlightControl
-- Date Created: 10 Jan 2016
--
-- # Situation:
--
-- For the red coalition, 2 client slots are foreseen.
-- For those players that have not joined the mission, red AI is spawned.
-- You'll notice a lot of AI is being spawned, as there are a lot of slots...
-- If the SPAWN API :InitCleanUp( secs ) is NOT used, you'll notice that the planes block each other on the runway.
-- After a short period of time, nothing will move anymore...
-- The :InitCleanUp( seconds ) API of the SPAWN class ensure that any AI that is parked longer than the
-- specified amount of seconds, is respawned back at the parking position.
-- This frees up the other planes departing, and the airbase is in this way decluttered...
--
-- # Test cases:
--
-- 1. Observe the de-cluttering of planes at Krymsk.
-- 2. Play with the InitCleanUp API of the SPAWN class, extende the amount of seconds to find the optimal setting.
-- Define the SET of CLIENTs from the red coalition. This SET is filled during startup.
RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" )
-- Define the SPAWN object for the red AI plane template.
-- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off.
-- If a blocked plane exists, this red plane will be ReSpawned.
RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 )
-- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter.
RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn )
-- Create the first polygon zone ...
PatrolZoneGroup1 = GROUP:FindByName( "PatrolZone1" )
PatrolZone1 = ZONE_POLYGON:New( "PatrolZone1", PatrolZoneGroup1 )
function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
local Patrol = AI_PATROL_ZONE:New( PatrolZone1, 3000, 6000, 400, 600 )
Patrol:ManageFuel( 0.2, 60 )
Patrol:SetControllable( AIGroup )
Patrol:__Start( 5 )
end

View File

@ -0,0 +1,10 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
$dir
$file
cd "_unpacked"
. 7z a -r -y -tzip "..\$file.miz" *
cd ..

View File

@ -0,0 +1,7 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
Remove-Item .\_unpacked -Force -Recurse
md "_unpacked"
cd "_unpacked"
. 7z x -r -y "..\$file.miz" *

View File

@ -0,0 +1,163 @@
-- Name: AIB-007 - AI Balancers For all airports and both coalitions
-- Author: Delta99
-- Date Created: 11 Feb 2017
--
-- Originally created to solve issues jg7xman (from Moose Slack group) was having in creating
-- AI_BALANCER across multiple airbases.
-- # Situation:
--
-- AI_BALANCERS created per airbase for both coalitions. Mutiple patrol zones are created
-- for each side. Each flight that is created by AI_BALANCER will pick a random patrol zone
-- to patrol.
-- # Test Cases
--
-- 1. Observe at least 1 flight spawning and taking off from each airbase.
-- 2. Each flight patrols randomly in one of its sides zones.
-- 3. AI will respawn after killed.
-- 4. Additional client slots are available at Sochi. If players don't take a slot there
-- will be more than one AI taking off from Sochi.
-- 5. Batumi contains a flight of 3 units rather than just 1 like most of the rest of the airbases.
-- 6. Watch the coalition AI clash and kill each other.
-- Create the Red Patrol Zone Array
-- This zone array will be used in the AI_BALANCER to randomize the patrol
-- zone that each spawned group will patrol
RedPatrolZone = {}
RedPatrolZone[1] = ZONE:New( "RedPatrolZone1" )
RedPatrolZone[2] = ZONE:New( "RedPatrolZone2" )
RedPatrolZone[3] = ZONE:New( "RedPatrolZone3" )
RedPatrolZone[4] = ZONE:New( "RedPatrolZone4" )
RedPatrolZone[5] = ZONE:New( "RedPatrolZone5" )
RedPatrolZone[6] = ZONE:New( "RedPatrolZone6" )
-- Russian CAP Aircraft
-- These are the aircraft created in the mission editor that the AI will spawn
-- with replacing any CLIENT created aircraft in the mission that a human
-- player does not take.
RU_PlanesSpawn = {}
RU_PlanesSpawn[1] = SPAWN:New( "RU CAP Anapa AB" ):InitCleanUp( 45 )
RU_PlanesSpawn[2] = SPAWN:New( "RU CAP Beslan AB" ):InitCleanUp( 45 )
RU_PlanesSpawn[3] = SPAWN:New( "RU CAP Gelendzhik AB" ):InitCleanUp( 45 )
RU_PlanesSpawn[4] = SPAWN:New( "RU CAP Krasnodar Center AB" ):InitCleanUp( 45 )
RU_PlanesSpawn[5] = SPAWN:New( "RU CAP Krasnodar Pashkovsky AB" ):InitCleanUp( 45 )
RU_PlanesSpawn[6] = SPAWN:New( "RU CAP Krymsk AB" ):InitCleanUp( 45 )
RU_PlanesSpawn[7] = SPAWN:New( "RU CAP Maykop AB" ):InitCleanUp( 45 )
RU_PlanesSpawn[8] = SPAWN:New( "RU CAP Mineralnye Vody AB" ):InitCleanUp( 45 )
RU_PlanesSpawn[9] = SPAWN:New( "RU CAP Mozdok AB" ):InitCleanUp( 45 )
RU_PlanesSpawn[10] = SPAWN:New( "RU CAP Nalchik AB" ):InitCleanUp( 45 )
RU_PlanesSpawn[11] = SPAWN:New( "RU CAP Novorossiysk AB" ):InitCleanUp( 45 )
-- Russian Client Aircraft (via AI_BALANCER, AI will replace these if no human players are in the slot)
-- If you want more client slots per airbase that you want AI to be able to take control of then
-- name them with the prefixes below and they will be picked up automatically by FilterPrevixes.
--
-- For example, if you want another Client slot available at Anapa name it "RU CLIENT Anapa AB 2".
-- The code here does not need to be changed. Only an addition in the mission editor. An example
-- of this can be found on the USA side at Sochi AB.
RU_PlanesClientSet = {}
RU_PlanesClientSet[1] = SET_CLIENT:New():FilterPrefixes("RU CLIENT Anapa AB")
RU_PlanesClientSet[2] = SET_CLIENT:New():FilterPrefixes("RU CLIENT Beslan AB")
RU_PlanesClientSet[3] = SET_CLIENT:New():FilterPrefixes("RU CLIENT Gelendzhik AB")
RU_PlanesClientSet[4] = SET_CLIENT:New():FilterPrefixes("RU CLIENT Krasnodar Center AB")
RU_PlanesClientSet[5] = SET_CLIENT:New():FilterPrefixes("RU CLIENT Krasnodar Pashkovsky AB")
RU_PlanesClientSet[6] = SET_CLIENT:New():FilterPrefixes("RU CLIENT Krymsk AB")
RU_PlanesClientSet[7] = SET_CLIENT:New():FilterPrefixes("RU CLIENT Maykop AB")
RU_PlanesClientSet[8] = SET_CLIENT:New():FilterPrefixes("RU CLIENT Mineralnye Vody AB")
RU_PlanesClientSet[9] = SET_CLIENT:New():FilterPrefixes("RU CLIENT Mozdok AB")
RU_PlanesClientSet[10] = SET_CLIENT:New():FilterPrefixes("RU CLIENT Nalchik AB")
RU_PlanesClientSet[11] = SET_CLIENT:New():FilterPrefixes("RU CLIENT Novorossiysk AB")
-- We setup an array to store all the AI_BALANCERS that are going to be created. Basically one
-- per airbase. We loop through and create an AI_BALANCER as well as a separate OnAfterSpawned
-- function for each. The Patrol Zone is randomized in the first parameter to AI_PATROL_ZONE:New()
-- call. This is done for each of the AI_BALANCERS. To add more patrol zones, just define them in
-- the mission editor and add into the array above. Code here does not need to be changed. The
-- table.getn(RedPatrolZone) gets the number of elements in the RedPatrolZone array so that all
-- of them are included to pick randomly.
RU_AI_Balancer = {}
for i=1, 11 do
RU_AI_Balancer[i] = AI_BALANCER:New(RU_PlanesClientSet[i], RU_PlanesSpawn[i])
-- We set a local variable within the for loop to the AI_BALANCER that was just created.
-- I couldn't get RU_AI_BALANCER[i]:OnAfterSpawn to be recognized so this is just pointing
-- curAIBalancer to the relevant RU_AI_BALANCER array item for each loop.
-- So in this case there are essentially 11 OnAfterSpawned functions defined and handled.
local curAIBalancer = RU_AI_Balancer[i]
function curAIBalancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
local Patrol = AI_PATROL_ZONE:New( RedPatrolZone[math.random( 1, table.getn(RedPatrolZone))], 1500, 5500, 700, 1400 )
Patrol:ManageFuel( 0.2, 60 )
Patrol:SetControllable( AIGroup )
Patrol:Start()
end
end
-- US / Blue side is setup pretty much identically to the RU side above. Same detailed comments
-- above apply here. The main difference here is 10 airbases instead of 11.
-- Another difference is additional client slots at Sochi and a group defined at Batumi with
-- more than 1 unit per group (flight of 3 units). This is just to show that you can have more
-- client slots per airbase and more units in a single group that the AI will control. I think
-- this will also allow you to fly lead with AI on your wing or you can fly wing with an AI
-- leader.
-- Create the Blue Patrol Zone Array
BluePatrolZone = {}
BluePatrolZone[1] = ZONE:New( "BluePatrolZone1")
BluePatrolZone[2] = ZONE:New( "BluePatrolZone2")
BluePatrolZone[3] = ZONE:New( "BluePatrolZone3")
BluePatrolZone[4] = ZONE:New( "BluePatrolZone4")
BluePatrolZone[5] = ZONE:New( "BluePatrolZone5")
BluePatrolZone[6] = ZONE:New( "BluePatrolZone6")
--United States CAP Aircraft (these are used as templates for AI)
US_PlanesSpawn = {}
US_PlanesSpawn[1] = SPAWN:New( "US CAP Batumi AB" ):InitCleanUp( 45 )
US_PlanesSpawn[2] = SPAWN:New( "US CAP Gudauta AB" ):InitCleanUp( 45 )
US_PlanesSpawn[3] = SPAWN:New( "US CAP Kobuleti AB" ):InitCleanUp( 45 )
US_PlanesSpawn[4] = SPAWN:New( "US CAP Kutaisi AB" ):InitCleanUp( 45 )
US_PlanesSpawn[5] = SPAWN:New( "US CAP Senaki AB" ):InitCleanUp( 45 )
US_PlanesSpawn[6] = SPAWN:New( "US CAP Sochi AB" ):InitCleanUp( 45 )
US_PlanesSpawn[7] = SPAWN:New( "US CAP Soganlug AB" ):InitCleanUp( 45 )
US_PlanesSpawn[8] = SPAWN:New( "US CAP Sukhumi AB" ):InitCleanUp( 45 )
US_PlanesSpawn[9] = SPAWN:New( "US CAP Vaziani AB" ):InitCleanUp( 45 )
US_PlanesSpawn[10] = SPAWN:New( "US CAP Tbilisi AB" ):InitCleanUp( 45 )
--United States Client Aircraft (via AI_BALANCER, AI will replace these if no human players are in the slot)
US_PlanesClientSet = {}
US_PlanesClientSet[1] = SET_CLIENT:New():FilterPrefixes("US CLIENT Batumi AB")
US_PlanesClientSet[2] = SET_CLIENT:New():FilterPrefixes("US CLIENT Gudauta AB")
US_PlanesClientSet[3] = SET_CLIENT:New():FilterPrefixes("US CLIENT Kobuleti AB")
US_PlanesClientSet[4] = SET_CLIENT:New():FilterPrefixes("US CLIENT Kutaisi AB")
US_PlanesClientSet[5] = SET_CLIENT:New():FilterPrefixes("US CLIENT Senaki AB")
US_PlanesClientSet[6] = SET_CLIENT:New():FilterPrefixes("US CLIENT Sochi AB")
US_PlanesClientSet[7] = SET_CLIENT:New():FilterPrefixes("US CLIENT Soganlug AB")
US_PlanesClientSet[8] = SET_CLIENT:New():FilterPrefixes("US CLIENT Sukhumi AB")
US_PlanesClientSet[9] = SET_CLIENT:New():FilterPrefixes("US CLIENT Vaziani AB")
US_PlanesClientSet[10] = SET_CLIENT:New():FilterPrefixes("US CLIENT Tbilisi AB")
US_AI_Balancer = {}
for i=1, 10 do
US_AI_Balancer[i] = AI_BALANCER:New( US_PlanesClientSet[i], US_PlanesSpawn[i] )
local curAIBalancer = US_AI_Balancer[i]
function curAIBalancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
local Patrol = AI_PATROL_ZONE:New( BluePatrolZone[math.random( 1, table.getn(BluePatrolZone))], 1500, 5500, 700, 1400 )
Patrol:ManageFuel( 0.2, 60 )
Patrol:SetControllable( AIGroup )
Patrol:Start()
end
end

View File

@ -0,0 +1,10 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
$dir
$file
cd "_unpacked"
. 7z a -r -y -tzip "..\$file.miz" *
cd ..

View File

@ -0,0 +1,7 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
Remove-Item .\_unpacked -Force -Recurse
md "_unpacked"
cd "_unpacked"
. 7z x -r -y "..\$file.miz" *

View File

@ -0,0 +1,18 @@
---
-- Name: AIC-APC-000 - APC
-- Author: FlightControl
-- Date Created: 26 Mar 2018
--
-- A demonstration of the AI_CARGO_APC class.
-- This simple example transports Infantry.
-- The CARGO_GROUP objects are declared within the mission script.
local Infantry1 = CARGO_GROUP:New( GROUP:FindByName( "Infantry1" ), "Infantry", "Infantry1", 500, 25 )
local Infantry2 = CARGO_GROUP:New( GROUP:FindByName( "Infantry2" ), "Infantry", "Infantry2", 500, 25 )
local Infantry3 = CARGO_GROUP:New( GROUP:FindByName( "Infantry3" ), "Infantry", "Infantry3", 500, 25 )
local InfantryCargoSet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart()
local APC = GROUP:FindByName( "APC" )
AICargoAPC = AI_CARGO_APC:New( APC, InfantryCargoSet, 500 )
AICargoAPC:__Pickup( 5 )

View File

@ -0,0 +1,10 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
$dir
$file
cd "_unpacked"
. 7z a -r -y -tzip "..\$file.miz" *
cd ..

View File

@ -0,0 +1,7 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
Remove-Item .\_unpacked -Force -Recurse
md "_unpacked"
cd "_unpacked"
. 7z x -r -y "..\$file.miz" *

View File

@ -0,0 +1,16 @@
---
-- Name: AIC-APC-001 - APC with Cargo declared in ME
-- Author: FlightControl
-- Date Created: 26 Mar 2018
--
-- A demonstration of the AI_CARGO_APC class.
-- This simple example transports Infantry.
-- The cargo is declared with the ~CARGO tag in the mission editor.
-- So, within the mission, the infantry groups have the name:
--
local InfantryCargoSet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart()
local APC = GROUP:FindByName( "APC" )
AICargoAPC = AI_CARGO_APC:New( APC, InfantryCargoSet, 500 )
AICargoAPC:__Pickup( 5 )

View File

@ -0,0 +1,10 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
$dir
$file
cd "_unpacked"
. 7z a -r -y -tzip "..\$file.miz" *
cd ..

View File

@ -0,0 +1,7 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
Remove-Item .\_unpacked -Force -Recurse
md "_unpacked"
cd "_unpacked"
. 7z x -r -y "..\$file.miz" *

View File

@ -0,0 +1,12 @@
---
-- Name: AIC-APC-002 - APC Move by Game Master
-- Author: FlightControl
-- Date Created: 26 Mar 2018
--
local InfantryCargoSet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart()
local CargoCarrier = GROUP:FindByName( "Carrier" )
CargoTroops = AI_CARGO_APC:New( CargoCarrier, InfantryCargoSet, 500 )

View File

@ -0,0 +1,10 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
$dir
$file
cd "_unpacked"
. 7z a -r -y -tzip "..\$file.miz" *
cd ..

View File

@ -0,0 +1,7 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
Remove-Item .\_unpacked -Force -Recurse
md "_unpacked"
cd "_unpacked"
. 7z x -r -y "..\$file.miz" *

View File

@ -0,0 +1,14 @@
---
-- Name: AIC-APC-003 - APC Troops and Equipment
-- Author: FlightControl
-- Date Created: 07 Apr 2018
--
local InfantryCargoSet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart()
local CargoCarrier = GROUP:FindByName( "Carrier" )
CargoTroops = AI_CARGO_APC:New( CargoCarrier, InfantryCargoSet, 350 )

View File

@ -0,0 +1,10 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
$dir
$file
cd "_unpacked"
. 7z a -r -y -tzip "..\$file.miz" *
cd ..

View File

@ -0,0 +1,7 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
Remove-Item .\_unpacked -Force -Recurse
md "_unpacked"
cd "_unpacked"
. 7z x -r -y "..\$file.miz" *

View File

@ -0,0 +1,26 @@
---
-- Name: AIC-APC-004 - APC Pickup
-- Author: FlightControl
-- Date Created: 23 Apr 2018
--
local InfantryCargoSet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart()
local APC = GROUP:FindByName( "APC" )
Cargo_APC = AI_CARGO_APC:New( APC, InfantryCargoSet, 350 )
Cargo_APC:__Pickup( 1, ZONE:New( "Pickup" ):GetCoordinate() )
--- Loaded Handler OnAfter for Cargo_APC
-- @function [parent=#Cargo_APC] OnAfterLoaded
-- @param #Cargo_APC self
-- @param Wrapper.Group#GROUP APC
-- @param #string From
-- @param #string Event
-- @param #string To
function Cargo_APC:OnAfterLoaded( APC, From, Event, To )
Cargo_APC:Deploy( ZONE:New( "Deploy" ):GetCoordinate() )
end

View File

@ -0,0 +1,10 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
$dir
$file
cd "_unpacked"
. 7z a -r -y -tzip "..\$file.miz" *
cd ..

View File

@ -0,0 +1,7 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
Remove-Item .\_unpacked -Force -Recurse
md "_unpacked"
cd "_unpacked"
. 7z x -r -y "..\$file.miz" *

View File

@ -0,0 +1,24 @@
---
-- Name: AIC-APC-001 - Troops Relocate APC
-- Author: FlightControl
-- Date Created: 07 Apr 2018
--
-- Demonstration of troops relocation when carrier is destroyed...
-- Carrier will relocate to the rescue carrier.
local InfantryCargoSet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart()
local CargoCarrier = GROUP:FindByName( "Carrier" )
CargoTroops = AI_CARGO_APC:New( CargoCarrier, InfantryCargoSet, 500 )
function CargoTroops:OnAfterDestroyed( CargoCarrier )
CargoTroops:F( { Destroyed = CargoCarrier } )
-- The coordinate is passed where the carrier is destroyed.
local NewCarrierGroup = self:FindCarrier( CargoCarrier:GetCoordinate(), 1000 ) -- which returns one Carrier GROUP object or nil.
if NewCarrierGroup then
self:SetCarrier( NewCarrierGroup )
end
end

View File

@ -0,0 +1,10 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
$dir
$file
cd "_unpacked"
. 7z a -r -y -tzip "..\$file.miz" *
cd ..

View File

@ -0,0 +1,7 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
Remove-Item .\_unpacked -Force -Recurse
md "_unpacked"
cd "_unpacked"
. 7z x -r -y "..\$file.miz" *

View File

@ -0,0 +1,13 @@
---
-- Name: AIC-APC-010 - Multiple APC
-- Author: FlightControl
-- Date Created: 24 Apr 2018
--
local InfantrySet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart()
local APC = GROUP:FindByName( "APC" )
Cargo_APC = AI_CARGO_APC:New( APC, InfantrySet, 250 )
Cargo_APC:__Pickup( 2 )

View File

@ -0,0 +1,6 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
cd "_unpacked"
. 7z a -r -y -tzip "..\$file.miz" *
cd ..

View File

@ -0,0 +1,7 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
Remove-Item .\_unpacked -Force -Recurse
md "_unpacked"
cd "_unpacked"
. 7z x -r -y "..\$file.miz" *

View File

@ -0,0 +1,42 @@
---
-- Name: AIC-APC-004 - APC Pickup
-- Author: FlightControl
-- Date Created: 23 Apr 2018
--
local InfantryCargoSet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart()
Cargo_APC = {}
for i = 1, 4 do
Cargo_APC[i] = AI_CARGO_APC:New( GROUP:FindByName( "APC"..i ), InfantryCargoSet, 350 )
--- Loaded Handler OnAfter for Cargo_APC
-- @function [parent=#Cargo_APC] OnAfterLoaded
-- @param #Cargo_APC self
-- @param Wrapper.Group#GROUP APC
-- @param #string From
-- @param #string Event
-- @param #string To
Cargo_APC[i].OnAfterLoaded = function( self, APC, From, Event, To )
self:Deploy( ZONE:New( "Deploy" ):GetRandomCoordinate( 300, 500 ), 70, "Line abreast" )
end
--- Unloaded Handler OnAfter for Cargo_APC
-- @function [parent=#Cargo_APC] OnAfterUnloaded
-- @param #Cargo_APC self
-- @param Wrapper.Group#GROUP APC
-- @param #string From
-- @param #string Event
-- @param #string To
Cargo_APC[i].OnAfterUnloaded = function( self, APC, From, Event, To )
self:Pickup( ZONE:New( "Pickup" ):GetRandomCoordinate( 50, 70 ), 70, "Line abreast" )
end
Cargo_APC[i]:__Pickup( i * 120, ZONE:New( "Pickup" ):GetRandomCoordinate( 50, 70 ), 70, "Line abreast" )
end

View File

@ -0,0 +1,10 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
$dir
$file
cd "_unpacked"
. 7z a -r -y -tzip "..\$file.miz" *
cd ..

View File

@ -0,0 +1,7 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
Remove-Item .\_unpacked -Force -Recurse
md "_unpacked"
cd "_unpacked"
. 7z x -r -y "..\$file.miz" *

View File

@ -0,0 +1,34 @@
---
-- Name: AIC-HEL-000 - Helicopter
-- Author: FlightControl
-- Date Created: 13 Apr 2018
--
WorkerCargoSet = SET_CARGO:New():FilterTypes( "Workers" ):FilterStart()
for i = 1, 10 do
local WorkerGroup = GROUP:FindByName( string.format( "Infantry#%03d", i ) )
local WorkersCargo = CARGO_GROUP:New( WorkerGroup, "Workers", string.format( "Infantry %d", i ), 1000, 35 )
end
local Helicopter = GROUP:FindByName( "Helicopter" )
CargoHelicopter = AI_CARGO_HELICOPTER:New( Helicopter, WorkerCargoSet )
PickupZone = ZONE:New( "PickupZone" )
DeployZones = { ZONE:New( "DeployZone Alpha" ), ZONE:New( "DeployZone Beta" ), ZONE:New( "DeployZone Gamma" ) }
CargoHelicopter:Pickup( PickupZone:GetRandomCoordinate( 500, 200 ) )
function CargoHelicopter:onafterLoaded( Helicopter, From, Event, To, Cargo )
CargoHelicopter:Deploy( DeployZones[math.random( 1, #DeployZones ) ]:GetRandomCoordinate( 500, 100 ), math.random( 50, 250 ) )
end
function CargoHelicopter:onafterUnloaded( Helicopter, From, Event, To, Cargo )
CargoHelicopter:Pickup( PickupZone:GetRandomCoordinate( 500, 200 ), math.random( 50, 250 ) )
end

View File

@ -0,0 +1,10 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
$dir
$file
cd "_unpacked"
. 7z a -r -y -tzip "..\$file.miz" *
cd ..

View File

@ -0,0 +1,7 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
Remove-Item .\_unpacked -Force -Recurse
md "_unpacked"
cd "_unpacked"
. 7z x -r -y "..\$file.miz" *

View File

@ -0,0 +1,35 @@
---
-- Name: AIC-PLN-000 - Airplane
-- Author: FlightControl
-- Date Created: 14 Apr 2018
--
VehicleCargoSet = SET_CARGO:New():FilterTypes( "Vehicles" ):FilterStart()
for i = 1, 10 do
local WorkerGroup = GROUP:FindByName( string.format( "Vehicle #%03d", i ) )
local WorkersCargo = CARGO_GROUP:New( WorkerGroup, "Vehicles", string.format( "Vehicle %d", i ), 5000, 35 )
end
local Airplane = GROUP:FindByName( "Airplane" )
CargoAirplane = AI_CARGO_AIRPLANE:New( Airplane, VehicleCargoSet )
PickupAirbase = AIRBASE:FindByName( AIRBASE.Caucasus.Kobuleti )
DeployAirbases = { AIRBASE:FindByName( AIRBASE.Caucasus.Batumi ), AIRBASE:FindByName( AIRBASE.Caucasus.Gudauta ) }
CargoAirplane:Pickup( PickupAirbase )
function CargoAirplane:onafterLoaded( Airplane, From, Event, To, Cargo )
CargoAirplane:Deploy( DeployAirbases[math.random( 1, #DeployAirbases ) ], math.random( 50, 250 ) )
end
function CargoAirplane:onafterUnloaded( Airplane, From, Event, To, Cargo )
CargoAirplane:Pickup( PickupAirbase, math.random( 50, 250 ) )
end

View File

@ -0,0 +1,10 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
$dir
$file
cd "_unpacked"
. 7z a -r -y -tzip "..\$file.miz" *
cd ..

View File

@ -0,0 +1,7 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
Remove-Item .\_unpacked -Force -Recurse
md "_unpacked"
cd "_unpacked"
. 7z x -r -y "..\$file.miz" *

View File

@ -0,0 +1,27 @@
---
-- Name: AID-008 - AI_A2A - CAP Grouping Test
-- Author: FlightControl
-- Date Created: 06 Aug 2017
-- Define a SET_GROUP object that builds a collection of groups that define the EWR network.
-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR.
DetectionSetGroup = SET_GROUP:New()
DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } )
DetectionSetGroup:FilterStart()
Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 )
-- Setup the A2A dispatcher, and initialize it.
A2ADispatcher = AI_A2A_DISPATCHER:New( Detection )
A2ADispatcher:SetTacticalDisplay( true )
-- Setup the squadrons.
A2ADispatcher:SetSquadron( "Sochi", AIRBASE.Caucasus.Sochi_Adler, { "SQ CCCP SU-27" } )
CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) )
A2ADispatcher:SetSquadronCap( "Sochi", CAPZoneWest, 4000, 8000, 600, 800, 800, 1200 )
A2ADispatcher:SetSquadronCapInterval( "Sochi", 2, 10, 30, 1 )
A2ADispatcher:SetSquadronGrouping( "Sochi", 2 )

View File

@ -0,0 +1,10 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
$dir
$file
cd "_unpacked"
. 7z a -r -y -tzip "..\$file.miz" *
cd ..

View File

@ -0,0 +1,7 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
Remove-Item .\_unpacked -Force -Recurse
md "_unpacked"
cd "_unpacked"
. 7z x -r -y "..\$file.miz" *

View File

@ -0,0 +1,30 @@
---
-- Name: AID-A2A-009 - Border Test
-- Author: FlightControl
-- Date Created: 06 Aug 2017
-- Define a SET_GROUP object that builds a collection of groups that define the EWR network.
-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR.
DetectionSetGroup = SET_GROUP:New()
DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } )
DetectionSetGroup:FilterStart()
Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 )
-- Setup the A2A dispatcher, and initialize it.
A2ADispatcher = AI_A2A_DISPATCHER:New( Detection )
-- Setup the border zone.
-- In this case the border is a POLYGON,
-- which takes the waypoints of a late activated group with the name CCCP Border as the boundaries of the border area.
-- Any enemy crossing this border will be engaged.
CCCPBorderZone = ZONE_POLYGON:New( "CCCP Border", GROUP:FindByName( "CCCP Border" ) )
A2ADispatcher:SetBorderZone( CCCPBorderZone )
A2ADispatcher:SetTacticalDisplay( true )
-- Setup the squadrons.
A2ADispatcher:SetSquadron( "Sochi", AIRBASE.Caucasus.Sochi_Adler, { "SQ CCCP SU-27" } )
A2ADispatcher:SetSquadronGci( "Sochi", 1000, 1500 )

View File

@ -0,0 +1,10 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
$dir
$file
cd "_unpacked"
. 7z a -r -y -tzip "..\$file.miz" *
cd ..

View File

@ -0,0 +1,7 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
Remove-Item .\_unpacked -Force -Recurse
md "_unpacked"
cd "_unpacked"
. 7z x -r -y "..\$file.miz" *

View File

@ -0,0 +1,50 @@
---
-- Name: AID-A2A-010 - RTB and ReEngage
-- Author: FlightControl
-- Date Created: 30 May 2017
-- Define a SET_GROUP object that builds a collection of groups that define the EWR network.
-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR.
DetectionSetGroup = SET_GROUP:New()
DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } )
DetectionSetGroup:FilterStart()
Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 )
-- Setup the A2A dispatcher, and initialize it.
A2ADispatcher = AI_A2A_DISPATCHER:New( Detection )
-- Initialize the dispatcher, setting up a border zone. This is a polygon,
-- which takes the waypoints of a late activated group with the name CCCP Border as the boundaries of the border area.
-- Any enemy crossing this border will be engaged.
CCCPBorderZone = ZONE_POLYGON:New( "CCCP Border", GROUP:FindByName( "CCCP Border" ) )
--A2ADispatcher:SetBorderZone( CCCPBorderZone )
-- Initialize the dispatcher, setting up a radius of 100km where any airborne friendly
-- without an assignment within 100km radius from a detected target, will engage that target.
A2ADispatcher:SetEngageRadius( 200000 )
A2ADispatcher:SetTacticalDisplay( true )
-- Setup the squadrons.
A2ADispatcher:SetSquadron( "Sochi", AIRBASE.Caucasus.Sochi_Adler, { "SQ CCCP SU-27" }, 20 )
A2ADispatcher:SetSquadronGci( "Sochi", 900, 1200 )
A2ADispatcher:SetDefaultTakeoffFromParkingCold()
A2ADispatcher:SetDefaultLandingAtEngineShutdown()
-- Blue attack simulation
local Frequency = 180
BlueSpawn2 = SPAWN
:New( "RT NATO 2" )
:InitLimit( 8, 40 )
:InitRandomizeTemplate( { "SQ NATO A-10C", "SQ NATO F-15C", "SQ NATO F-16A", "SQ NATO F/A-18", "SQ NATO F-16C" } )
:InitRandomizeRoute( 0, 0, 30000 )
:InitDelayOn()
:SpawnScheduled( Frequency, 0.5 )

View File

@ -0,0 +1,10 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
$dir
$file
cd "_unpacked"
. 7z a -r -y -tzip "..\$file.miz" *
cd ..

View File

@ -0,0 +1,7 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
Remove-Item .\_unpacked -Force -Recurse
md "_unpacked"
cd "_unpacked"
. 7z x -r -y "..\$file.miz" *

View File

@ -0,0 +1,51 @@
---
-- Name: AID-A2A-011 - RTB Fuel Treshold test
-- Author: FlightControl
-- Date Created: 30 Jul 2017
-- Define a SET_GROUP object that builds a collection of groups that define the EWR network.
-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR.
DetectionSetGroup = SET_GROUP:New()
DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } )
DetectionSetGroup:FilterStart()
Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 )
-- Setup the A2A dispatcher, and initialize it.
A2ADispatcher = AI_A2A_DISPATCHER:New( Detection )
-- Initialize the dispatcher, setting up a border zone. This is a polygon,
-- which takes the waypoints of a late activated group with the name CCCP Border as the boundaries of the border area.
-- Any enemy crossing this border will be engaged.
CCCPBorderZone = ZONE_POLYGON:New( "CCCP Border", GROUP:FindByName( "CCCP Border" ) )
--A2ADispatcher:SetBorderZone( CCCPBorderZone )
-- Initialize the dispatcher, setting up a radius of 100km where any airborne friendly
-- without an assignment within 100km radius from a detected target, will engage that target.
A2ADispatcher:SetEngageRadius( 200000 )
A2ADispatcher:SetTacticalDisplay( true )
-- Set the fuel treshold to 40%. Airplanes will return when only 40% of fuel left in the tank.
A2ADispatcher:SetDefaultFuelThreshold( 0.4 )
-- Setup the squadrons.
A2ADispatcher:SetSquadron( "Sochi", AIRBASE.Caucasus.Sochi_Adler, { "SQ CCCP SU-27" }, 20 )
A2ADispatcher:SetSquadronOverhead( "Sochi", 1 )
A2ADispatcher:SetSquadronGrouping( "Sochi", 2 )
-- CAP Squadron execution.
CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) )
A2ADispatcher:SetSquadronCap( "Sochi", CAPZoneWest, 4000, 8000, 600, 800, 800, 1200, "BARO" )
A2ADispatcher:SetSquadronCapInterval( "Sochi", 2, 30, 120, 1 )
A2ADispatcher:SetSquadronGci( "Sochi", 900, 1200 )
A2ADispatcher:SetSquadronTakeoffFromParkingHot("Sochi")
A2ADispatcher:SetSquadronLandingAtEngineShutdown("Sochi")

View File

@ -0,0 +1,10 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
$dir
$file
cd "_unpacked"
. 7z a -r -y -tzip "..\$file.miz" *
cd ..

View File

@ -0,0 +1,7 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
Remove-Item .\_unpacked -Force -Recurse
md "_unpacked"
cd "_unpacked"
. 7z x -r -y "..\$file.miz" *

View File

@ -0,0 +1,51 @@
---
-- Name: AID-A2A-012 - CAP Time Interval Test
-- Author: FlightControl
-- Date Created: 30 Jul 2017
-- Define a SET_GROUP object that builds a collection of groups that define the EWR network.
-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR.
DetectionSetGroup = SET_GROUP:New()
DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } )
DetectionSetGroup:FilterStart()
Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 )
-- Setup the A2A dispatcher, and initialize it.
A2ADispatcher = AI_A2A_DISPATCHER:New( Detection )
-- Initialize the dispatcher, setting up a border zone. This is a polygon,
-- which takes the waypoints of a late activated group with the name CCCP Border as the boundaries of the border area.
-- Any enemy crossing this border will be engaged.
CCCPBorderZone = ZONE_POLYGON:New( "CCCP Border", GROUP:FindByName( "CCCP Border" ) )
--A2ADispatcher:SetBorderZone( CCCPBorderZone )
-- Initialize the dispatcher, setting up a radius of 100km where any airborne friendly
-- without an assignment within 100km radius from a detected target, will engage that target.
A2ADispatcher:SetEngageRadius( 200000 )
A2ADispatcher:SetTacticalDisplay( true )
A2ADispatcher:SetDefaultCapLimit( 2 )
A2ADispatcher:SetDefaultCapTimeInterval( 300, 300 ) -- Spawn each 5 minutes.
-- Setup the squadrons.
A2ADispatcher:SetSquadron( "Sochi", AIRBASE.Caucasus.Sochi_Adler, { "SQ CCCP SU-27" }, 20 )
A2ADispatcher:SetSquadronOverhead( "Sochi", 1 )
A2ADispatcher:SetSquadronGrouping( "Sochi", 2 )
-- CAP Squadron execution.
CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) )
A2ADispatcher:SetSquadronCap( "Sochi", CAPZoneWest, 4000, 8000, 600, 800, 800, 1200, "BARO" )
A2ADispatcher:SetSquadronGci( "Sochi", 900, 1200 )
A2ADispatcher:SetSquadronTakeoffFromParkingHot("Sochi")
A2ADispatcher:SetSquadronLandingAtEngineShutdown("Sochi")

View File

@ -0,0 +1,10 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
$dir
$file
cd "_unpacked"
. 7z a -r -y -tzip "..\$file.miz" *
cd ..

View File

@ -0,0 +1,7 @@
$dir = split-path -parent $MyInvocation.MyCommand.Definition
cd $dir
$file = Split-Path $dir -leaf
Remove-Item .\_unpacked -Force -Recurse
md "_unpacked"
cd "_unpacked"
. 7z x -r -y "..\$file.miz" *

View File

@ -0,0 +1,47 @@
---
-- Name: AID-A2A-013 - Intercept Test
-- Author: FlightControl
-- Date Created: 31 Jul 2017
-- Define a SET_GROUP object that builds a collection of groups that define the EWR network.
-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR.
DetectionSetGroup = SET_GROUP:New()
DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } )
DetectionSetGroup:FilterStart()
Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 )
-- Setup the A2A dispatcher, and initialize it.
A2ADispatcher = AI_A2A_DISPATCHER:New( Detection )
-- Initialize the dispatcher, setting up a border zone. This is a polygon,
-- which takes the waypoints of a late activated group with the name CCCP Border as the boundaries of the border area.
-- Any enemy crossing this border will be engaged.
CCCPBorderZone = ZONE_POLYGON:New( "CCCP Border", GROUP:FindByName( "CCCP Border" ) )
--A2ADispatcher:SetBorderZone( CCCPBorderZone )
-- Initialize the dispatcher, setting up a radius of 100km where any airborne friendly
-- without an assignment within 100km radius from a detected target, will engage that target.
A2ADispatcher:SetEngageRadius( 200000 )
A2ADispatcher:SetTacticalDisplay( true )
-- Test intercept.
A2ADispatcher:SetIntercept( 450 )
-- Setup the squadrons.
A2ADispatcher:SetSquadron( "Sochi", AIRBASE.Caucasus.Sochi_Adler, { "SQ CCCP MIG-31" }, 20 )
A2ADispatcher:SetSquadronGci( "Sochi", 900, 1200 )
A2ADispatcher:SetSquadronTakeoffFromParkingCold( "Sochi" )
A2ADispatcher:SetSquadronLandingAtEngineShutdown( "Sochi" )
A2ADispatcher:SetSquadron( "Gelend", AIRBASE.Caucasus.Gelendzhik, { "SQ CCCP SU-27" }, 20 )
A2ADispatcher:SetSquadronGci( "Gelend", 800, 1200 )
A2ADispatcher:SetSquadronTakeoffFromParkingCold( "Gelend" )
A2ADispatcher:SetSquadronLandingAtEngineShutdown( "Gelend" )
A2ADispatcher:Start()

Some files were not shown because too many files have changed in this diff Show More