mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
#CTLD - added FSM event "CratesPacked"
#UTILS - more options for MASH building
This commit is contained in:
parent
7ae4cdc8f1
commit
2ee0597d48
@ -25,7 +25,7 @@
|
|||||||
-- @module Ops.CTLD
|
-- @module Ops.CTLD
|
||||||
-- @image OPS_CTLD.jpg
|
-- @image OPS_CTLD.jpg
|
||||||
|
|
||||||
-- Last Update May 2025
|
-- Last Update July 2025
|
||||||
|
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
@ -1414,7 +1414,7 @@ CTLD.FixedWingTypes = {
|
|||||||
|
|
||||||
--- CTLD class version.
|
--- CTLD class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
CTLD.version="1.3.35"
|
CTLD.version="1.3.36"
|
||||||
|
|
||||||
--- Instantiate a new CTLD.
|
--- Instantiate a new CTLD.
|
||||||
-- @param #CTLD self
|
-- @param #CTLD self
|
||||||
@ -1481,6 +1481,7 @@ function CTLD:New(Coalition, Prefixes, Alias)
|
|||||||
self:AddTransition("*", "CratesRepaired", "*") -- CTLD repair event.
|
self:AddTransition("*", "CratesRepaired", "*") -- CTLD repair event.
|
||||||
self:AddTransition("*", "CratesBuildStarted", "*") -- CTLD build event.
|
self:AddTransition("*", "CratesBuildStarted", "*") -- CTLD build event.
|
||||||
self:AddTransition("*", "CratesRepairStarted", "*") -- CTLD repair event.
|
self:AddTransition("*", "CratesRepairStarted", "*") -- CTLD repair event.
|
||||||
|
self:AddTransition("*", "CratesPacked", "*") -- CTLD repack event.
|
||||||
self:AddTransition("*", "HelicopterLost", "*") -- CTLD lost event.
|
self:AddTransition("*", "HelicopterLost", "*") -- CTLD lost event.
|
||||||
self:AddTransition("*", "Load", "*") -- CTLD load event.
|
self:AddTransition("*", "Load", "*") -- CTLD load event.
|
||||||
self:AddTransition("*", "Loaded", "*") -- CTLD load event.
|
self:AddTransition("*", "Loaded", "*") -- CTLD load event.
|
||||||
@ -1760,6 +1761,17 @@ function CTLD:New(Coalition, Prefixes, Alias)
|
|||||||
-- @param Wrapper.Group#GROUP Vehicle The #GROUP object of the vehicle or FOB repaired.
|
-- @param Wrapper.Group#GROUP Vehicle The #GROUP object of the vehicle or FOB repaired.
|
||||||
-- @return #CTLD self
|
-- @return #CTLD self
|
||||||
|
|
||||||
|
--- FSM Function OnBeforeCratesPacked.
|
||||||
|
-- @function [parent=#CTLD] OnBeforeCratesPacked
|
||||||
|
-- @param #CTLD self
|
||||||
|
-- @param #string From State.
|
||||||
|
-- @param #string Event Trigger.
|
||||||
|
-- @param #string To State.
|
||||||
|
-- @param Wrapper.Group#GROUP Group Group Object.
|
||||||
|
-- @param Wrapper.Unit#UNIT Unit Unit Object.
|
||||||
|
-- @param #CTLD_CARGO Cargo Cargo crate that was repacked.
|
||||||
|
-- @return #CTLD self
|
||||||
|
|
||||||
--- FSM Function OnBeforeTroopsRTB.
|
--- FSM Function OnBeforeTroopsRTB.
|
||||||
-- @function [parent=#CTLD] OnBeforeTroopsRTB
|
-- @function [parent=#CTLD] OnBeforeTroopsRTB
|
||||||
-- @param #CTLD self
|
-- @param #CTLD self
|
||||||
@ -1890,6 +1902,17 @@ function CTLD:New(Coalition, Prefixes, Alias)
|
|||||||
-- @param Wrapper.Group#GROUP Vehicle The #GROUP object of the vehicle or FOB repaired.
|
-- @param Wrapper.Group#GROUP Vehicle The #GROUP object of the vehicle or FOB repaired.
|
||||||
-- @return #CTLD self
|
-- @return #CTLD self
|
||||||
|
|
||||||
|
--- FSM Function OnAfterCratesPacked.
|
||||||
|
-- @function [parent=#CTLD] OnAfterCratesPacked
|
||||||
|
-- @param #CTLD self
|
||||||
|
-- @param #string From State.
|
||||||
|
-- @param #string Event Trigger.
|
||||||
|
-- @param #string To State.
|
||||||
|
-- @param Wrapper.Group#GROUP Group Group Object.
|
||||||
|
-- @param Wrapper.Unit#UNIT Unit Unit Object.
|
||||||
|
-- @param #CTLD_CARGO Cargo Cargo crate that was repacked.
|
||||||
|
-- @return #CTLD self
|
||||||
|
|
||||||
--- FSM Function OnAfterTroopsRTB.
|
--- FSM Function OnAfterTroopsRTB.
|
||||||
-- @function [parent=#CTLD] OnAfterTroopsRTB
|
-- @function [parent=#CTLD] OnAfterTroopsRTB
|
||||||
-- @param #CTLD self
|
-- @param #CTLD self
|
||||||
@ -4012,6 +4035,7 @@ function CTLD:_PackCratesNearby(Group, Unit)
|
|||||||
_Group:Destroy() -- if a match is found destroy the Wrapper.Group#GROUP near the player
|
_Group:Destroy() -- if a match is found destroy the Wrapper.Group#GROUP near the player
|
||||||
self:_GetCrates(Group, Unit, _entry, nil, false, true) -- spawn the appropriate crates near the player
|
self:_GetCrates(Group, Unit, _entry, nil, false, true) -- spawn the appropriate crates near the player
|
||||||
self:_RefreshLoadCratesMenu(Group,Unit) -- call the refresher to show the crates in the menu
|
self:_RefreshLoadCratesMenu(Group,Unit) -- call the refresher to show the crates in the menu
|
||||||
|
self:__CratesPacked(1,Group,Unit,_entry)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -4265,6 +4265,10 @@ end
|
|||||||
-- @param #number Country Country ID the MASH belongs to, e.g. country.id.USA or country.id.RUSSIA.
|
-- @param #number Country Country ID the MASH belongs to, e.g. country.id.USA or country.id.RUSSIA.
|
||||||
-- @param #number ADF (Optional) ADF Frequency in kHz (Kilohertz), if given activate an ADF Beacon at the location of the MASH.
|
-- @param #number ADF (Optional) ADF Frequency in kHz (Kilohertz), if given activate an ADF Beacon at the location of the MASH.
|
||||||
-- @param #string Livery (Optional) The livery of the static CH-47, defaults to dark green.
|
-- @param #string Livery (Optional) The livery of the static CH-47, defaults to dark green.
|
||||||
|
-- @param #boolean DeployHelo (Optional) If true, deploy the helicopter static.
|
||||||
|
-- @param #number MASHRadio MASH Radio Frequency, defaults to 127.5.
|
||||||
|
-- @param #number MASHRadioModulation MASH Radio Modulation, defaults to radio.modulation.AM.
|
||||||
|
-- @param #number MASHCallsign Defaults to CALLSIGN.FARP.Berlin.
|
||||||
-- @param #table Templates (Optional) You can hand in your own template table of numbered(!) entries. Each entry consist of a relative(!) x,y position and data of a
|
-- @param #table Templates (Optional) You can hand in your own template table of numbered(!) entries. Each entry consist of a relative(!) x,y position and data of a
|
||||||
-- static, shape_name is optional. Also, livery_id is optional, but is applied to the helicopter static only.
|
-- static, shape_name is optional. Also, livery_id is optional, but is applied to the helicopter static only.
|
||||||
-- @return #table Table of Wrapper.Static#STATIC objects that were spawned.
|
-- @return #table Table of Wrapper.Static#STATIC objects that were spawned.
|
||||||
@ -4292,7 +4296,7 @@ end
|
|||||||
-- [18]={category='Fortifications',type='Tent04',shape_name='M92_Tent04',heading=0,x=21.220671,y=30.247529,},
|
-- [18]={category='Fortifications',type='Tent04',shape_name='M92_Tent04',heading=0,x=21.220671,y=30.247529,},
|
||||||
-- }
|
-- }
|
||||||
--
|
--
|
||||||
function UTILS.SpawnMASHStatics(Name,Coordinate,Country,ADF,Livery,Templates)
|
function UTILS.SpawnMASHStatics(Name,Coordinate,Country,ADF,Livery,DeployHelo,MASHRadio,MASHRadioModulation,MASHCallsign,Templates)
|
||||||
|
|
||||||
-- Basic objects table
|
-- Basic objects table
|
||||||
|
|
||||||
@ -4326,6 +4330,9 @@ function UTILS.SpawnMASHStatics(Name,Coordinate,Country,ADF,Livery,Templates)
|
|||||||
local ReturnStatics = {}
|
local ReturnStatics = {}
|
||||||
local CountryID = Country or country.id.USA
|
local CountryID = Country or country.id.USA
|
||||||
local livery = "us army dark green"
|
local livery = "us army dark green"
|
||||||
|
local MASHRadio = MASHRadio or 127.5
|
||||||
|
local MASHRadioModulation = MASHRadioModulation or radio.modulation.AM
|
||||||
|
local MASHCallsign = MASHCallsign or CALLSIGN.FARP.Berlin
|
||||||
|
|
||||||
-- check for coordinate or zone
|
-- check for coordinate or zone
|
||||||
if type(Coordinate) == "table" then
|
if type(Coordinate) == "table" then
|
||||||
@ -4351,14 +4358,22 @@ function UTILS.SpawnMASHStatics(Name,Coordinate,Country,ADF,Livery,Templates)
|
|||||||
if object.shape_name and object.shape_name ~= "none" then
|
if object.shape_name and object.shape_name ~= "none" then
|
||||||
static:InitShape(object.shape_name)
|
static:InitShape(object.shape_name)
|
||||||
end
|
end
|
||||||
if object.category == "Helicopters" then
|
if object.category == "Helicopters" and DeployHelo == true then
|
||||||
if object.livery_id ~= nil then
|
if object.livery_id ~= nil then
|
||||||
livery = object.livery_id
|
livery = object.livery_id
|
||||||
end
|
end
|
||||||
static:InitLivery(livery)
|
static:InitLivery(livery)
|
||||||
|
local newstatic = static:SpawnFromCoordinate(Coordinate,object.heading,NewName)
|
||||||
|
table.insert(ReturnStatics,newstatic)
|
||||||
|
elseif object.category == "Heliports" then
|
||||||
|
static:InitFARP(MASHCallsign,MASHRadio,MASHRadioModulation,false,false)
|
||||||
|
local newstatic = static:SpawnFromCoordinate(Coordinate,object.heading,NewName)
|
||||||
|
table.insert(ReturnStatics,newstatic)
|
||||||
|
elseif object.category ~= "Helicopters" and object.category ~= "Heliports" then
|
||||||
|
local newstatic = static:SpawnFromCoordinate(Coordinate,object.heading,NewName)
|
||||||
|
table.insert(ReturnStatics,newstatic)
|
||||||
end
|
end
|
||||||
static:SpawnFromCoordinate(Coordinate,object.heading,NewName)
|
|
||||||
table.insert(ReturnStatics,static)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Beacon
|
-- Beacon
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user