mirror of
https://github.com/FlightControl-Master/MOOSE_MISSIONS.git
synced 2025-08-15 10:37:46 +00:00
MOOSE demonstration missions [skip ci]
This commit is contained in:
@@ -0,0 +1,181 @@
|
||||
---
|
||||
-- GROUND Basic Transport
|
||||
--
|
||||
-- A group of two TPz Fuchs transports infantry groups from Zone Kobulety X to a nearby Zone Alpha.
|
||||
--
|
||||
-- Once all troops were delivered, the carrier returns to its original position.
|
||||
--
|
||||
-- This script also contains many FSM events that are triggered when a carrier loads/unloads cargo and when groups are being loaded/unloaded.
|
||||
--
|
||||
-- NOTE that:
|
||||
-- - Troops to be transported MUST be in the pickup zone. If not, they will not be considered for transport until they enter the zone!
|
||||
-- - If a group is too heavy for the assigned transports, it will not be transported. Each group must fit into one UNIT of the group.
|
||||
---
|
||||
|
||||
-- Pickup and deploy zones.
|
||||
local zonePickup=ZONE:New("Zone Kobuleti X"):DrawZone()
|
||||
local zoneDeploy=ZONE:New("Zone Alpha"):DrawZone()
|
||||
|
||||
-- Carrier group.
|
||||
local carrier=ARMYGROUP:New("TPz Fuchs Group")
|
||||
carrier:Activate()
|
||||
|
||||
-- Cargo group.
|
||||
local infantry=ARMYGROUP:New("Infantry Platoon Alpha-1")
|
||||
infantry:Activate()
|
||||
|
||||
-- Cargo transport assignment.
|
||||
local opstransport=OPSTRANSPORT:New(infantry, zonePickup, zoneDeploy)
|
||||
|
||||
-- Assign transport to carrier.
|
||||
carrier:AddOpsTransport(opstransport)
|
||||
|
||||
---
|
||||
-- FSM events of the OPSTRANSPORT
|
||||
---
|
||||
|
||||
--- Function called when an OPSGROUP is loaded into a carrier.
|
||||
function opstransport:OnAfterLoaded(From, Event, To, CargoOpsGroup, CarrierOpsGroup, CarrierElement)
|
||||
local cargoopsgroup=CargoOpsGroup --Ops.ArmyGroup#ARMYGROUP
|
||||
local carrieropsgroup=CarrierOpsGroup --Ops.ArmyGroup#ARMYGROUP
|
||||
local carrier=CarrierElement --Ops.OpsGroup#OPSGROUP.Element
|
||||
|
||||
-- Info message.
|
||||
local text=string.format("Transport UID=%d opsgroup %s loaded into carrier %s", opstransport:GetUID(), cargoopsgroup:GetName(), carrier.name)
|
||||
MESSAGE:New(text, 60):ToAll()
|
||||
env.info(text)
|
||||
|
||||
end
|
||||
|
||||
--- Function called when an OPSGROUP is unloaded from the carrier.
|
||||
function opstransport:OnAfterUnloaded(From, Event, To, CargoOpsGroup, CarrierOpsGroup)
|
||||
local cargoopsgroup=CargoOpsGroup --Ops.ArmyGroup#ARMYGROUP
|
||||
local carrieropsgroup=CarrierOpsGroup --Ops.ArmyGroup#ARMYGROUP
|
||||
|
||||
-- Info message.
|
||||
local text=string.format("Transport UID=%d unloaded opsgroup %s from carrier group %s", opstransport:GetUID(), cargoopsgroup:GetName(), carrieropsgroup:GetName())
|
||||
MESSAGE:New(text, 60):ToAll()
|
||||
env.info(text)
|
||||
|
||||
-- OPSGROUP is ready for further actions. Put up green smoke.
|
||||
cargoopsgroup:GetGroup():SmokeGreen()
|
||||
|
||||
end
|
||||
|
||||
--- Function called when transport was delivered or everyone (remaining) is dead.
|
||||
function opstransport:OnAfterDelivered(From, Event, To)
|
||||
-- Info Message
|
||||
local text=string.format("Transport UID=%d was delivered. Ncargo=%d Ndelivered=%d", opstransport:GetUID(), opstransport:GetNcargoTotal(), opstransport:GetNcargoDelivered())
|
||||
MESSAGE:New(text, 60):ToAll()
|
||||
env.info(text)
|
||||
end
|
||||
|
||||
---
|
||||
-- FSM events for carrier groups
|
||||
---
|
||||
|
||||
--- Function called when a carrier has loaded a cargo group.
|
||||
function carrier:OnAfterLoaded(From, Event, To, CargoGroup)
|
||||
local cargogroup=CargoGroup --Ops.OpsGroup#OPSGROUP
|
||||
|
||||
-- Info Message
|
||||
local text=string.format("Group %s loaded group %s", carrier:GetName(), cargogroup:GetName())
|
||||
MESSAGE:New(text, 60):ToAll()
|
||||
env.info(text)
|
||||
end
|
||||
|
||||
--- Function called when a carrier has unloaded a cargo group.
|
||||
function carrier:OnAfterUnloaded(From, Event, To, CargoGroup)
|
||||
local cargogroup=CargoGroup --Ops.OpsGroup#OPSGROUP
|
||||
|
||||
-- Info Message
|
||||
local text=string.format("Group %s unloaded group %s", carrier:GetName(), cargogroup:GetName())
|
||||
MESSAGE:New(text, 60):ToAll()
|
||||
env.info(text)
|
||||
end
|
||||
|
||||
|
||||
--- Function called when carrier goes to pickup cargo.
|
||||
function carrier:OnAfterPickup(From,Event,To)
|
||||
-- Info Message
|
||||
local text=string.format("Group %s is picking up cargo...", carrier:GetName())
|
||||
MESSAGE:New(text, 60):ToAll()
|
||||
env.info(text)
|
||||
end
|
||||
|
||||
--- Function called when a carrier is loading cargo.
|
||||
function carrier:OnAfterLoading(From,Event,To)
|
||||
-- Info Message
|
||||
local text=string.format("Group %s is loading cargo...", carrier:GetName())
|
||||
MESSAGE:New(text, 60):ToAll()
|
||||
env.info(text)
|
||||
end
|
||||
|
||||
--- Function called when a carrier has loaded all cargo.
|
||||
function carrier:OnAfterLoadingDone(From, Event, To)
|
||||
-- Info Message
|
||||
local text=string.format("Group %s loaded all cargo", carrier:GetName())
|
||||
MESSAGE:New(text, 60):ToAll()
|
||||
env.info(text)
|
||||
end
|
||||
|
||||
--- Function called when the carrier transports cargo from pickup to deploy zone.
|
||||
function carrier:OnAfterTransport(From, Event, To)
|
||||
-- Info Message
|
||||
local text=string.format("Group %s is transporting cargo...", carrier:GetName())
|
||||
MESSAGE:New(text, 60):ToAll()
|
||||
env.info(text)
|
||||
end
|
||||
|
||||
--- Function called when a carrier is unloading cargo.
|
||||
function carrier:OnAfterUnLoading(From,Event,To)
|
||||
-- Info Message
|
||||
local text=string.format("Group %s is unloading cargo...", carrier:GetName())
|
||||
MESSAGE:New(text, 60):ToAll()
|
||||
env.info(text)
|
||||
end
|
||||
|
||||
--- Function called when a carrier is done with onloading its cargo.
|
||||
function carrier:OnAfterUnloadingDone(From, Event, To)
|
||||
-- Info Message
|
||||
local text=string.format("Group %s is finished unloading cargo...", carrier:GetName())
|
||||
MESSAGE:New(text, 60):ToAll()
|
||||
env.info(text)
|
||||
end
|
||||
|
||||
---
|
||||
-- FSM events for cargo groups
|
||||
---
|
||||
|
||||
--- Function called when a cargo group is ordered to board a carrier.
|
||||
function infantry:OnAfterBoard(From, Event, To, CarrierGroup, Carrier)
|
||||
local carriergroup=CarrierGroup --Ops.OpsGroup#OPSGROUP
|
||||
local carrier=Carrier --Ops.OpsGroup#OPSGROUP.Element
|
||||
|
||||
-- Info Message
|
||||
local text=string.format("Group %s will board into carrier %s of group %s", infantry:GetName(), carrier.name, carriergroup:GetName())
|
||||
MESSAGE:New(text, 60):ToAll()
|
||||
env.info(text)
|
||||
end
|
||||
|
||||
--- Function called when the group embarked a carrier.
|
||||
function infantry:OnAfterEmbarked(From, Event, To, CarrierGroup, Carrier)
|
||||
local carriergroup=CarrierGroup --Ops.OpsGroup#OPSGROUP
|
||||
local carrier=Carrier --Ops.OpsGroup#OPSGROUP.Element)
|
||||
|
||||
-- Info Message
|
||||
local text=string.format("Group %s embarked into carrier %s of group %s", infantry:GetName(), carrier.name, carriergroup:GetName())
|
||||
MESSAGE:New(text, 60):ToAll()
|
||||
env.info(text)
|
||||
end
|
||||
|
||||
--- Function called when the group disembarked a carrier.
|
||||
function infantry:OnAfterDisembarked(From, Event, To, CarrierGroup, Carrier)
|
||||
local carriergroup=CarrierGroup --Ops.OpsGroup#OPSGROUP
|
||||
local carrier=Carrier --Ops.OpsGroup#OPSGROUP.Element)
|
||||
|
||||
-- Info Message
|
||||
local text=string.format("Group %s disembarked from carrier %s of group %s", infantry:GetName(), carrier.name, carriergroup:GetName())
|
||||
MESSAGE:New(text, 60):ToAll()
|
||||
env.info(text)
|
||||
end
|
||||
Binary file not shown.
@@ -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 ..
|
||||
@@ -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" *
|
||||
@@ -0,0 +1,35 @@
|
||||
---
|
||||
-- GROUND Transport Waiting
|
||||
--
|
||||
-- A group of two TPz Fuchs is ordered to transport and infantry group from Zone Kobulety X to a nearby Zone Alpha.
|
||||
-- The infantry troops were just involved in a fire fight and are now returning to the briefed pickup zone.
|
||||
-- Once the troops arrive in the pickup zone, the carrier will go there to pick them up.
|
||||
---
|
||||
|
||||
-- Pickup and deploy zones.
|
||||
local zonePickup=ZONE:New("Zone Kobuleti X"):DrawZone()
|
||||
local zoneDeploy=ZONE:New("Zone Alpha"):DrawZone()
|
||||
|
||||
-- Carrier group.
|
||||
local carrier=ARMYGROUP:New("TPz Fuchs Group")
|
||||
carrier:Activate()
|
||||
|
||||
-- Infantry group to be transported.
|
||||
local infantry=ARMYGROUP:New("Infantry Platoon Bravo-1")
|
||||
infantry:Activate()
|
||||
|
||||
-- Add waypoint to make the group move to the pickup zone.
|
||||
infantry:AddWaypoint(zonePickup:GetRandomCoordinate())
|
||||
|
||||
-- Cargo transport assignment.
|
||||
local opstransport=OPSTRANSPORT:New(infantry, zonePickup, zoneDeploy)
|
||||
|
||||
-- Assign transport to carrier.
|
||||
carrier:AddOpsTransport(opstransport)
|
||||
|
||||
--- Function called when transport was delivered or everyone (remaining) is dead.
|
||||
function opstransport:OnAfterDelivered(From, Event, To)
|
||||
local text=string.format("Transport UID=%d was delivered. Ncargo=%d Ndelivered=%d", opstransport.uid, opstransport.Ncargo, opstransport.Ndelivered)
|
||||
MESSAGE:New(text, 60):ToAll()
|
||||
env.info(text)
|
||||
end
|
||||
Binary file not shown.
@@ -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 ..
|
||||
@@ -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" *
|
||||
@@ -0,0 +1,46 @@
|
||||
---
|
||||
-- GROUND Transport Chain
|
||||
--
|
||||
-- A group of two TPz Fuchs is ordered to transport and infantry group from Zone Kobulety X to a nearby Zone Alpha.
|
||||
-- Another transport APC group of on M113 is ordered to transport the troops from Zone Alpha to Zone Bravo.
|
||||
--
|
||||
-- The second transport will start once the first has been delivered.
|
||||
-- The M113 is not able to pickup all troops at once and has to go multiple times beteen pickup and deploy zone.
|
||||
---
|
||||
|
||||
-- Pickup and deploy zones.
|
||||
local zonePickup=ZONE:New("Zone Kobuleti X"):DrawZone()
|
||||
local zoneAlpha=ZONE:New("Zone Alpha"):DrawZone()
|
||||
local zoneBravo=ZONE:New("Zone Bravo"):DrawZone()
|
||||
|
||||
-- Carrier group A.
|
||||
local carrierA=ARMYGROUP:New("TPz Fuchs Group")
|
||||
carrierA:Activate()
|
||||
|
||||
-- Carrier group B.
|
||||
local carrierB=ARMYGROUP:New("APC M113")
|
||||
carrierB:Activate()
|
||||
|
||||
|
||||
-- Set of groups to transport.
|
||||
local infantryset=SET_GROUP:New():FilterPrefixes("Infantry Platoon Alpha"):FilterOnce()
|
||||
infantryset:Activate()
|
||||
|
||||
|
||||
-- Cargo transport assignment from pickup zone to zone Alpha.
|
||||
local opstransportA=OPSTRANSPORT:New(infantryset, zonePickup, zoneAlpha)
|
||||
|
||||
-- Assign transport A to carrier A.
|
||||
carrierA:AddOpsTransport(opstransportA)
|
||||
|
||||
|
||||
-- Cargo transport assignment from zone Alpha to zone Bravo.
|
||||
local opstransportB=OPSTRANSPORT:New(infantryset, zoneAlpha, zoneBravo)
|
||||
|
||||
-- Add start condition that first transport was delivered.
|
||||
opstransportB:AddConditionStart(function()
|
||||
return (opstransportA:IsDelivered() and opstransportA:GetNcargoDelivered()>0)
|
||||
end)
|
||||
|
||||
-- Assign transport B to carrier B.
|
||||
carrierB:AddOpsTransport(opstransportB)
|
||||
Binary file not shown.
@@ -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 ..
|
||||
@@ -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" *
|
||||
@@ -0,0 +1,42 @@
|
||||
---
|
||||
-- GROUND Transport Direct
|
||||
--
|
||||
-- A group of two TPz Fuchs is ordered to transport and infantry group from Zone Kobulety X to a nearby Zone Alpha.
|
||||
-- Another transport APC group of on M113 is ordered to transport the troops from Zone Alpha to Zone Bravo.
|
||||
-- This mission is very similar to demo mission 012.
|
||||
--
|
||||
-- However, in this case the troops will not unboard the first carrier. They will remain "inside" the TPz Fuchs
|
||||
-- and will be directly transferred to the M113.
|
||||
--
|
||||
-- This can be handy in situations where it is diffcult for troops to unboard.
|
||||
---
|
||||
|
||||
-- Pickup and deploy zones.
|
||||
local zonePickup=ZONE:New("Zone Kobuleti X"):DrawZone()
|
||||
local zoneAlpha=ZONE:New("Zone Alpha"):DrawZone()
|
||||
local zoneBravo=ZONE:New("Zone Bravo"):DrawZone()
|
||||
|
||||
-- First carrier group.
|
||||
local carrier1=ARMYGROUP:New("TPz Fuchs Group")
|
||||
carrier1:Activate()
|
||||
|
||||
-- Second carrier group.
|
||||
local carrier2=ARMYGROUP:New("APC M113")
|
||||
carrier2:Activate()
|
||||
|
||||
-- Set of groups to transport.
|
||||
local infantryset=SET_GROUP:New():FilterPrefixes("Infantry Platoon Alpha"):FilterOnce()
|
||||
infantryset:Activate()
|
||||
|
||||
-- Cargo transport assignment from pickup zone to zone Alpha.
|
||||
local transport1=OPSTRANSPORT:New(infantryset, zonePickup, zoneAlpha)
|
||||
|
||||
-- Directly load into another carrier.
|
||||
transport1:SetDisembarkCarriers(carrier2)
|
||||
|
||||
-- Transport assignment from zone Alpha to zone Bravo.
|
||||
local transport2=OPSTRANSPORT:New(infantryset, zoneAlpha, zoneBravo)
|
||||
|
||||
-- Assign transports to carriers.
|
||||
carrier1:AddOpsTransport(transport1)
|
||||
carrier2:AddOpsTransport(transport2)
|
||||
Binary file not shown.
@@ -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 ..
|
||||
@@ -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" *
|
||||
@@ -0,0 +1,41 @@
|
||||
---
|
||||
-- GROUND Cargo Dead
|
||||
--
|
||||
-- A TPz Fuchs group is assigned to transport cargo.
|
||||
-- While the carrier is on its way to pickup the cargo, all cargo is destroyed.
|
||||
--
|
||||
-- When the cargo is dead, the carrier will abort the transport and return to its initial position.
|
||||
--
|
||||
|
||||
-- Pickup and deploy zones.
|
||||
local zonePickup=ZONE:New("Zone Kobuleti X")
|
||||
local zoneDeploy=ZONE:New("Zone Alpha")
|
||||
|
||||
-- Carrier.
|
||||
local carrier=ARMYGROUP:New("TPz Fuchs Group")
|
||||
carrier:Activate()
|
||||
|
||||
-- Set of groups to transport.
|
||||
local infantryset=SET_OPSGROUP:New():FilterPrefixes("Infantry Platoon Alpha"):FilterOnce()
|
||||
infantryset:Activate()
|
||||
|
||||
-- Destroy all cargo after 60 seconds.
|
||||
infantryset:ForEach(function(_opsgroup)
|
||||
local opsgroup=_opsgroup --Ops.ArmyGroup#ARMYGROUP
|
||||
opsgroup:SelfDestruction(60)
|
||||
end
|
||||
)
|
||||
|
||||
-- Cargo transport assignment.
|
||||
local opstransport=OPSTRANSPORT:New(infantryset, zonePickup, zoneDeploy)
|
||||
|
||||
-- Assign transport to carrier.
|
||||
carrier:AddOpsTransport(opstransport)
|
||||
|
||||
|
||||
--- Function called when transport was delivered or everyone (remaining) is dead.
|
||||
function opstransport:OnAfterDelivered(From, Event, To)
|
||||
local text=string.format("Transport UID=%d was delivered. Ncargo=%d Ndelivered=%d", opstransport:GetUID(), opstransport:GetNcargoTotal(), opstransport:GetNcargoDelivered())
|
||||
MESSAGE:New(text, 60):ToAll()
|
||||
env.info(text)
|
||||
end
|
||||
Binary file not shown.
@@ -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 ..
|
||||
@@ -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" *
|
||||
@@ -0,0 +1,71 @@
|
||||
---
|
||||
-- GROUND Carrier Dead
|
||||
--
|
||||
-- A group of two TPz Fuchs is ordered to transport and infantry group from Zone Kobulety X to a nearby Zone Alpha.
|
||||
--
|
||||
-- Before the carrier can pickup the cargo, it is destroyed.
|
||||
--
|
||||
-- When the carrier is destroyed, it is respawned and the transport is assigned to the carrier again.
|
||||
--
|
||||
-- Once the carrier has loaded the cargo and starts its transport, it is destroyed again.
|
||||
-- The loaded cargo is also destroyed.
|
||||
---
|
||||
|
||||
-- Pickup and deploy zones.
|
||||
local zonePickup=ZONE:New("Zone Kobuleti X")
|
||||
local zoneAlpha=ZONE:New("Zone Alpha")
|
||||
|
||||
-- Carrier group.
|
||||
local carrier=ARMYGROUP:New("TPz Fuchs Group")
|
||||
carrier:Activate()
|
||||
|
||||
-- After 30 seconds the carrier is destroyed.
|
||||
carrier:SelfDestruction(30)
|
||||
|
||||
-- Set of groups to transport.
|
||||
local infantryset=SET_GROUP:New():FilterPrefixes("Infantry Platoon Alpha"):FilterOnce()
|
||||
infantryset:Activate()
|
||||
|
||||
-- Cargo transport assignment.
|
||||
local transport=OPSTRANSPORT:New(infantryset, zonePickup, zoneAlpha)
|
||||
transport:SetVerbosity(3)
|
||||
|
||||
-- Assign transports to carriers.
|
||||
function carrier:OnAfterSpawned(From,Event,To)
|
||||
env.info("Carrier spawned!")
|
||||
if transport and not transport:IsDelivered() then
|
||||
env.info("Assigning transport to carrier...")
|
||||
carrier:AddOpsTransport(transport)
|
||||
end
|
||||
end
|
||||
|
||||
--- Function called after a carrier group is dead.
|
||||
function transport:OnAfterDeadCarrierGroup(From, Event, To, OpsGroup)
|
||||
local opsgroup=OpsGroup --Ops.ArmyGroup#ARMYGROUP
|
||||
local text=string.format("Carrier group %s is DEAD!", opsgroup:GetName())
|
||||
MESSAGE:New(text, 60):ToAll()
|
||||
env.info(text)
|
||||
|
||||
-- Respawn group after 60 seconds.
|
||||
opsgroup:__Respawn(60)
|
||||
end
|
||||
|
||||
--- Function called after all assigned carriers are dead.
|
||||
function transport:OnAfterDeadCarrierAll(From, Event, To)
|
||||
local text=string.format("All Carriers of transport UID=%d are DEAD!", transport:GetUID())
|
||||
MESSAGE:New(text, 60):ToAll()
|
||||
env.info(text)
|
||||
end
|
||||
|
||||
--- Function called after all cargo was delivered OR is dead!
|
||||
function transport:OnAfterDelivered(From, Event, To)
|
||||
local text=string.format("Transport UID=%d DELIVERED! Number of delivered cargo groups %d of %d", transport:GetUID(), transport:GetNcargoDelivered(), transport:GetNcargoTotal())
|
||||
MESSAGE:New(text, 60):ToAll()
|
||||
env.info(text)
|
||||
end
|
||||
|
||||
--- Function called after the carrier started transporting troops.
|
||||
function carrier:OnAfterTransport(From,Event,To)
|
||||
-- Destroy carrier. The loaded cargo is also destroyed.
|
||||
carrier:SelfDestruction(60)
|
||||
end
|
||||
Binary file not shown.
@@ -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 ..
|
||||
@@ -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" *
|
||||
@@ -0,0 +1,34 @@
|
||||
---
|
||||
-- GROUND Too many carriers
|
||||
--
|
||||
-- Two carriers are assigned to transport troops. The cargo already fits into one of the carriers.
|
||||
--
|
||||
-- Both carriers will drive to the pickup zone. All cargo will be loaded into one carrier.
|
||||
-- The second carrier will wait at the pickup zone in case more cargo is added to the transport.
|
||||
--
|
||||
-- Once the first carrier has delivered all cargo, both carriers will return to their initial position.
|
||||
---
|
||||
|
||||
-- Pickup and deploy zones.
|
||||
local zonePickup=ZONE:New("Zone Engage X")
|
||||
local zoneAlpha=ZONE:New("Zone Kobuleti X")
|
||||
|
||||
-- First carrier.
|
||||
local carrier1=ARMYGROUP:New("AAV-7-1")
|
||||
carrier1:Activate()
|
||||
|
||||
-- Second carrier.
|
||||
local carrier2=ARMYGROUP:New("AAV-7-2")
|
||||
carrier2:Activate()
|
||||
|
||||
-- Set of groups to transport.
|
||||
local infantryset=SET_OPSGROUP:New():FilterPrefixes("Infantry Platoon Echo"):FilterOnce()
|
||||
infantryset:Activate()
|
||||
|
||||
-- Cargo transport assignment.
|
||||
local transport=OPSTRANSPORT:New(infantryset, zonePickup, zoneAlpha)
|
||||
transport:SetVerbosity(3)
|
||||
|
||||
-- Assign transport to carriers.
|
||||
carrier1:AddOpsTransport(transport)
|
||||
carrier2:AddOpsTransport(transport)
|
||||
Binary file not shown.
@@ -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 ..
|
||||
@@ -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" *
|
||||
@@ -0,0 +1,43 @@
|
||||
---
|
||||
-- GROUND Transport In Utero
|
||||
--
|
||||
-- A group of two TPz Fuchs is ordered to transport and infantry group from Zone Kobulety X to a nearby Zone Alpha.
|
||||
--
|
||||
-- Another group of one M-113 APC is ordered to pick up the troops at zone Alpha and transport them to zone Bravo.
|
||||
-- The second transport is scheduled to start at 0915 hours.
|
||||
--
|
||||
-- When the troops are unloaded in zone Alpha, they are NOT spawned inside the deploy zone Alpha. Instead they remain "in utero".
|
||||
-- This can be handy in cases where spawning groups is difficult. For example, ground groups cannot be spawned on ships or oil-rigs.
|
||||
-- In DCS the groups would fall through the ship into the sea.
|
||||
---
|
||||
|
||||
-- Pickup and deploy zones.
|
||||
local zonePickup=ZONE:New("Zone Kobuleti X")
|
||||
local zoneAlpha=ZONE:New("Zone Alpha")
|
||||
local zoneBravo=ZONE:New("Zone Bravo")
|
||||
|
||||
-- Carrier group.
|
||||
local carrier1=ARMYGROUP:New("TPz Fuchs Group")
|
||||
carrier1:Activate()
|
||||
|
||||
-- Carrier group.
|
||||
local carrier2=ARMYGROUP:New("APC M113")
|
||||
carrier2:Activate()
|
||||
|
||||
-- Set of groups to transport.
|
||||
local infantryset=SET_GROUP:New():FilterPrefixes("Infantry Platoon Alpha"):FilterOnce()
|
||||
infantryset:Activate()
|
||||
|
||||
-- Cargo transport assignment.
|
||||
local transport1=OPSTRANSPORT:New(infantryset, zonePickup, zoneAlpha)
|
||||
|
||||
-- Troops are not spawned after disembarkment. They remain in state "InUtero".
|
||||
transport1:SetDisembarkInUtero(true)
|
||||
|
||||
-- Second transport assignment. Scheduled for 0915 hours.
|
||||
local transport2=OPSTRANSPORT:New(infantryset, zoneAlpha, zoneBravo)
|
||||
transport2:SetTime("9:15")
|
||||
|
||||
-- Assign transports to carriers.
|
||||
carrier1:AddOpsTransport(transport1)
|
||||
carrier2:AddOpsTransport(transport2)
|
||||
Binary file not shown.
@@ -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 ..
|
||||
@@ -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" *
|
||||
@@ -0,0 +1,73 @@
|
||||
---
|
||||
-- GROUND Transport Zone Combos
|
||||
--
|
||||
-- A group of two TPz Fuchs transports infantry groups from Zone Kobulety X.
|
||||
--
|
||||
-- One infantry group should be delivered to zone Alpha, while the second group should be delivered to zone Bravo.
|
||||
-- To achieve this, we use "Transport Zone Combos" (TPZ).
|
||||
--
|
||||
-- For the transport to zone Alpha, the carrier will drive on roads.
|
||||
-- For the transport to zone Bravo, the carrier will drive off roads.
|
||||
---
|
||||
|
||||
-- Pickup and deploy zones.
|
||||
local PickupZone=ZONE:New("Zone Kobuleti X")
|
||||
local DeployZoneAlpha=ZONE:New("Zone Alpha")
|
||||
local DeployZoneBravo=ZONE:New("Zone Bravo")
|
||||
|
||||
-- Carrier.
|
||||
local carrier=ARMYGROUP:New("TPz Fuchs Group")
|
||||
carrier:Activate()
|
||||
|
||||
-- Set of groups to transport.
|
||||
local Infantry1=GROUP:FindByName("Infantry Platoon Alpha-1"):Activate()
|
||||
local Infantry2=GROUP:FindByName("Infantry Platoon Alpha-2"):Activate()
|
||||
|
||||
-- Cargo transport assignment.
|
||||
local opstransport=OPSTRANSPORT:New()
|
||||
|
||||
-- Add TZCs.
|
||||
local tpzAlpha=opstransport:AddTransportZoneCombo(Infantry1, PickupZone, DeployZoneAlpha)
|
||||
local tpzBravo=opstransport:AddTransportZoneCombo(Infantry2, PickupZone, DeployZoneBravo)
|
||||
|
||||
-- Transport to zone Alpha will be on road.
|
||||
opstransport:SetFormationPickup(ENUMS.Formation.Vehicle.OnRoad, tpzAlpha)
|
||||
opstransport:SetFormationTransport(ENUMS.Formation.Vehicle.OnRoad, tpzAlpha)
|
||||
|
||||
-- Assign transport to carrier.
|
||||
carrier:AddOpsTransport(opstransport)
|
||||
|
||||
--- Function called when an OPSGROUP is loaded into a carrier.
|
||||
function opstransport:OnAfterLoaded(From, Event, To, CargoOpsGroup, CarrierOpsGroup, CarrierElement)
|
||||
local cargoopsgroup=CargoOpsGroup --Ops.ArmyGroup#ARMYGROUP
|
||||
local carrieropsgroup=CarrierOpsGroup --Ops.ArmyGroup#ARMYGROUP
|
||||
local carrier=CarrierElement --Ops.OpsGroup#OPSGROUP.Element
|
||||
|
||||
-- Info message.
|
||||
local text=string.format("Transport UID=%d opsgroup %s loaded into carrier %s", opstransport:GetUID(), cargoopsgroup:GetName(), carrier.name)
|
||||
MESSAGE:New(text, 60):ToAll()
|
||||
env.info(text)
|
||||
|
||||
end
|
||||
|
||||
--- Function called when an OPSGROUP is unloaded from the carrier.
|
||||
function opstransport:OnAfterUnloaded(From, Event, To, CargoOpsGroup, CarrierOpsGroup)
|
||||
local cargoopsgroup=CargoOpsGroup --Ops.ArmyGroup#ARMYGROUP
|
||||
local carrieropsgroup=CarrierOpsGroup --Ops.ArmyGroup#ARMYGROUP
|
||||
|
||||
-- Info message.
|
||||
local text=string.format("Transport UID=%d unloaded opsgroup %s from carrier group %s", opstransport:GetUID(), cargoopsgroup:GetName(), carrieropsgroup:GetName())
|
||||
MESSAGE:New(text, 60):ToAll()
|
||||
env.info(text)
|
||||
|
||||
-- OPSGROUP is ready for further actions. Put up green smoke.
|
||||
cargoopsgroup:GetGroup():SmokeGreen()
|
||||
|
||||
end
|
||||
|
||||
--- Function called when transport was delivered or everyone (remaining) is dead.
|
||||
function opstransport:OnAfterDelivered(From, Event, To)
|
||||
local text=string.format("Transport UID=%d was delivered. Ncargo=%d Ndelivered=%d", opstransport:GetUID(), opstransport:GetNcargoTotal(), opstransport:GetNcargoDelivered())
|
||||
MESSAGE:New(text, 60):ToAll()
|
||||
env.info(text)
|
||||
end
|
||||
Binary file not shown.
@@ -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 ..
|
||||
@@ -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" *
|
||||
@@ -0,0 +1,52 @@
|
||||
---
|
||||
-- GROUND Transport with Mission
|
||||
--
|
||||
-- TPz Fuchs groups is assigned to transport an infantry group from Kobuleti Town to zone Alpha.
|
||||
--
|
||||
-- However, the carriers are currently on a mission to patrol zone Engage X. They will not conduct any transport
|
||||
-- assignments until that mission is over. The patrol mission is scheduled to end at 0910 hours.
|
||||
--
|
||||
-- Also, the infantry is currently on a mission. It will not be transported until that mission is over.
|
||||
-- The mission ends at 0920 hours.
|
||||
--
|
||||
-- The carriers are assigned to carry out another patrol mission in zone Kobuleti X. That mission starts at 0915 hours
|
||||
-- and ends at 0940 hours. When the mission starts, the carriers are still busy with the transport. The mission will not
|
||||
-- start until all cargo has been delivered.
|
||||
--
|
||||
|
||||
-- Zones.
|
||||
local zonePickup=ZONE:New("Zone Kobuleti Town"):DrawZone()
|
||||
local zoneDeploy=ZONE:New("Zone Alpha"):DrawZone()
|
||||
local zoneKobuletiX=ZONE:New("Zone Kobuleti X"):DrawZone()
|
||||
local zoneEngageX=ZONE:New("Zone Engage X"):DrawZone()
|
||||
|
||||
-- Mission to patrol Zone Engage X until 0910 hours.
|
||||
local missionPatrol1=AUFTRAG:NewPATROLZONE(zoneEngageX)
|
||||
missionPatrol1:SetTime(nil, "9:10")
|
||||
|
||||
-- Mission to patrol Zone Kobuleti X form 0915 to 0940 hours.
|
||||
local missionPatrol2=AUFTRAG:NewPATROLZONE(zoneKobuletiX)
|
||||
missionPatrol2:SetTime("9:15", "9:40")
|
||||
|
||||
-- Mission to stand guard until 0920 hours.
|
||||
local missionGuard=AUFTRAG:NewONGUARD(zonePickup:GetCoordinate())
|
||||
missionGuard:SetTime(nil, "9:20")
|
||||
|
||||
-- Cargo group.
|
||||
local infantry=ARMYGROUP:New("Infantry Platoon Bravo-1"):Activate()
|
||||
|
||||
-- Add mission to cargo group.
|
||||
infantry:AddMission(missionGuard)
|
||||
|
||||
-- Carrier group.
|
||||
local carrier=ARMYGROUP:New("AAV-7-1"):Activate()
|
||||
|
||||
-- Transport assignment.
|
||||
local transport=OPSTRANSPORT:New(infantry, zonePickup, zoneDeploy)
|
||||
|
||||
-- Add transport to carrier.
|
||||
carrier:AddOpsTransport(transport)
|
||||
|
||||
-- Add patrol missions to carrier.
|
||||
carrier:AddMission(missionPatrol1)
|
||||
carrier:AddMission(missionPatrol2)
|
||||
Binary file not shown.
@@ -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 ..
|
||||
@@ -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" *
|
||||
@@ -0,0 +1,31 @@
|
||||
---
|
||||
-- HELO: Basic Transport
|
||||
--
|
||||
-- Two Huey groups are stationed at FARP Berlin. Both are assigned to pickup troops at zone Kobuleti X and deliver them to zone Bravo.
|
||||
---
|
||||
|
||||
-- Pickup and deploy zones.
|
||||
local zonePickup=ZONE:New("Zone Kobuleti X")
|
||||
local zoneDeploy=ZONE:New("Zone Bravo")
|
||||
|
||||
-- Cargo set.
|
||||
local infantryset=SET_GROUP:New():FilterPrefixes("Infantry Platoon Alpha"):FilterOnce()
|
||||
infantryset:Activate()
|
||||
|
||||
-- Cargo transport assignment.
|
||||
local opstransport=OPSTRANSPORT:New(infantryset, zonePickup, zoneDeploy)
|
||||
|
||||
-- Huey Carrier.
|
||||
local hueyAlpha1=FLIGHTGROUP:New("UH-1H Alpha-1")
|
||||
hueyAlpha1:Activate()
|
||||
|
||||
-- Cargo transport assignment to first Huey group.
|
||||
hueyAlpha1:AddOpsTransport(opstransport)
|
||||
|
||||
|
||||
-- Huey Carrier.
|
||||
local hueyAlpha2=FLIGHTGROUP:New("UH-1H Alpha-2")
|
||||
hueyAlpha2:Activate()
|
||||
|
||||
-- Add transport to second Huey.
|
||||
hueyAlpha2:AddOpsTransport(opstransport)
|
||||
Binary file not shown.
@@ -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 ..
|
||||
@@ -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" *
|
||||
@@ -0,0 +1,29 @@
|
||||
---
|
||||
-- HELO: Transport FARP to FARP
|
||||
--
|
||||
-- A Huey group is stationed at Farp Berlin.
|
||||
-- It is assigned to transport Infantry groups from Farp Berlin to Farp London.
|
||||
--
|
||||
-- *** IMPORTANT ***
|
||||
--
|
||||
-- Note that both the pickup and the deploy zones are ZONE_AIRBASE type objects here!
|
||||
-- If a pickup or deploy zone is a ZONE_AIRBASE instead of a ZONE, aircraft will land
|
||||
-- at the airbase parkings for pickup or deployment of cargo.
|
||||
---
|
||||
|
||||
-- Carrier group.
|
||||
local huey=FLIGHTGROUP:New("UH-1H Alpha-1")
|
||||
|
||||
-- Pickup and deploy zones. Both are ZONE_AIRBASES so the helo lands at the airbase.
|
||||
local zonePickup=ZONE_AIRBASE:New("Farp Berlin")
|
||||
local zoneDeploy=ZONE_AIRBASE:New("Farp London")
|
||||
|
||||
-- Cargo set.
|
||||
local cargoset=SET_OPSGROUP:New():FilterPrefixes("Infantry Platoon Charlie"):FilterOnce() --Core.Set#SET_OPSGROUP
|
||||
cargoset:Activate()
|
||||
|
||||
-- Transport assignment.
|
||||
local transport=OPSTRANSPORT:New(cargoset, zonePickup, zoneDeploy)
|
||||
|
||||
-- Assign transport to Huey.
|
||||
huey:AddOpsTransport(transport)
|
||||
Binary file not shown.
@@ -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 ..
|
||||
@@ -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" *
|
||||
@@ -0,0 +1,33 @@
|
||||
---
|
||||
-- HELO: FARP to Ship
|
||||
--
|
||||
-- A Huey group is ordered to transport troops from Farp Berlin to the USS Shiloh.
|
||||
--
|
||||
-- As ground groups can "stand" on ships in DCS, the troops are directly loaded into
|
||||
-- the cargo bay of the ship.
|
||||
--
|
||||
-- NOTE that the deploy zone of the ship is a ZONE_AIRBASE object.
|
||||
-- Only if it is a ZONE_AIRBASE the helo will land on the landing platform of the ship.
|
||||
---
|
||||
|
||||
-- Carrier.
|
||||
local huey=FLIGHTGROUP:New("UH-1H Alpha-1")
|
||||
huey:Activate(1)
|
||||
|
||||
-- Destination.
|
||||
local ship=NAVYGROUP:New("Ticonderoga Alpha")
|
||||
ship:Activate()
|
||||
|
||||
-- Pickup and deploy zones. Must be ZONE_AIRBASEs!
|
||||
local zonePickup=ZONE_AIRBASE:New("Farp Berlin")
|
||||
local zoneDeploy=ZONE_AIRBASE:New("USS Shiloh")
|
||||
|
||||
-- Cargo set.
|
||||
local infset=SET_OPSGROUP:New():FilterPrefixes("Infantry Platoon Charlie"):FilterOnce()
|
||||
infset:Activate()
|
||||
|
||||
-- Create a transport assignment from FARP to Ship. The cargo is directly transferred into the carrier!
|
||||
local transport=OPSTRANSPORT:New(infset, zonePickup, zoneDeploy)
|
||||
|
||||
-- Assign transport to Huey.
|
||||
huey:AddOpsTransport(transport)
|
||||
Binary file not shown.
@@ -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 ..
|
||||
@@ -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" *
|
||||
Binary file not shown.
@@ -0,0 +1,26 @@
|
||||
---
|
||||
-- HELO: Zone to Airbase from FARP
|
||||
--
|
||||
-- Huey group stationed at Farp Berlin picks up cargo in Zone Kobuleti X and delivers them
|
||||
-- to Kobuleti airbase.
|
||||
--
|
||||
-- Note that the deploy zone is a ZONE_AIRBASE object!
|
||||
---
|
||||
|
||||
-- Pickup and deploy zones.
|
||||
local zonePickup=ZONE:New("Zone Kobuleti X"):DrawZone()
|
||||
local zoneDeploy=ZONE_AIRBASE:New(AIRBASE.Caucasus.Kobuleti):DrawZone()
|
||||
|
||||
-- Cargo set.
|
||||
local infantryset=SET_GROUP:New():FilterPrefixes("Infantry Platoon Alpha-1"):FilterOnce()
|
||||
infantryset:Activate()
|
||||
|
||||
-- Cargo transport assignment.
|
||||
local opstransport=OPSTRANSPORT:New(infantryset, zonePickup, zoneDeploy)
|
||||
|
||||
-- Huey Carrier.
|
||||
local hueyAlpha1=FLIGHTGROUP:New("UH-1H Alpha-1")
|
||||
hueyAlpha1:Activate()
|
||||
|
||||
-- Cargo transport assignment to the Huey group.
|
||||
hueyAlpha1:AddOpsTransport(opstransport)
|
||||
@@ -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 ..
|
||||
@@ -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" *
|
||||
@@ -0,0 +1,54 @@
|
||||
---
|
||||
-- HELO: Respawn after Destroyed
|
||||
--
|
||||
-- Huey is ordered to transport infantry.
|
||||
--
|
||||
-- Before the cargo can be loaded, the enemy destroys the Huey.
|
||||
-- The group is then respawned and the transport is newly assigned.
|
||||
--
|
||||
-- The respawned huey is really unlucky and gets destroyed again
|
||||
-- 60 seconds after taking off. This also destroys the loaded cargo groups.
|
||||
|
||||
-- However, it seems to have seven lives and gets respawned again.
|
||||
-- The remaining infantry group is loaded and safely delivered to the deploy zone.
|
||||
---
|
||||
|
||||
-- Carrier group.
|
||||
local huey=FLIGHTGROUP:New("UH-1H Alpha-1")
|
||||
|
||||
-- Pickup and deploy zones. Both are ZONE_AIRBASES so the helo lands at the airbase.
|
||||
local zonePickup=ZONE_AIRBASE:New("Farp Berlin")
|
||||
local zoneDeploy=ZONE_AIRBASE:New("Farp London")
|
||||
|
||||
-- Cargo set.
|
||||
local cargoset=SET_OPSGROUP:New():FilterPrefixes("Infantry Platoon Charlie"):FilterOnce() --Core.Set#SET_OPSGROUP
|
||||
cargoset:Activate()
|
||||
|
||||
-- Transport assignment.
|
||||
local transport=OPSTRANSPORT:New(cargoset, zonePickup, zoneDeploy)
|
||||
|
||||
-- Assign transport to Huey.
|
||||
huey:AddOpsTransport(transport)
|
||||
|
||||
-- Destroy the helo group.
|
||||
huey:SelfDestruction(90)
|
||||
|
||||
--- Function called after the helo is destroyed.
|
||||
function huey:OnAfterDestroyed(From, Event, To)
|
||||
huey:__Respawn(-1)
|
||||
end
|
||||
|
||||
--- Also destroy the huey once when airborne.
|
||||
local destroymeonce=true
|
||||
function huey:OnAfterAirborne()
|
||||
if destroymeonce then
|
||||
huey:SelfDestruction(60)
|
||||
destroymeonce=false
|
||||
end
|
||||
end
|
||||
|
||||
--- Function called when the carrier group is dead.
|
||||
function transport:OnAfterDeadCarrierGroup(From, Event, To, OpsGroup)
|
||||
local flightgroup=OpsGroup --Ops.OpsGroup#OPSGROUP
|
||||
flightgroup:AddOpsTransport(transport)
|
||||
end
|
||||
Binary file not shown.
@@ -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 ..
|
||||
@@ -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" *
|
||||
@@ -0,0 +1,78 @@
|
||||
---
|
||||
-- AIRPLANE: Basic Transport
|
||||
--
|
||||
-- A C-130 Hercules (spawned in air) is assigned to pick up heavy cargo (tanks) at Kobuleti and deliver them to Gudauta.
|
||||
--
|
||||
-- The homebase of the Hercules is Batumi. Once the cargo has been delivered, the plane will go there.
|
||||
--
|
||||
-- *** IMPORTANT ***
|
||||
--
|
||||
-- Note the the pickup and depoly zones have to be ZONE_AIRBASE objects as airplanes can only land at airbases.
|
||||
---
|
||||
|
||||
-- Carrier group.
|
||||
local c130=FLIGHTGROUP:New("C-130 Alpha")
|
||||
c130:Activate(1)
|
||||
|
||||
-- Define area where troops are unloaded relative to the aircraft.
|
||||
c130:SetCarrierUnloaderBack(50, 20)
|
||||
|
||||
-- The default cruise altitude of aircraft is 10,000 ft. Here we set it to 12,000 ft.
|
||||
c130:SetDefaultAltitude(12000)
|
||||
|
||||
-- Air start (i.e. no home or destination base). Set homebase to Batumi. Once the transport is finished, the aircarft will RTB to Batumi.
|
||||
c130:SetHomebase(AIRBASE:FindByName("Batumi"))
|
||||
|
||||
-- Pickup and deploy base. NOTE that we use ZONE_AIRBASE here, which is important for aircraft as they can only land there.
|
||||
local zonePickup=ZONE_AIRBASE:New("Kobuleti", 5000)
|
||||
local zoneDeploy=ZONE_AIRBASE:New(AIRBASE.Caucasus.Gudauta, 5000)
|
||||
|
||||
-- Cargo set.
|
||||
local cargoset=SET_GROUP:New():FilterPrefixes("Tank Platoon Kobuleti Alpha"):FilterOnce()
|
||||
cargoset:Activate()
|
||||
|
||||
-- Ops transport assignment.
|
||||
local transport=OPSTRANSPORT:New(cargoset, zonePickup, zoneDeploy)
|
||||
|
||||
-- Assign transport to C-130.
|
||||
c130:AddOpsTransport(transport)
|
||||
|
||||
---
|
||||
-- FSM events of the OPSTRANSPORT
|
||||
---
|
||||
|
||||
--- Function called when an OPSGROUP is loaded into a carrier.
|
||||
function transport:OnAfterLoaded(From, Event, To, CargoOpsGroup, CarrierOpsGroup, CarrierElement)
|
||||
local cargoopsgroup=CargoOpsGroup --Ops.ArmyGroup#ARMYGROUP
|
||||
local carrieropsgroup=CarrierOpsGroup --Ops.ArmyGroup#ARMYGROUP
|
||||
local carrier=CarrierElement --Ops.OpsGroup#OPSGROUP.Element
|
||||
|
||||
-- Info message.
|
||||
local text=string.format("Transport UID=%d opsgroup %s loaded into carrier %s", transport:GetUID(), cargoopsgroup:GetName(), carrier.name)
|
||||
MESSAGE:New(text, 60):ToAll()
|
||||
env.info(text)
|
||||
|
||||
end
|
||||
|
||||
--- Function called when an OPSGROUP is unloaded from the carrier.
|
||||
function transport:OnAfterUnloaded(From, Event, To, CargoOpsGroup, CarrierOpsGroup)
|
||||
local cargoopsgroup=CargoOpsGroup --Ops.ArmyGroup#ARMYGROUP
|
||||
local carrieropsgroup=CarrierOpsGroup --Ops.ArmyGroup#ARMYGROUP
|
||||
|
||||
-- Info message.
|
||||
local text=string.format("Transport UID=%d unloaded opsgroup %s from carrier group %s", transport:GetUID(), cargoopsgroup:GetName(), carrieropsgroup:GetName())
|
||||
MESSAGE:New(text, 60):ToAll()
|
||||
env.info(text)
|
||||
|
||||
-- OPSGROUP is ready for further actions. Put up green smoke.
|
||||
cargoopsgroup:GetGroup():SmokeGreen()
|
||||
|
||||
end
|
||||
|
||||
--- Function called when transport was delivered or everyone (remaining) is dead.
|
||||
function transport:OnAfterDelivered(From, Event, To)
|
||||
-- Info Message
|
||||
local text=string.format("Transport UID=%d was delivered. Ncargo=%d Ndelivered=%d", transport:GetUID(), transport:GetNcargoTotal(), transport:GetNcargoDelivered())
|
||||
MESSAGE:New(text, 60):ToAll()
|
||||
env.info(text)
|
||||
end
|
||||
Binary file not shown.
@@ -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 ..
|
||||
@@ -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" *
|
||||
@@ -0,0 +1,26 @@
|
||||
---
|
||||
-- AIRPLANE: Transport Base to Base
|
||||
--
|
||||
-- A C-130 is stationed at Kobuleti. It is assigned to transport cargo to Gudauta.
|
||||
---
|
||||
|
||||
-- Hercules
|
||||
local c130=FLIGHTGROUP:New("C-130 Kobuleti Bravo")
|
||||
c130:Activate(1)
|
||||
|
||||
-- Define area where troops are unloaded.
|
||||
c130:SetCarrierUnloaderBack(50, 20)
|
||||
|
||||
-- Pickup and deploy zones.
|
||||
local zonePickup=ZONE_AIRBASE:New("Kobuleti", 5000)
|
||||
local zoneDeploy=ZONE_AIRBASE:New(AIRBASE.Caucasus.Gudauta, 5000)
|
||||
|
||||
-- Cargo set.
|
||||
local cargoset=SET_OPSGROUP:New():FilterPrefixes("Tank Platoon Kobuleti Alpha"):FilterOnce()
|
||||
cargoset:Activate()
|
||||
|
||||
-- Cargo transport assignment.
|
||||
local transport=OPSTRANSPORT:New(cargoset, zonePickup, zoneDeploy)
|
||||
|
||||
-- Add cargo transport.
|
||||
c130:AddOpsTransport(transport)
|
||||
Binary file not shown.
@@ -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 ..
|
||||
@@ -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" *
|
||||
@@ -0,0 +1,38 @@
|
||||
---
|
||||
-- AIRPLANE: Heavy Lift
|
||||
--
|
||||
-- A C-17 is stationed at Kobuleti. It is assigned to transport cargo to Gudauta.
|
||||
--
|
||||
-- The cargo consists of
|
||||
--
|
||||
-- * 2 M2 Bradley (total weight 42,600 kg)
|
||||
-- * 3 M1126 Stryker (total weight 51711 kg)
|
||||
-- * 1 M1 Abrams (total weight 57154 kg)
|
||||
--
|
||||
-- Note that the cargo capacity of the C-17 heavily depends on its internal fuel.
|
||||
-- When full, its interal fuel ways 132,000 kg.
|
||||
-- If fully loaded, it can only carry 7,300 kg payload.
|
||||
-- If fuel is only half full, it can carry 73,000 kg payload.
|
||||
---
|
||||
|
||||
-- Hercules
|
||||
local c17=FLIGHTGROUP:New("C-17A Kobuleti Alpha")
|
||||
c17:Activate(1)
|
||||
|
||||
-- Define area where troops are unloaded.
|
||||
c17:SetCarrierUnloaderBack(50, 20)
|
||||
|
||||
-- Pickup and deploy zones.
|
||||
local zonePickup=ZONE_AIRBASE:New("Kobuleti", 5000)
|
||||
local zoneDeploy=ZONE_AIRBASE:New(AIRBASE.Caucasus.Gudauta, 5000)
|
||||
|
||||
-- Cargo set.
|
||||
local cargoset=SET_OPSGROUP:New():FilterPrefixes("Tank Platoon Kobuleti Delta"):FilterOnce()
|
||||
cargoset:Activate()
|
||||
|
||||
-- Cargo transport assignment.
|
||||
local transport=OPSTRANSPORT:New(cargoset, zonePickup, zoneDeploy)
|
||||
transport:SetVerbosity(3)
|
||||
|
||||
-- Add cargo transport.
|
||||
c17:AddOpsTransport(transport)
|
||||
Binary file not shown.
@@ -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 ..
|
||||
@@ -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" *
|
||||
@@ -0,0 +1,31 @@
|
||||
---
|
||||
-- AIRPLANE: Realistic Weight-Realistic Problems
|
||||
--
|
||||
-- When cargo is loaded into an aircraft, the weight of the carrier
|
||||
-- is increased via the trigger.action.setUnitInternalCargo() function.
|
||||
--
|
||||
-- This can lead to "problems" as it affects the flight characteristings.
|
||||
--
|
||||
-- To demonstrate this effect, we add 100 tons of cargo to a C-130 and
|
||||
-- let it take off.
|
||||
--
|
||||
-- With the additional weight, the takeoff length increases significantly.
|
||||
-- The runway at Kobuleti is too short and the aircraft will crash at the
|
||||
-- end of the runway.
|
||||
--
|
||||
-- For comparison, a second C-130 without additional cargo takes off with
|
||||
-- no problems.
|
||||
---
|
||||
|
||||
-- C-130 without cargo.
|
||||
local c130bravo=FLIGHTGROUP:New("C-130 Kobuleti Bravo")
|
||||
c130bravo:Activate()
|
||||
c130bravo:StartUncontrolled(1)
|
||||
|
||||
-- C-130 with 100,0000 kg (artificial) cargo loaded.
|
||||
local c130charlie=FLIGHTGROUP:New("C-130 Kobuleti Charlie")
|
||||
c130charlie:Activate()
|
||||
c130charlie:StartUncontrolled(1)
|
||||
|
||||
-- Add cargo weight.
|
||||
c130charlie:AddWeightCargo("C-130 Kobuleti Charlie-1", 100*1000)
|
||||
Binary file not shown.
@@ -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 ..
|
||||
@@ -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" *
|
||||
@@ -0,0 +1,36 @@
|
||||
---
|
||||
-- AIRPLANE: Cancel Transport for Flight
|
||||
--
|
||||
-- Two Hercules stationed at Kobuleti are assigned to transport cargo from Gudauta to Senaki.
|
||||
--
|
||||
-- After 10 min there is a change of plan and one of the C-130s cancels the transport.
|
||||
-- It will then RTB, while the other C-130 carries out the transport.
|
||||
---
|
||||
|
||||
-- Hercules at Kobuleti.
|
||||
local c130bravo=FLIGHTGROUP:New("C-130 Kobuleti Bravo")
|
||||
c130bravo:SetCarrierUnloaderBack(50, 20)
|
||||
c130bravo:Activate(1)
|
||||
|
||||
-- Hercules at Gudauta.
|
||||
local c130charlie=FLIGHTGROUP:New("C-130 Kobuleti Charlie")
|
||||
c130charlie:SetCarrierUnloaderBack(50, 20)
|
||||
c130charlie:Activate(1)
|
||||
|
||||
-- Pickup and deploy zones.
|
||||
local zonePickup=ZONE_AIRBASE:New(AIRBASE.Caucasus.Gudauta, 5000)
|
||||
local zoneDeploy=ZONE_AIRBASE:New(AIRBASE.Caucasus.Senaki_Kolkhi, 5000)
|
||||
|
||||
-- Cargo set.
|
||||
local cargoset=SET_OPSGROUP:New():FilterPrefixes("Tank Platoon Gudauta Alpha"):FilterOnce()
|
||||
cargoset:Activate()
|
||||
|
||||
-- Cargo transport assignment.
|
||||
local transport=OPSTRANSPORT:New(cargoset, zonePickup, zoneDeploy)
|
||||
|
||||
-- Add cargo transport.
|
||||
c130bravo:AddOpsTransport(transport)
|
||||
c130charlie:AddOpsTransport(transport)
|
||||
|
||||
-- Hercules bravo cancels the transport.
|
||||
c130bravo:__TransportCancel(10*60, transport)
|
||||
Binary file not shown.
@@ -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 ..
|
||||
@@ -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" *
|
||||
@@ -0,0 +1,36 @@
|
||||
---
|
||||
-- AIRPLANE: Cancel Transport for All
|
||||
--
|
||||
-- Two Hercules stationed at Kobuleti are assigned to transport cargo from Gudauta to Senaki.
|
||||
--
|
||||
-- After 10 min there is a change of plan the transport is cancelled.
|
||||
-- All assigned carriers will RTB to their home base.
|
||||
---
|
||||
|
||||
-- Hercules at Kobuleti.
|
||||
local c130bravo=FLIGHTGROUP:New("C-130 Kobuleti Bravo")
|
||||
c130bravo:SetCarrierUnloaderBack(50, 20)
|
||||
c130bravo:Activate(1)
|
||||
|
||||
-- Hercules at Kobuleti.
|
||||
local c130charlie=FLIGHTGROUP:New("C-130 Kobuleti Charlie")
|
||||
c130charlie:SetCarrierUnloaderBack(50, 20)
|
||||
c130charlie:Activate(1)
|
||||
|
||||
-- Pickup and deploy zones.
|
||||
local zonePickup=ZONE_AIRBASE:New(AIRBASE.Caucasus.Gudauta, 5000)
|
||||
local zoneDeploy=ZONE_AIRBASE:New(AIRBASE.Caucasus.Senaki_Kolkhi, 5000)
|
||||
|
||||
-- Cargo set.
|
||||
local cargoset=SET_OPSGROUP:New():FilterPrefixes("Tank Platoon Gudauta Alpha"):FilterOnce()
|
||||
cargoset:Activate()
|
||||
|
||||
-- Cargo transport assignment.
|
||||
local transport=OPSTRANSPORT:New(cargoset, zonePickup, zoneDeploy)
|
||||
|
||||
-- Add cargo transport.
|
||||
c130bravo:AddOpsTransport(transport)
|
||||
c130charlie:AddOpsTransport(transport)
|
||||
|
||||
-- Cancel the transport
|
||||
transport:__Cancel(10*60)
|
||||
Binary file not shown.
@@ -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 ..
|
||||
@@ -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" *
|
||||
@@ -0,0 +1,40 @@
|
||||
---
|
||||
-- NAVAL Basic Transport
|
||||
--
|
||||
-- The USS Shiloh is ordered to transport infantry from Zone Shore Alpha to Zone Shore Bravo.
|
||||
--
|
||||
-- Firstly, we need the usual pickup and deloy zones. These are the zones where the ship will go.
|
||||
--
|
||||
-- As ships obviously cannot pickup troops on land and ground groups are not good at swimming.
|
||||
-- Therefore, we define embark and disembark zones. These are the zones where the troops are
|
||||
-- supposed to wait for their transport.
|
||||
--
|
||||
-- If embark and/or disembark zones are defined, the troops need to be in these zones rather than
|
||||
-- the pickup and deploy zones to be considered for transport.
|
||||
--
|
||||
-- Note that embark and disembark zones can also be used for ARMY- and FLIGHTGROUP carriers.
|
||||
---
|
||||
|
||||
-- Zones.
|
||||
local zonePickup=ZONE:New("Zone Sea Alpha"):DrawZone()
|
||||
local zoneDeploy=ZONE:New("Zone Sea Bravo"):DrawZone()
|
||||
local zoneEmbark=ZONE:New("Zone Shore Alpha"):DrawZone()
|
||||
local zoneDisembark=ZONE:New("Zone Shore Bravo"):DrawZone()
|
||||
|
||||
-- Carrier group.
|
||||
local carrier=NAVYGROUP:New("Ticonderoga Alpha")
|
||||
carrier:Activate()
|
||||
|
||||
-- Infantry cargo group.
|
||||
local CargoGroup=GROUP:FindByName("Infantry Platoon Delta-1")
|
||||
CargoGroup:Activate()
|
||||
|
||||
-- Transport assignment.
|
||||
local transport=OPSTRANSPORT:New(CargoGroup, zonePickup, zoneDeploy)
|
||||
|
||||
-- Set embark and disembark zone. These are the zones where the troops are supposed to be.
|
||||
transport:SetEmbarkZone(zoneEmbark)
|
||||
transport:SetDisembarkZone(zoneDisembark)
|
||||
|
||||
-- Assign transport to carrier.
|
||||
carrier:AddOpsTransport(transport)
|
||||
Binary file not shown.
@@ -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 ..
|
||||
@@ -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" *
|
||||
@@ -0,0 +1,57 @@
|
||||
---
|
||||
-- NAVAL: Transport Ship-to-Ship
|
||||
--
|
||||
-- A speed boat is used to transfer troops from the beach to the bigger transport ship.
|
||||
-- The speed boat needs to go two times to deliver all troops.
|
||||
--
|
||||
-- Once the speed boat has finished its transport assignment, the Handy Wind will transport
|
||||
-- the troops to another deploy zone.
|
||||
---
|
||||
|
||||
-- Zones.
|
||||
local zonePickup=ZONE:New("Zone Sea Alpha"):DrawZone()
|
||||
local zoneDeploy=ZONE:New("Zone Sea Bravo"):DrawZone()
|
||||
local zoneSurf=ZONE:New("Zone Surf Alpha"):DrawZone()
|
||||
local zoneEmbark=ZONE:New("Zone Shore Alpha"):DrawZone()
|
||||
local zoneDisembark=ZONE:New("Zone Shore Bravo"):DrawZone()
|
||||
|
||||
-- Carrier group.
|
||||
local speedboat=NAVYGROUP:New("Speed Boat Alpha-1")
|
||||
speedboat:Activate()
|
||||
|
||||
-- Carrier group.
|
||||
local handywind=NAVYGROUP:New("Handy Wind")
|
||||
handywind:Activate()
|
||||
|
||||
-- Infantry cargo group.
|
||||
local CargoGroup=SET_GROUP:New():FilterPrefixes("Infantry Platoon Delta"):FilterOnce()
|
||||
CargoGroup:Activate()
|
||||
|
||||
-- Transport assignment to deliver
|
||||
local transfer=OPSTRANSPORT:New(CargoGroup, zoneSurf, zonePickup)
|
||||
|
||||
-- Set embark and disembark zone. These are the zones where the troops are supposed to be.
|
||||
transfer:SetEmbarkZone(zoneEmbark)
|
||||
|
||||
-- Direct disembark to Handy Wind. The Handy wind has to be in the pickup zone for the
|
||||
-- cargo groups to be transferred from the speed boats.
|
||||
transfer:SetDisembarkCarriers(handywind)
|
||||
|
||||
-- Assign transport to carrier.
|
||||
speedboat:AddOpsTransport(transfer)
|
||||
|
||||
|
||||
-- Transport assignment.
|
||||
local transport=OPSTRANSPORT:New(CargoGroup, zonePickup, zoneDeploy)
|
||||
|
||||
-- Set disembark zone.
|
||||
transport:SetDisembarkZone(zoneDisembark)
|
||||
|
||||
-- Set required cargos. These group(s) need to be loaded before the _first_ transport starts.
|
||||
-- Here this is advisable because the speed boats cannot transport all infantry in one go.
|
||||
-- If this is not set, the Hany wind would already start the transport when the first
|
||||
-- batch of cargo has been loaded.
|
||||
transport:SetRequiredCargos(CargoGroup)
|
||||
|
||||
-- Assign transport to carrier.
|
||||
handywind:AddOpsTransport(transport)
|
||||
Binary file not shown.
@@ -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 ..
|
||||
@@ -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" *
|
||||
@@ -0,0 +1,103 @@
|
||||
---
|
||||
-- NAVAL: Transport Ship-to-Ship but ferry ships are transported as well.
|
||||
--
|
||||
-- Three speed boats are used to transfer troops from the beach to a bigger transport ship.
|
||||
-- Only one is actually needed to transport all troops.
|
||||
--
|
||||
-- Once the speed boat has finished its transport assignment, all three speed boats are
|
||||
-- loaded into the Handy Wind as well.
|
||||
--
|
||||
-- All cargo is then transported to the deploy zone.
|
||||
--
|
||||
-- At the deploy zone, the speed boats will then transfer the troops from the Handy Wind
|
||||
-- to the shore.
|
||||
---
|
||||
|
||||
-- Zones.
|
||||
local zonePickup=ZONE:New("Zone Sea Alpha"):DrawZone()
|
||||
local zoneDeploy=ZONE:New("Zone Sea Bravo"):DrawZone()
|
||||
|
||||
-- Surf zones near the shores. This is where the speed boats will go to pickup and deploy the infantry groops.
|
||||
local zoneSurfA=ZONE:New("Zone Surf Alpha"):DrawZone()
|
||||
local zoneSurfB=ZONE:New("Zone Surf Bravo"):DrawZone()
|
||||
|
||||
-- Embark and disembark zones for infantry.
|
||||
local zoneEmbark=ZONE:New("Zone Shore Alpha"):DrawZone()
|
||||
local zoneDisembark=ZONE:New("Zone Shore Bravo"):DrawZone()
|
||||
|
||||
-- Carrier group.
|
||||
local handywind=NAVYGROUP:New("Handy Wind")
|
||||
handywind:Activate()
|
||||
|
||||
-- Infantry group set.
|
||||
local InfantrySet=SET_OPSGROUP:New():FilterPrefixes("Infantry Platoon Delta-1"):FilterOnce()
|
||||
InfantrySet:Activate()
|
||||
|
||||
-- Speed boat group set.
|
||||
local SpeedboatSet=SET_OPSGROUP:New():FilterPrefixes("Speed Boat Alpha"):FilterOnce()
|
||||
SpeedboatSet:Activate()
|
||||
|
||||
-- All cargo groups of the main transport.
|
||||
local AllCargo=SET_OPSGROUP:New():FilterPrefixes("Infantry Platoon Delta-1"):FilterPrefixes("Speed Boat Alpha"):FilterOnce()
|
||||
|
||||
---
|
||||
-- Transfer from Shore Alpha to Pickup zone
|
||||
---
|
||||
|
||||
-- Transport assignment for Speedboat: Pickup Infantry and deliver to pick up zone of Handy wind.
|
||||
local transfer1=OPSTRANSPORT:New(InfantrySet, zoneSurfA, zonePickup)
|
||||
|
||||
-- Set embark and disembark zone. These are the zones where the troops are supposed to be.
|
||||
transfer1:SetEmbarkZone(zoneEmbark)
|
||||
|
||||
-- Direct disembark to Handy Wind.
|
||||
transfer1:SetDisembarkCarriers(handywind)
|
||||
|
||||
--- Function called when all cargo groups have beed delivered.
|
||||
function transfer1:OnAfterDelivered()
|
||||
-- Ensure that all carriers are inside the pickup zone.
|
||||
local carriers=transfer1:GetCarriers()
|
||||
for _,_carrier in pairs(carriers) do
|
||||
local carrier=_carrier --Ops.NavyGroup#NAVYGROUP
|
||||
if not carrier:IsInZone(zonePickup) then
|
||||
carrier:AddWaypoint(zonePickup:GetRandomCoordinate())
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---
|
||||
-- Transport from Pickup to Deploy zone
|
||||
---
|
||||
|
||||
-- Transport assignment.
|
||||
local transport=OPSTRANSPORT:New(SpeedboatSet, zonePickup, zoneDeploy)
|
||||
|
||||
-- We add the Infantry troops as well, but set them to be unloaded in late activated state so they dont float on the water.
|
||||
transport:AddCargoGroups(InfantrySet, nil, false)
|
||||
|
||||
-- Set that all cargo is required before transport of the FIRST batch starts. Handy Wind is large enough to carry everything in one go.
|
||||
transport:SetRequiredCargos(AllCargo)
|
||||
|
||||
---
|
||||
-- Transfer from Deploy zone zo Shore Bravo
|
||||
---
|
||||
|
||||
-- Transport assignment.
|
||||
local transfer2=OPSTRANSPORT:New(InfantrySet, zoneDeploy, zoneSurfB)
|
||||
transfer2:SetDisembarkZone(zoneDisembark)
|
||||
transfer2:SetRequiredCargos(InfantrySet)
|
||||
transfer2:AddConditionStart(
|
||||
function()
|
||||
return (transport:IsDelivered() and transport:GetNcargoDelivered()>0)
|
||||
end)
|
||||
|
||||
|
||||
-- Assign transport to carrier.
|
||||
SpeedboatSet:ForEach(
|
||||
function(speedboat)
|
||||
speedboat:AddOpsTransport(transfer1)
|
||||
speedboat:AddOpsTransport(transfer2)
|
||||
end)
|
||||
|
||||
-- Assign transport to carrier.
|
||||
handywind:AddOpsTransport(transport)
|
||||
Binary file not shown.
@@ -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 ..
|
||||
@@ -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" *
|
||||
@@ -0,0 +1,52 @@
|
||||
---
|
||||
-- NAVAL: Direct Load
|
||||
--
|
||||
-- The Seawise Giant is coming from far, far away and delivers cargo toops to an oil rig.
|
||||
--
|
||||
-- For lack of time, we do not want to simulate the whole transport process. So the cargo groups are placed
|
||||
-- anywhere on the map and directly loaded into the Seawise, which is already close to its destination.
|
||||
--
|
||||
-- As ground troops cannot stand on oil rigs, the disembarkment happens "in utero", i.e. troops are not spawned.
|
||||
-- But they could be picked up later by a helo, for instance, and be delivered to another destination.
|
||||
---
|
||||
|
||||
-- Zones.
|
||||
local zoneSeawise=ZONE_GROUP:New("Seawise", GROUP:FindByName("Seawise Giant"), 1000)
|
||||
local zoneShell=ZONE:New("Zone Shell"):DrawZone()
|
||||
|
||||
-- Carrier group.
|
||||
local seawise=NAVYGROUP:New("Seawise Giant")
|
||||
seawise:Activate()
|
||||
seawise:SetVerbosity(2)
|
||||
|
||||
|
||||
-- Infantry cargo group.
|
||||
local CargoGroup=SET_GROUP:New():FilterPrefixes("Infantry Platoon Delta"):FilterOnce()
|
||||
CargoGroup:Activate()
|
||||
|
||||
-- Transport assignment.
|
||||
local transport=OPSTRANSPORT:New(CargoGroup, zoneSeawise, zoneShell)
|
||||
transport:SetVerbosity(3)
|
||||
transport:SetDisembarkInUtero()
|
||||
|
||||
-- Add transport assignment.
|
||||
seawise:AddOpsTransport(transport)
|
||||
|
||||
-- Load all defined cargo.
|
||||
for _,_opsgroup in pairs(transport:GetCargoOpsGroups(false)) do
|
||||
seawise:__Load(30, _opsgroup)
|
||||
end
|
||||
|
||||
--- Function called when carrier loaded all cargo.
|
||||
function seawise:OnAfterLoaded(From, Event, To, OpsGroupCargo)
|
||||
local opsgroup=OpsGroupCargo --Ops.OpsGroup#OPSGROUP
|
||||
env.info(string.format("Loaded opsgroup %s", opsgroup:GetName()))
|
||||
end
|
||||
|
||||
--- Function called when carrier unloaded a cargo group.
|
||||
function seawise:OnAfterUnloaded(From, Event, To, OpsGroupCargo)
|
||||
local opsgroup=OpsGroupCargo --Ops.OpsGroup#OPSGROUP
|
||||
local text=string.format("Unloaded opsgroup %s", opsgroup:GetName())
|
||||
env.info(text)
|
||||
opsgroup:GetCoordinate():MarkToAll(text)
|
||||
end
|
||||
Binary file not shown.
@@ -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 ..
|
||||
@@ -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" *
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user