mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-20 16:41:44 +00:00
Progress
This commit is contained in:
@@ -164,7 +164,7 @@ do -- CARGO
|
|||||||
-- @field #number Weight A number defining the weight of the cargo. The weight is expressed in kg.
|
-- @field #number Weight A number defining the weight of the cargo. The weight is expressed in kg.
|
||||||
-- @field #number NearRadius (optional) A number defining the radius in meters when the cargo is near to a Carrier, so that it can be loaded.
|
-- @field #number NearRadius (optional) A number defining the radius in meters when the cargo is near to a Carrier, so that it can be loaded.
|
||||||
-- @field Wrapper.Controllable#CONTROLLABLE CargoObject The alive DCS object representing the cargo. This value can be nil, meaning, that the cargo is not represented anywhere...
|
-- @field Wrapper.Controllable#CONTROLLABLE CargoObject The alive DCS object representing the cargo. This value can be nil, meaning, that the cargo is not represented anywhere...
|
||||||
-- @field Wrapper.Controllable#CONTROLLABLE CargoCarrier The alive DCS object carrying the cargo. This value can be nil, meaning, that the cargo is not contained anywhere...
|
-- @field Wrapper.Client#CLIENT CargoCarrier The alive DCS object carrying the cargo. This value can be nil, meaning, that the cargo is not contained anywhere...
|
||||||
-- @field #boolean Slingloadable This flag defines if the cargo can be slingloaded.
|
-- @field #boolean Slingloadable This flag defines if the cargo can be slingloaded.
|
||||||
-- @field #boolean Moveable This flag defines if the cargo is moveable.
|
-- @field #boolean Moveable This flag defines if the cargo is moveable.
|
||||||
-- @field #boolean Representable This flag defines if the cargo can be represented by a DCS Unit.
|
-- @field #boolean Representable This flag defines if the cargo can be represented by a DCS Unit.
|
||||||
@@ -1032,6 +1032,7 @@ function CARGO_GROUP:OnEventCargoDead( EventData )
|
|||||||
else
|
else
|
||||||
if self.CargoCarrier:GetName() == EventData.IniUnitName then
|
if self.CargoCarrier:GetName() == EventData.IniUnitName then
|
||||||
Destroyed = true
|
Destroyed = true
|
||||||
|
self.CargoCarrier:ClearCargo()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -309,7 +309,7 @@ function TASK:AbortGroup( PlayerGroup )
|
|||||||
self:E( { IsGroupAssigned = IsGroupAssigned } )
|
self:E( { IsGroupAssigned = IsGroupAssigned } )
|
||||||
if IsGroupAssigned then
|
if IsGroupAssigned then
|
||||||
local PlayerName = PlayerGroup:GetUnit(1):GetPlayerName()
|
local PlayerName = PlayerGroup:GetUnit(1):GetPlayerName()
|
||||||
self:MessageToGroups( PlayerName .. " aborted Task " .. self:GetName() )
|
--self:MessageToGroups( PlayerName .. " aborted Task " .. self:GetName() )
|
||||||
self:UnAssignFromGroup( PlayerGroup )
|
self:UnAssignFromGroup( PlayerGroup )
|
||||||
--self:Abort()
|
--self:Abort()
|
||||||
|
|
||||||
@@ -469,7 +469,7 @@ do -- Group Assignment
|
|||||||
local TaskGroupName = TaskGroup:GetName()
|
local TaskGroupName = TaskGroup:GetName()
|
||||||
|
|
||||||
self.AssignedGroups[TaskGroupName] = nil
|
self.AssignedGroups[TaskGroupName] = nil
|
||||||
self:E( string.format( "Task %s is unassigned to %s", TaskName, TaskGroupName ) )
|
--self:E( string.format( "Task %s is unassigned to %s", TaskName, TaskGroupName ) )
|
||||||
|
|
||||||
-- Set the group to be assigned at mission level. This allows to decide the menu options on mission level for this group.
|
-- Set the group to be assigned at mission level. This allows to decide the menu options on mission level for this group.
|
||||||
self:GetMission():ClearGroupAssignment( TaskGroup )
|
self:GetMission():ClearGroupAssignment( TaskGroup )
|
||||||
|
|||||||
@@ -316,8 +316,7 @@ do -- TASK_CARGO
|
|||||||
--#Wrapper.Unit#UNIT
|
--#Wrapper.Unit#UNIT
|
||||||
|
|
||||||
|
|
||||||
--- Route to Cargo
|
--- @param #FSM_PROCESS self
|
||||||
-- @param #FSM_PROCESS self
|
|
||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
||||||
-- @param From
|
-- @param From
|
||||||
@@ -337,8 +336,7 @@ do -- TASK_CARGO
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
---
|
--- @param #FSM_PROCESS self
|
||||||
-- @param #FSM_PROCESS self
|
|
||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
||||||
function Fsm:onafterArriveAtPickup( TaskUnit, Task )
|
function Fsm:onafterArriveAtPickup( TaskUnit, Task )
|
||||||
@@ -346,6 +344,7 @@ do -- TASK_CARGO
|
|||||||
if self.Cargo:IsAlive() then
|
if self.Cargo:IsAlive() then
|
||||||
TaskUnit:Smoke( Task:GetSmokeColor(), 15 )
|
TaskUnit:Smoke( Task:GetSmokeColor(), 15 )
|
||||||
if TaskUnit:IsAir() then
|
if TaskUnit:IsAir() then
|
||||||
|
Task:GetMission():GetCommandCenter():MessageToGroup( "Land", TaskUnit:GetGroup() )
|
||||||
self:__Land( -0.1, "Pickup" )
|
self:__Land( -0.1, "Pickup" )
|
||||||
else
|
else
|
||||||
self:__SelectAction( -0.1 )
|
self:__SelectAction( -0.1 )
|
||||||
@@ -354,8 +353,7 @@ do -- TASK_CARGO
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
---
|
--- @param #FSM_PROCESS self
|
||||||
-- @param #FSM_PROCESS self
|
|
||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
||||||
function Fsm:onafterCancelRouteToPickup( TaskUnit, Task )
|
function Fsm:onafterCancelRouteToPickup( TaskUnit, Task )
|
||||||
@@ -365,8 +363,7 @@ do -- TASK_CARGO
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Route to DeployZone
|
--- @param #FSM_PROCESS self
|
||||||
-- @param #FSM_PROCESS self
|
|
||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
function Fsm:onafterRouteToDeploy( TaskUnit, Task, From, Event, To, DeployZone )
|
function Fsm:onafterRouteToDeploy( TaskUnit, Task, From, Event, To, DeployZone )
|
||||||
self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
||||||
@@ -378,14 +375,14 @@ do -- TASK_CARGO
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
---
|
--- @param #FSM_PROCESS self
|
||||||
-- @param #FSM_PROCESS self
|
|
||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
||||||
function Fsm:onafterArriveAtDeploy( TaskUnit, Task )
|
function Fsm:onafterArriveAtDeploy( TaskUnit, Task )
|
||||||
self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
self:E( { TaskUnit = TaskUnit, Task = Task and Task:GetClassNameAndID() } )
|
||||||
|
|
||||||
if TaskUnit:IsAir() then
|
if TaskUnit:IsAir() then
|
||||||
|
Task:GetMission():GetCommandCenter():MessageToGroup( "Land", TaskUnit:GetGroup() )
|
||||||
self:__Land( -0.1, "Deploy" )
|
self:__Land( -0.1, "Deploy" )
|
||||||
else
|
else
|
||||||
self:__SelectAction( -0.1 )
|
self:__SelectAction( -0.1 )
|
||||||
@@ -393,8 +390,7 @@ do -- TASK_CARGO
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
---
|
--- @param #FSM_PROCESS self
|
||||||
-- @param #FSM_PROCESS self
|
|
||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
||||||
function Fsm:onafterCancelRouteToDeploy( TaskUnit, Task )
|
function Fsm:onafterCancelRouteToDeploy( TaskUnit, Task )
|
||||||
@@ -405,7 +401,7 @@ do -- TASK_CARGO
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- @param #FSM_PROCESS self
|
--- @param #FSM_PROCESS self
|
||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
||||||
function Fsm:onafterLand( TaskUnit, Task, From, Event, To, Action )
|
function Fsm:onafterLand( TaskUnit, Task, From, Event, To, Action )
|
||||||
@@ -414,7 +410,6 @@ do -- TASK_CARGO
|
|||||||
if self.Cargo:IsAlive() then
|
if self.Cargo:IsAlive() then
|
||||||
if self.Cargo:IsInRadius( TaskUnit:GetPointVec2() ) then
|
if self.Cargo:IsInRadius( TaskUnit:GetPointVec2() ) then
|
||||||
if TaskUnit:InAir() then
|
if TaskUnit:InAir() then
|
||||||
Task:GetMission():GetCommandCenter():MessageToGroup( "Land", TaskUnit:GetGroup() )
|
|
||||||
self:__Land( -10, Action )
|
self:__Land( -10, Action )
|
||||||
else
|
else
|
||||||
Task:GetMission():GetCommandCenter():MessageToGroup( "Landed ...", TaskUnit:GetGroup() )
|
Task:GetMission():GetCommandCenter():MessageToGroup( "Landed ...", TaskUnit:GetGroup() )
|
||||||
@@ -430,8 +425,7 @@ do -- TASK_CARGO
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
---
|
--- @param #FSM_PROCESS self
|
||||||
-- @param #FSM_PROCESS self
|
|
||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
||||||
function Fsm:onafterLanded( TaskUnit, Task, From, Event, To, Action )
|
function Fsm:onafterLanded( TaskUnit, Task, From, Event, To, Action )
|
||||||
@@ -454,8 +448,7 @@ do -- TASK_CARGO
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
---
|
--- @param #FSM_PROCESS self
|
||||||
-- @param #FSM_PROCESS self
|
|
||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
||||||
function Fsm:onafterPrepareBoarding( TaskUnit, Task, From, Event, To, Cargo )
|
function Fsm:onafterPrepareBoarding( TaskUnit, Task, From, Event, To, Cargo )
|
||||||
@@ -467,8 +460,7 @@ do -- TASK_CARGO
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
---
|
--- @param #FSM_PROCESS self
|
||||||
-- @param #FSM_PROCESS self
|
|
||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
||||||
function Fsm:onafterBoard( TaskUnit, Task )
|
function Fsm:onafterBoard( TaskUnit, Task )
|
||||||
@@ -494,8 +486,7 @@ do -- TASK_CARGO
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
---
|
--- @param #FSM_PROCESS self
|
||||||
-- @param #FSM_PROCESS self
|
|
||||||
-- @param Wrapper.Unit#UNIT TaskUnit
|
-- @param Wrapper.Unit#UNIT TaskUnit
|
||||||
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
-- @param Tasking.Task_Cargo#TASK_CARGO Task
|
||||||
function Fsm:onafterBoarded( TaskUnit, Task )
|
function Fsm:onafterBoarded( TaskUnit, Task )
|
||||||
|
|||||||
@@ -708,6 +708,12 @@ function POSITIONABLE:HasCargo( Cargo )
|
|||||||
return self.__.Cargo[Cargo]
|
return self.__.Cargo[Cargo]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Clear all cargo.
|
||||||
|
-- @param #POSITIONABLE self
|
||||||
|
function POSITIONABLE:ClearCargo()
|
||||||
|
self.__.Cargo = {}
|
||||||
|
end
|
||||||
|
|
||||||
--- Get cargo item count.
|
--- Get cargo item count.
|
||||||
-- @param #POSITIONABLE self
|
-- @param #POSITIONABLE self
|
||||||
-- @return Core.Cargo#CARGO Cargo
|
-- @return Core.Cargo#CARGO Cargo
|
||||||
|
|||||||
Reference in New Issue
Block a user