mirror of
https://github.com/FlightControl-Master/MOOSE_MISSIONS.git
synced 2025-08-15 10:37:46 +00:00
Updated Moose.lua
This commit is contained in:
@@ -1,39 +1,39 @@
|
||||
------------------
|
||||
-- Self Request --
|
||||
------------------
|
||||
-- 1. Two groups of infantry are spawned in the Batumi spawn zone.
|
||||
-- 2. After ~10 seconds they are put back into the warehouse stock.
|
||||
-- 3. After some time they are spawned again.
|
||||
-- 4. And so on and so forth...
|
||||
|
||||
-- Create a WAREHOUSE object.
|
||||
local warehouseBatumi=WAREHOUSE:New(STATIC:FindByName("Warehouse Batumi"), "Batumi")
|
||||
|
||||
-- Start warehouse Batumi.
|
||||
warehouseBatumi:Start()
|
||||
|
||||
-- Add one infantry asset.
|
||||
warehouseBatumi:AddAsset(GROUP:FindByName("Infantry Platoon Alpha"), 4)
|
||||
|
||||
-- Add self request for one infantry at Batumi.
|
||||
warehouseBatumi:AddRequest(warehouseBatumi, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 2)
|
||||
|
||||
--- Self request event. Triggered once the assets are spawned in the spawn zone or at the airbase.
|
||||
function warehouseBatumi:OnAfterSelfRequest(From, Event, To, groupset, request)
|
||||
local groupset=groupset --Core.Set#SET_GROUP
|
||||
|
||||
-- Loop over all groups spawned from that request.
|
||||
for _,group in pairs(groupset:GetSet()) do
|
||||
local group=group --Wrapper.Group#GROUP
|
||||
|
||||
-- Gree smoke on spawned group.
|
||||
--group:SmokeGreen()
|
||||
|
||||
-- Put asset back to stock after 10 seconds.
|
||||
warehouseBatumi:__AddAsset(10, group)
|
||||
end
|
||||
|
||||
-- Add new self request after 20 seconds.
|
||||
warehouseBatumi:__AddRequest(20, warehouseBatumi, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 2)
|
||||
|
||||
end
|
||||
------------------
|
||||
-- Self Request --
|
||||
------------------
|
||||
-- 1. Two groups of infantry are spawned in the Batumi spawn zone.
|
||||
-- 2. After ~10 seconds they are put back into the warehouse stock.
|
||||
-- 3. After some time they are spawned again.
|
||||
-- 4. And so on and so forth...
|
||||
|
||||
-- Create a WAREHOUSE object.
|
||||
local warehouseBatumi=WAREHOUSE:New(STATIC:FindByName("Warehouse Batumi"), "Batumi")
|
||||
|
||||
-- Start warehouse Batumi.
|
||||
warehouseBatumi:Start()
|
||||
|
||||
-- Add one infantry asset.
|
||||
warehouseBatumi:AddAsset(GROUP:FindByName("Infantry Platoon Alpha"), 4)
|
||||
|
||||
-- Add self request for one infantry at Batumi.
|
||||
warehouseBatumi:AddRequest(warehouseBatumi, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 2)
|
||||
|
||||
--- Self request event. Triggered once the assets are spawned in the spawn zone or at the airbase.
|
||||
function warehouseBatumi:OnAfterSelfRequest(From, Event, To, groupset, request)
|
||||
local groupset=groupset --Core.Set#SET_GROUP
|
||||
|
||||
-- Loop over all groups spawned from that request.
|
||||
for _,group in pairs(groupset:GetSet()) do
|
||||
local group=group --Wrapper.Group#GROUP
|
||||
|
||||
-- Gree smoke on spawned group.
|
||||
--group:SmokeGreen()
|
||||
|
||||
-- Put asset back to stock after 10 seconds.
|
||||
warehouseBatumi:__AddAsset(10, group)
|
||||
end
|
||||
|
||||
-- Add new self request after 20 seconds.
|
||||
warehouseBatumi:__AddRequest(20, warehouseBatumi, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 2)
|
||||
|
||||
end
|
||||
|
||||
Binary file not shown.
@@ -42,7 +42,6 @@ local function Explosion(object, power)
|
||||
end
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
-- Start warehouses.
|
||||
warehouse.Batumi:Start()
|
||||
@@ -78,7 +77,7 @@ function warehouse.Berlin:OnAfterSelfRequest(From,Event,To,groupset,request)
|
||||
|
||||
-- Route group to Battle zone.
|
||||
local ToCoord=BattleZone:GetRandomCoordinate()
|
||||
group:RouteGroundOnRoad(ToCoord, group:GetSpeedMax()*0.8)
|
||||
group:RouteGroundOnRoad(ToCoord, group:GetSpeedMax()*80)
|
||||
|
||||
-- After 3-5 minutes we create an explosion to destroy the group.
|
||||
SCHEDULER:New(nil, Explosion, {group, 50}, math.random(180, 300))
|
||||
@@ -97,7 +96,7 @@ function warehouse.Berlin:OnAfterAssetDead(From, Event, To, asset, request)
|
||||
local assignment=warehouse.Berlin:GetAssignment(request)
|
||||
|
||||
-- Request resupply for dead asset from Batumi.
|
||||
warehouse.Batumi:AddRequest(warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, asset.attribute, 1, nil, nil, nil, "Resupply")
|
||||
warehouse.Batumi:AddRequest(warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, asset.attribute, nil, nil, nil, nil, "Resupply")
|
||||
|
||||
-- Send asset to Battle zone either now or when they arrive.
|
||||
warehouse.Berlin:AddRequest(warehouse.Berlin, WAREHOUSE.Descriptor.ATTRIBUTE, asset.attribute, 1, nil, nil, nil, assignment)
|
||||
|
||||
Binary file not shown.
@@ -1,30 +1,30 @@
|
||||
----------------------------------
|
||||
-- Self Propelled Ground Troops --
|
||||
----------------------------------
|
||||
-- 1. Ground troops - APCs and infantry - are transferred from Batumi to FARP Berlin.
|
||||
-- 2. Warehouse Berlin is empty initially. But a request from Batumi is made for APCs. This cannot be processed and is held in the queue.
|
||||
-- 3. Once the assets arrive at Berlin, the request can be processed and some APCs are send back to Batumi.
|
||||
|
||||
-- Create WAREHOUSE objects.
|
||||
local warehouseBatumi=WAREHOUSE:New(STATIC:FindByName("Warehouse Batumi"), "Batumi")
|
||||
local warehouseBerlin=WAREHOUSE:New(STATIC:FindByName("Warehouse Berlin"), "Berlin")
|
||||
|
||||
-- Set spawn zone for warehouse Batumi.
|
||||
warehouseBatumi:SetSpawnZone(ZONE:New("Warehouse Batumi Spawn Zone"))
|
||||
|
||||
-- Start Warehouse at Batumi.
|
||||
warehouseBatumi:Start()
|
||||
|
||||
-- Add 20 infantry groups and 10 APCs as assets to Batumi warehouse stock.
|
||||
warehouseBatumi:AddAsset("Infantry Platoon Alpha", 20)
|
||||
warehouseBatumi:AddAsset("TPz Fuchs", 10)
|
||||
|
||||
-- Start Warehouse Berlin.
|
||||
warehouseBerlin:Start()
|
||||
|
||||
-- Warehouse Berlin requests ten infantry groups and five APCs from warehouse Batumi
|
||||
warehouseBatumi:AddRequest(warehouseBerlin, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 10)
|
||||
warehouseBatumi:AddRequest(warehouseBerlin, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_APC, 5)
|
||||
|
||||
-- Request from Batumi for two APCs. Initially these are not in stock. When they become available, the request is executed.
|
||||
warehouseBerlin:AddRequest(warehouseBatumi, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_APC, 2)
|
||||
----------------------------------
|
||||
-- Self Propelled Ground Troops --
|
||||
----------------------------------
|
||||
-- 1. Ground troops - APCs and infantry - are transferred from Batumi to FARP Berlin.
|
||||
-- 2. Warehouse Berlin is empty initially. But a request from Batumi is made for APCs. This cannot be processed and is held in the queue.
|
||||
-- 3. Once the assets arrive at Berlin, the request can be processed and some APCs are send back to Batumi.
|
||||
|
||||
-- Create WAREHOUSE objects.
|
||||
local warehouseBatumi=WAREHOUSE:New(STATIC:FindByName("Warehouse Batumi"), "Batumi")
|
||||
local warehouseBerlin=WAREHOUSE:New(STATIC:FindByName("Warehouse Berlin"), "Berlin")
|
||||
|
||||
-- Set spawn zone for warehouse Batumi.
|
||||
warehouseBatumi:SetSpawnZone(ZONE:New("Warehouse Batumi Spawn Zone"))
|
||||
|
||||
-- Start Warehouse at Batumi.
|
||||
warehouseBatumi:Start()
|
||||
|
||||
-- Add 20 infantry groups and 10 APCs as assets to Batumi warehouse stock.
|
||||
warehouseBatumi:AddAsset("Infantry Platoon Alpha", 20)
|
||||
warehouseBatumi:AddAsset("TPz Fuchs", 10)
|
||||
|
||||
-- Start Warehouse Berlin.
|
||||
warehouseBerlin:Start()
|
||||
|
||||
-- Warehouse Berlin requests ten infantry groups and five APCs from warehouse Batumi
|
||||
warehouseBatumi:AddRequest(warehouseBerlin, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_INFANTRY, 10)
|
||||
warehouseBatumi:AddRequest(warehouseBerlin, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_APC, 5)
|
||||
|
||||
-- Request from Batumi for two APCs. Initially these are not in stock. When they become available, the request is executed.
|
||||
warehouseBerlin:AddRequest(warehouseBatumi, WAREHOUSE.Descriptor.ATTRIBUTE, WAREHOUSE.Attribute.GROUND_APC, 2)
|
||||
|
||||
Binary file not shown.
@@ -1,29 +1,29 @@
|
||||
------------------------------------
|
||||
-- Self Propelled Airborne Assets --
|
||||
------------------------------------
|
||||
-- 1. Kutaisi requests two Yak-52 with high (10) priority from Senaki.
|
||||
-- 2. Kobuleti requests half Yak-52 with low (70) priority and gets the remaining half of the rest.
|
||||
-- 3. FARP London requests 1/3 of all available Hueys from Senaki.
|
||||
|
||||
-- Create WAREHOUSE objects.
|
||||
local warehouseSenaki = WAREHOUSE:New(STATIC:FindByName("Warehouse Senaki"), "Senaki")
|
||||
local warehouseKutaisi = WAREHOUSE:New(STATIC:FindByName("Warehouse Kutaisi"), "Kutaisi")
|
||||
local warehouseKobuleti = WAREHOUSE:New(STATIC:FindByName("Warehouse Kobuleti"), "Kobuleti")
|
||||
local warehouseLondon = WAREHOUSE:New(STATIC:FindByName("Warehouse London"), "London")
|
||||
|
||||
-- Start warehouses
|
||||
warehouseSenaki:Start()
|
||||
warehouseKutaisi:Start()
|
||||
warehouseKobuleti:Start()
|
||||
warehouseLondon:Start()
|
||||
|
||||
-- Add assets to Senaki warehouse
|
||||
warehouseSenaki:AddAsset("Yak-52", 10)
|
||||
warehouseSenaki:AddAsset("Huey", 6)
|
||||
|
||||
-- Kusaisi requests 3 Yak-52 form Senaki while Kobuleti wants all the rest.
|
||||
warehouseSenaki:AddRequest(warehouseKutaisi, WAREHOUSE.Descriptor.GROUPNAME, "Yak-52", 1, nil, nil, 10)
|
||||
warehouseSenaki:AddRequest(warehouseKobuleti, WAREHOUSE.Descriptor.GROUPNAME, "Yak-52", WAREHOUSE.Quantity.HALF, nil, nil, 70)
|
||||
|
||||
-- FARP London wants 1/3 of the six available Hueys.
|
||||
warehouseSenaki:AddRequest(warehouseLondon, WAREHOUSE.Descriptor.GROUPNAME, "Huey", WAREHOUSE.Quantity.THIRD)
|
||||
------------------------------------
|
||||
-- Self Propelled Airborne Assets --
|
||||
------------------------------------
|
||||
-- 1. Kutaisi requests two Yak-52 with high (10) priority from Senaki.
|
||||
-- 2. Kobuleti requests half Yak-52 with low (70) priority and gets the remaining half of the rest.
|
||||
-- 3. FARP London requests 1/3 of all available Hueys from Senaki.
|
||||
|
||||
-- Create WAREHOUSE objects.
|
||||
local warehouseSenaki = WAREHOUSE:New(STATIC:FindByName("Warehouse Senaki"), "Senaki")
|
||||
local warehouseKutaisi = WAREHOUSE:New(STATIC:FindByName("Warehouse Kutaisi"), "Kutaisi")
|
||||
local warehouseKobuleti = WAREHOUSE:New(STATIC:FindByName("Warehouse Kobuleti"), "Kobuleti")
|
||||
local warehouseLondon = WAREHOUSE:New(STATIC:FindByName("Warehouse London"), "London")
|
||||
|
||||
-- Start warehouses
|
||||
warehouseSenaki:Start()
|
||||
warehouseKutaisi:Start()
|
||||
warehouseKobuleti:Start()
|
||||
warehouseLondon:Start()
|
||||
|
||||
-- Add assets to Senaki warehouse
|
||||
warehouseSenaki:AddAsset("Yak-52", 10)
|
||||
warehouseSenaki:AddAsset("Huey", 6)
|
||||
|
||||
-- Kusaisi requests 3 Yak-52 form Senaki while Kobuleti wants all the rest.
|
||||
warehouseSenaki:AddRequest(warehouseKutaisi, WAREHOUSE.Descriptor.GROUPNAME, "Yak-52", 1, nil, nil, 10)
|
||||
warehouseSenaki:AddRequest(warehouseKobuleti, WAREHOUSE.Descriptor.GROUPNAME, "Yak-52", WAREHOUSE.Quantity.HALF, nil, nil, 70)
|
||||
|
||||
-- FARP London wants 1/3 of the six available Hueys.
|
||||
warehouseSenaki:AddRequest(warehouseLondon, WAREHOUSE.Descriptor.GROUPNAME, "Huey", WAREHOUSE.Quantity.THIRD)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user