mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
@@ -52,6 +52,8 @@
|
|||||||
-- @field #string InitStaticName Name of the static.
|
-- @field #string InitStaticName Name of the static.
|
||||||
-- @field Core.Point#COORDINATE InitStaticCoordinate Coordinate where to spawn the static.
|
-- @field Core.Point#COORDINATE InitStaticCoordinate Coordinate where to spawn the static.
|
||||||
-- @field #boolean InitDead Set static to be dead if true.
|
-- @field #boolean InitDead Set static to be dead if true.
|
||||||
|
-- @field #boolean InitCargo If true, static can act as cargo.
|
||||||
|
-- @field #number InitCargoMass Mass of cargo in kg.
|
||||||
-- @extends Core.Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
|
|
||||||
|
|
||||||
@@ -126,6 +128,8 @@ SPAWNSTATIC = {
|
|||||||
-- @field #number unitId Unit ID.
|
-- @field #number unitId Unit ID.
|
||||||
-- @field #number groupId Group ID.
|
-- @field #number groupId Group ID.
|
||||||
-- @field #table offsets Offset parameters when linked to a unit.
|
-- @field #table offsets Offset parameters when linked to a unit.
|
||||||
|
-- @field #number mass Cargo mass in kg.
|
||||||
|
-- @field #boolean canCargo Static can be a cargo.
|
||||||
|
|
||||||
--- Creates the main object to spawn a @{Static} defined in the mission editor (ME).
|
--- Creates the main object to spawn a @{Static} defined in the mission editor (ME).
|
||||||
-- @param #SPAWNSTATIC self
|
-- @param #SPAWNSTATIC self
|
||||||
@@ -237,6 +241,24 @@ function SPAWNSTATIC:InitShape(StaticShape)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Initialize cargo mass.
|
||||||
|
-- @param #SPAWNSTATIC self
|
||||||
|
-- @param #number Mass Mass of the cargo in kg.
|
||||||
|
-- @return #SPAWNSTATIC self
|
||||||
|
function SPAWNSTATIC:InitCargoMass(Mass)
|
||||||
|
self.InitCargoMass=Mass
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Initialize as cargo.
|
||||||
|
-- @param #SPAWNSTATIC self
|
||||||
|
-- @param #boolean IsCargo If true, this static can act as cargo.
|
||||||
|
-- @return #SPAWNSTATIC self
|
||||||
|
function SPAWNSTATIC:InitCargo(IsCargo)
|
||||||
|
self.InitCargo=IsCargo
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- Initialize country of the spawned static. This determines the category.
|
--- Initialize country of the spawned static. This determines the category.
|
||||||
-- @param #SPAWNSTATIC self
|
-- @param #SPAWNSTATIC self
|
||||||
-- @param #string CountryID The country ID, e.g. country.id.USA.
|
-- @param #string CountryID The country ID, e.g. country.id.USA.
|
||||||
@@ -385,6 +407,10 @@ function SPAWNSTATIC:_SpawnStatic(Template, CountryID)
|
|||||||
Template.dead=self.InitDead
|
Template.dead=self.InitDead
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if self.InitCargo~=nil then
|
||||||
|
Template.isCargo=self.InitCargo
|
||||||
|
end
|
||||||
|
|
||||||
if self.InitLinkUnit then
|
if self.InitLinkUnit then
|
||||||
Template.linkUnit=self.InitLinkUnit:GetID()
|
Template.linkUnit=self.InitLinkUnit:GetID()
|
||||||
Template.linkOffset=true
|
Template.linkOffset=true
|
||||||
@@ -402,6 +428,7 @@ function SPAWNSTATIC:_SpawnStatic(Template, CountryID)
|
|||||||
|
|
||||||
-- Register the new static.
|
-- Register the new static.
|
||||||
--_DATABASE:_RegisterStaticTemplate(Template, self.CoalitionID, self.CategoryID, CountryID)
|
--_DATABASE:_RegisterStaticTemplate(Template, self.CoalitionID, self.CategoryID, CountryID)
|
||||||
|
_DATABASE:AddStatic(Template.name)
|
||||||
|
|
||||||
-- Debug output.
|
-- Debug output.
|
||||||
self:T(Template)
|
self:T(Template)
|
||||||
@@ -409,5 +436,6 @@ function SPAWNSTATIC:_SpawnStatic(Template, CountryID)
|
|||||||
-- Add static to the game.
|
-- Add static to the game.
|
||||||
local Static=coalition.addStaticObject(CountryID, Template)
|
local Static=coalition.addStaticObject(CountryID, Template)
|
||||||
|
|
||||||
|
|
||||||
return _DATABASE:FindStatic(Static:getName())
|
return _DATABASE:FindStatic(Static:getName())
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user