Add files via upload

This commit is contained in:
Thomas 2022-11-13 13:48:25 +01:00 committed by GitHub
parent a24b62b460
commit e7cecd11f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 85 additions and 0 deletions

View File

@ -0,0 +1,68 @@
-------------------------------------------------------------------------
-- CTLD 110 - Caucasus - Build and Move
-------------------------------------------------------------------------
-- Documentation
--
-- CTLD: https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Ops.CTLD.html
--
-------------------------------------------------------------------------
-- Join a Helicopter. Use the F10 menu to request crates and/or troops.
-- Fly over to the drop zone at the far end of the airport and unload.
-- We'll auto create a MOVE type zone and the unloaded troops & vehicles
-- will attack REDFOR.
-------------------------------------------------------------------------
-- Date: November 2022
-------------------------------------------------------------------------
_SETTINGS:SetPlayerMenuOff()
local my_ctld = CTLD:New(coalition.side.BLUE,{"Helicargo"},"Lufttransportbrigade I")
my_ctld.forcehoverload = false
my_ctld.movetroopsdistance = 6000
my_ctld.debug = false
my_ctld.buildtime = 30
my_ctld:__Start(5)
-- generate generically loadable stuff
my_ctld:AddTroopsCargo("Infantry",{"Infantry6"},CTLD_CARGO.Enum.TROOPS,6,80,nil,"Troops")
my_ctld:AddCratesCargo("Humvee",{"Humvee"},CTLD_CARGO.Enum.VEHICLE,1,100,nil,"Vehicles")
-- generate zone types
my_ctld:AddCTLDZone("Loadzone",CTLD.CargoZoneType.LOAD,SMOKECOLOR.Blue,true,true) -- Note: since there are no blue flares, this will be a white flare when requested.
my_ctld:AddCTLDZone("Dropzone",CTLD.CargoZoneType.DROP,SMOKECOLOR.Red,true,true)
local dropzone = ZONE:FindByName("Dropzone"):DrawZone(-1,{0,0,1},1,{0,0,1},0.25,1)
-- update unit capabilities for testing
my_ctld:UnitCapabilities("SA342L", true, true, 1, 6, 12, 1000)
-- We're using OnBefore ... to add a MOVE zone
function my_ctld:OnBeforeTroopsDeployed(From,Event,To,Group,Unit,Troops)
-- find baddies near by with a ZONE filter
local zone = ZONE_GROUP:New(Group:GetName(),Group,6000)
local enemyset = SET_GROUP:New():FilterCoalitions("red"):FilterCategoryGround():FilterZones({zone}):FilterOnce()
if enemyset:Count() > 0 then
MESSAGE:New(string.format("Found %d enemy group nearby!", enemyset:Count()),15):ToAll()
-- baddies found, add zone around them
local zonename = "Baddies-"..math.random(1,10000)
local redzone = ZONE_RADIUS:New(zonename,enemyset:GetRandom():GetCoordinate():GetVec2(),200)
redzone:DrawZone(-1,{1,0.6,0},1,{1,0.6,0},0.25,4)
my_ctld:AddCTLDZone(zonename,CTLD.CargoZoneType.MOVE,SMOKECOLOR.Orange,true,false)
end
return self
end
-- We're using OnBefore ... to add a MOVE zone
function my_ctld:OnBeforeCratesBuild(From,Event,To,Group,Unit,Vehicle)
-- find baddies near by with a ZONE filter
local zone = ZONE_GROUP:New(Group:GetName(),Group,6000)
local enemyset = SET_GROUP:New():FilterCoalitions("red"):FilterCategoryGround():FilterZones({zone}):FilterOnce()
if enemyset:Count() > 0 then
MESSAGE:New(string.format("Found %d enemy group nearby!", enemyset:Count()),15):ToAll()
-- baddies found, add zone around them
local zonename = "Baddies-"..math.random(1,10000)
local redzone = ZONE_RADIUS:New(zonename,enemyset:GetRandom():GetCoordinate():GetVec2(),200)
redzone:DrawZone(-1,{1,0.6,0},1,{1,0.6,0},0.25,4)
my_ctld:AddCTLDZone(zonename,CTLD.CargoZoneType.MOVE,SMOKECOLOR.Orange,true,false)
end
return self
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" *