mirror of
https://github.com/FlightControl-Master/MOOSE_MISSIONS.git
synced 2026-08-25 23:15:08 +00:00
Updated Moose.lua
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
---
|
||||
-- Name: AIC-APC-000 - APC
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 26 Mar 2018
|
||||
-- Date Checked: 01 Jan 2021
|
||||
-- Working example
|
||||
--
|
||||
-- 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 )
|
||||
|
||||
---
|
||||
-- Name: AIC-APC-000 - APC
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 26 Mar 2018
|
||||
-- Date Checked: 01 Jan 2021
|
||||
-- Working example
|
||||
--
|
||||
-- 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 )
|
||||
|
||||
|
||||
+18
-18
@@ -1,18 +1,18 @@
|
||||
---
|
||||
-- Name: AIC-APC-001 - APC with Cargo declared in ME
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 26 Mar 2018
|
||||
-- Date Checked: 01 Dec 2021
|
||||
-- Changed Cargo auto tag from ~ to #, working example
|
||||
--
|
||||
-- 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:
|
||||
-- e.g. Infantry1#CARGO(T=Infantry,RR=2000,NR=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 )
|
||||
|
||||
---
|
||||
-- Name: AIC-APC-001 - APC with Cargo declared in ME
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 26 Mar 2018
|
||||
-- Date Checked: 01 Dec 2021
|
||||
-- Changed Cargo auto tag from ~ to #, working example
|
||||
--
|
||||
-- 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:
|
||||
-- e.g. Infantry1#CARGO(T=Infantry,RR=2000,NR=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 )
|
||||
|
||||
|
||||
+12
-12
@@ -1,12 +1,12 @@
|
||||
---
|
||||
-- Name: AIC-APC-002 - APC Move by Game Master
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 26 Mar 2018
|
||||
-- Date Checked: 01 Jan 2021. Changed ~ to # in ME Group Names. Not sure how this is supposed to work for the Game Master
|
||||
|
||||
local InfantryCargoSet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart()
|
||||
|
||||
local CargoCarrier = GROUP:FindByName( "Carrier" )
|
||||
|
||||
CargoTroops = AI_CARGO_APC:New( CargoCarrier, InfantryCargoSet, 500 )
|
||||
|
||||
---
|
||||
-- Name: AIC-APC-002 - APC Move by Game Master
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 26 Mar 2018
|
||||
-- Date Checked: 01 Jan 2021. Changed ~ to # in ME Group Names. Not sure how this is supposed to work for the Game Master
|
||||
|
||||
local InfantryCargoSet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart()
|
||||
|
||||
local CargoCarrier = GROUP:FindByName( "Carrier" )
|
||||
|
||||
CargoTroops = AI_CARGO_APC:New( CargoCarrier, InfantryCargoSet, 500 )
|
||||
|
||||
|
||||
+14
-14
@@ -1,14 +1,14 @@
|
||||
---
|
||||
-- Name: AIC-APC-003 - APC Troops and Equipment
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 07 Apr 2018
|
||||
-- Date Checked: 01 Jan 2021
|
||||
|
||||
local InfantryCargoSet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart()
|
||||
|
||||
local CargoCarrier = GROUP:FindByName( "Carrier" )
|
||||
|
||||
CargoTroops = AI_CARGO_APC:New( CargoCarrier, InfantryCargoSet, 350 )
|
||||
|
||||
|
||||
|
||||
---
|
||||
-- Name: AIC-APC-003 - APC Troops and Equipment
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 07 Apr 2018
|
||||
-- Date Checked: 01 Jan 2021
|
||||
|
||||
local InfantryCargoSet = SET_CARGO:New():FilterTypes( "Infantry" ):FilterStart()
|
||||
|
||||
local CargoCarrier = GROUP:FindByName( "Carrier" )
|
||||
|
||||
CargoTroops = AI_CARGO_APC:New( CargoCarrier, InfantryCargoSet, 350 )
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
---
|
||||
-- Name: AIC-APC-004 - APC Pickup
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 23 Apr 2018
|
||||
-- Date Checked: 01 Jan 2021, working example, changed Deploy to async call
|
||||
|
||||
BASE:TraceClass("AI_CARGO_APC")
|
||||
BASE:TraceOn()
|
||||
|
||||
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( 1, ZONE:New( "Deploy" ):GetCoordinate() )
|
||||
end
|
||||
|
||||
|
||||
|
||||
---
|
||||
-- Name: AIC-APC-004 - APC Pickup
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 23 Apr 2018
|
||||
-- Date Checked: 01 Jan 2021, working example, changed Deploy to async call
|
||||
|
||||
BASE:TraceClass("AI_CARGO_APC")
|
||||
BASE:TraceOn()
|
||||
|
||||
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( 1, ZONE:New( "Deploy" ):GetCoordinate() )
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
+29
-29
@@ -1,29 +1,29 @@
|
||||
---
|
||||
-- Name: AIC-APC-001 - Troops Relocate APC
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 07 Apr 2018
|
||||
-- Date Checked: 01 Jan 2021
|
||||
--
|
||||
-- Demonstration of troops relocation when carrier is destroyed...
|
||||
-- Carrier will relocate to the rescue carrier.
|
||||
--
|
||||
|
||||
BASE:TraceClass("AI_CARGO_APC")
|
||||
|
||||
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 )
|
||||
self:__Pickup(1,ZONE:New("Pickup Zone"):GetCoordinate(),30)
|
||||
end
|
||||
end
|
||||
|
||||
---
|
||||
-- Name: AIC-APC-001 - Troops Relocate APC
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 07 Apr 2018
|
||||
-- Date Checked: 01 Jan 2021
|
||||
--
|
||||
-- Demonstration of troops relocation when carrier is destroyed...
|
||||
-- Carrier will relocate to the rescue carrier.
|
||||
--
|
||||
|
||||
BASE:TraceClass("AI_CARGO_APC")
|
||||
|
||||
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 )
|
||||
self:__Pickup(1,ZONE:New("Pickup Zone"):GetCoordinate(),30)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1,13 +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 )
|
||||
|
||||
|
||||
|
||||
---
|
||||
-- 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 )
|
||||
|
||||
|
||||
|
||||
|
||||
+42
-42
@@ -1,42 +1,42 @@
|
||||
---
|
||||
-- Name: AIC-APC-004 - APC Pickup
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 23 Apr 2018
|
||||
-- Date Checked: 01 Jan 2021
|
||||
|
||||
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( 5, ZONE:New( "Deploy" ):GetRandomCoordinate( 300, 500 ) )
|
||||
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 ) )
|
||||
end
|
||||
|
||||
Cargo_APC[i]:__Pickup( i * 30, ZONE:New( "Pickup" ):GetRandomCoordinate( 50, 70 ) )
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
---
|
||||
-- Name: AIC-APC-004 - APC Pickup
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 23 Apr 2018
|
||||
-- Date Checked: 01 Jan 2021
|
||||
|
||||
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( 5, ZONE:New( "Deploy" ):GetRandomCoordinate( 300, 500 ) )
|
||||
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 ) )
|
||||
end
|
||||
|
||||
Cargo_APC[i]:__Pickup( i * 30, ZONE:New( "Pickup" ):GetRandomCoordinate( 50, 70 ) )
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user