mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge pull request #8 from svenvandevelde/SPAWN_Create_Visible_Array
Spawn create visible array
This commit is contained in:
commit
e396353cc7
31
Loaders/Moose_Create_Embedded.bat
Normal file
31
Loaders/Moose_Create_Embedded.bat
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
rem Generate Moose_Embedded.lua
|
||||||
|
|
||||||
|
copy Trace.lua ^
|
||||||
|
+ Routines.lua ^
|
||||||
|
+ Base.lua ^
|
||||||
|
+ Menu.lua ^
|
||||||
|
+ Group.lua ^
|
||||||
|
+ Unit.lua ^
|
||||||
|
+ Zone.lua ^
|
||||||
|
+ Database.lua ^
|
||||||
|
+ Cargo.lua ^
|
||||||
|
+ Client.lua ^
|
||||||
|
+ Message.lua ^
|
||||||
|
+ Stage.lua ^
|
||||||
|
+ Task.lua ^
|
||||||
|
+ GoHomeTask.lua ^
|
||||||
|
+ DestroyBaseTask.lua ^
|
||||||
|
+ DestroyGroupsTask.lua ^
|
||||||
|
+ DestroyRadarsTask.lua ^
|
||||||
|
+ DestroyUnitTypesTask.lua ^
|
||||||
|
+ PickupTask.lua ^
|
||||||
|
+ DeployTask.lua ^
|
||||||
|
+ NoTask.lua ^
|
||||||
|
+ RouteTask.lua ^
|
||||||
|
+ Mission.lua ^
|
||||||
|
+ CleanUp.lua ^
|
||||||
|
+ Spawn.lua ^
|
||||||
|
+ Movement.lua ^
|
||||||
|
+ Sead.lua ^
|
||||||
|
Moose_Embedded.lua
|
||||||
|
|
||||||
@ -20,4 +20,4 @@ env.info( "Include.MissionPath = " .. Include.MissionPath)
|
|||||||
|
|
||||||
Include.Files = {}
|
Include.Files = {}
|
||||||
|
|
||||||
env.info("Loaded MOOSE Include Engine")
|
env.info("Loaded MOOSE Include Engine")
|
||||||
|
|||||||
@ -1,159 +0,0 @@
|
|||||||
|
|
||||||
local base = _G
|
|
||||||
|
|
||||||
local MOOSE_Version = "0.1.1.1"
|
|
||||||
|
|
||||||
env.info("Loading MOOSE " .. base.timer.getAbsTime() )
|
|
||||||
|
|
||||||
function script_path()
|
|
||||||
local str = debug.getinfo(2, "S").source
|
|
||||||
return str:match("(.*/)"):sub(1,-2):gsub("\\","/")
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
Include = {}
|
|
||||||
|
|
||||||
Include.ProgramPath = "Scripts/Moose/Moose/"
|
|
||||||
Include.MissionPath = script_path()
|
|
||||||
|
|
||||||
env.info( "Include.ProgramPath = " .. Include.ProgramPath)
|
|
||||||
env.info( "Include.MissionPath = " .. Include.MissionPath)
|
|
||||||
Include.Files = {}
|
|
||||||
|
|
||||||
Include.FileIn = function(fileName, table)
|
|
||||||
-- env.info( fileName )
|
|
||||||
local chunk, errMsg = base.loadfile(fileName)
|
|
||||||
if chunk ~= nil then
|
|
||||||
env.info( "chunk assigned " )
|
|
||||||
env.info( Include.oneLineSerialize( chunk ) )
|
|
||||||
base.setfenv(chunk, table)
|
|
||||||
chunk()
|
|
||||||
if table.MOOSE_Version then
|
|
||||||
env.info( table.MOOSE_Version )
|
|
||||||
end
|
|
||||||
return chunk
|
|
||||||
else
|
|
||||||
return nil, errMsg
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
Include.MisFiles = {}
|
|
||||||
|
|
||||||
Include.FileName = function( num )
|
|
||||||
local hexstr = '0123456789ABCDEF'
|
|
||||||
local s = ''
|
|
||||||
while num > 0 do
|
|
||||||
local mod = math.fmod(num, 16)
|
|
||||||
s = string.sub(hexstr, mod+1, mod+1) .. s
|
|
||||||
num = math.floor(num / 16)
|
|
||||||
end
|
|
||||||
if s == '' then s = '0' end
|
|
||||||
-- env.info( string.format( "~mis" .. "%8s", "00000000" .. s ) )
|
|
||||||
return string.format( "~mis" .. "%s", string.sub( "00000000" .. s, -8 ) )
|
|
||||||
end
|
|
||||||
|
|
||||||
Include.ScanFiles = function()
|
|
||||||
|
|
||||||
local i = 0
|
|
||||||
while i <= 32767 do
|
|
||||||
local FileName = Include.FileName( i )
|
|
||||||
local FileChunk = {}
|
|
||||||
local FileChunk = Include.FileIn( Include.MissionPath .. FileName, FileChunk )
|
|
||||||
if FileChunk then
|
|
||||||
end
|
|
||||||
i = i + 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
Include.File = function( IncludeFile )
|
|
||||||
if not Include.Files[ IncludeFile ] then
|
|
||||||
Include.Files[IncludeFile] = IncludeFile
|
|
||||||
env.info( "Include:" .. IncludeFile .. " from " .. Include.ProgramPath )
|
|
||||||
local f = base.loadfile( Include.ProgramPath .. IncludeFile .. ".lua" )
|
|
||||||
if f == nil then
|
|
||||||
env.info( "Include:" .. IncludeFile .. " from " .. Include.MissionPath )
|
|
||||||
local f = base.loadfile( Include.MissionPath .. IncludeFile .. ".lua" )
|
|
||||||
if f == nil then
|
|
||||||
error ("Could not load MOOSE file " .. IncludeFile .. ".lua" )
|
|
||||||
else
|
|
||||||
env.info( "Include:" .. IncludeFile .. " loaded from " .. Include.MissionPath )
|
|
||||||
return f()
|
|
||||||
end
|
|
||||||
else
|
|
||||||
env.info( "Include:" .. IncludeFile .. " loaded from " .. Include.ProgramPath )
|
|
||||||
return f()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--porting in Slmod's "safestring" basic serialize
|
|
||||||
Include.basicSerialize = function(s)
|
|
||||||
if s == nil then
|
|
||||||
return "\"\""
|
|
||||||
else
|
|
||||||
if ((type(s) == 'number') or (type(s) == 'boolean') or (type(s) == 'function') or (type(s) == 'table') or (type(s) == 'userdata') ) then
|
|
||||||
return tostring(s)
|
|
||||||
elseif type(s) == 'string' then
|
|
||||||
s = string.format('%q', s)
|
|
||||||
return s
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- porting in Slmod's serialize_slmod2
|
|
||||||
Include.oneLineSerialize = function(tbl) -- serialization of a table all on a single line, no comments, made to replace old get_table_string function
|
|
||||||
if type(tbl) == 'table' then --function only works for tables!
|
|
||||||
|
|
||||||
local tbl_str = {}
|
|
||||||
|
|
||||||
tbl_str[#tbl_str + 1] = '{'
|
|
||||||
|
|
||||||
for ind,val in pairs(tbl) do -- serialize its fields
|
|
||||||
if type(ind) == "number" then
|
|
||||||
tbl_str[#tbl_str + 1] = '['
|
|
||||||
tbl_str[#tbl_str + 1] = tostring(ind)
|
|
||||||
tbl_str[#tbl_str + 1] = ']='
|
|
||||||
else --must be a string
|
|
||||||
tbl_str[#tbl_str + 1] = '['
|
|
||||||
tbl_str[#tbl_str + 1] = Include.basicSerialize(ind)
|
|
||||||
tbl_str[#tbl_str + 1] = ']='
|
|
||||||
end
|
|
||||||
|
|
||||||
if ((type(val) == 'number') or (type(val) == 'boolean')) then
|
|
||||||
tbl_str[#tbl_str + 1] = tostring(val)
|
|
||||||
tbl_str[#tbl_str + 1] = ','
|
|
||||||
elseif type(val) == 'string' then
|
|
||||||
tbl_str[#tbl_str + 1] = Include.basicSerialize(val)
|
|
||||||
tbl_str[#tbl_str + 1] = ','
|
|
||||||
elseif type(val) == 'nil' then -- won't ever happen, right?
|
|
||||||
tbl_str[#tbl_str + 1] = 'nil,'
|
|
||||||
elseif type(val) == 'table' then
|
|
||||||
if ind == "__index" then
|
|
||||||
tbl_str[#tbl_str + 1] = "__index"
|
|
||||||
tbl_str[#tbl_str + 1] = ',' --I think this is right, I just added it
|
|
||||||
else
|
|
||||||
tbl_str[#tbl_str + 1] = Include.oneLineSerialize(val)
|
|
||||||
tbl_str[#tbl_str + 1] = ',' --I think this is right, I just added it
|
|
||||||
end
|
|
||||||
elseif type(val) == 'function' then
|
|
||||||
tbl_str[#tbl_str + 1] = "function " .. tostring(ind)
|
|
||||||
tbl_str[#tbl_str + 1] = ',' --I think this is right, I just added it
|
|
||||||
else
|
|
||||||
env.info('unable to serialize value type ' .. Include.basicSerialize(type(val)) .. ' at index ' .. tostring(ind))
|
|
||||||
env.info( debug.traceback() )
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
tbl_str[#tbl_str + 1] = '}'
|
|
||||||
return table.concat(tbl_str)
|
|
||||||
else
|
|
||||||
return tostring(tbl)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
Include.ScanFiles( )
|
|
||||||
|
|
||||||
Include.File( "Database" )
|
|
||||||
|
|
||||||
env.info("Loaded MOOSE Include Engine")
|
|
||||||
@ -6,13 +6,21 @@ Include.File( "Routines" )
|
|||||||
|
|
||||||
_TraceOn = true
|
_TraceOn = true
|
||||||
_TraceClass = {
|
_TraceClass = {
|
||||||
DATABASE = true,
|
--DATABASE = true,
|
||||||
--SEAD = true,
|
--SEAD = true,
|
||||||
--DESTROYBASETASK = true,
|
--DESTROYBASETASK = true,
|
||||||
--MOVEMENT = true,
|
--MOVEMENT = true,
|
||||||
--SPAWN = true,
|
SPAWN = true,
|
||||||
--GROUP = true,
|
STAGE = true,
|
||||||
--UNIT = true,
|
ZONE = true,
|
||||||
|
GROUP = true,
|
||||||
|
UNIT = true,
|
||||||
|
--CLIENT = true,
|
||||||
|
--CARGO = true,
|
||||||
|
CARGO_GROUP = true,
|
||||||
|
--CARGO_PACKAGE = true,
|
||||||
|
--CARGO_SLINGLOAD = true,
|
||||||
|
CARGO_ZONE = true,
|
||||||
}
|
}
|
||||||
|
|
||||||
BASE = {
|
BASE = {
|
||||||
|
|||||||
@ -40,7 +40,6 @@ self:T( { CargoZoneName, CargoHostName } )
|
|||||||
|
|
||||||
if CargoHostName then
|
if CargoHostName then
|
||||||
self.CargoHostName = CargoHostName
|
self.CargoHostName = CargoHostName
|
||||||
self.CargoHostSpawn = SPAWN:New( CargoHostName )
|
|
||||||
end
|
end
|
||||||
|
|
||||||
self:T( self.CargoZone )
|
self:T( self.CargoZone )
|
||||||
@ -49,33 +48,35 @@ self:T( { CargoZoneName, CargoHostName } )
|
|||||||
end
|
end
|
||||||
|
|
||||||
function CARGO_ZONE:Spawn()
|
function CARGO_ZONE:Spawn()
|
||||||
self:T( CargoHostSpawn )
|
self:T( self.CargoHostName )
|
||||||
|
|
||||||
if self.CargoHostSpawn then
|
if self.CargoHostSpawn then
|
||||||
local CargoHostGroup = Group.getByName( self.CargoHostSpawn:SpawnGroupName() )
|
local CargoHostGroup = self.CargoHostSpawn:GetGroupFromIndex()
|
||||||
if CargoHostGroup then
|
if CargoHostGroup and CargoHostGroup:IsAlive() then
|
||||||
if not CargoHostGroup:isExist() then
|
|
||||||
self.CargoHostSpawn:ReSpawn()
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
self.CargoHostSpawn:ReSpawn()
|
self.CargoHostSpawn:ReSpawn( 1 )
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
self:T( "Initialize CargoHostSpawn" )
|
||||||
|
self.CargoHostSpawn = SPAWN:New( self.CargoHostName )
|
||||||
|
self.CargoHostSpawn:ReSpawn( 1 )
|
||||||
end
|
end
|
||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
function CARGO_ZONE:GetHostUnit()
|
function CARGO_ZONE:GetHostUnit()
|
||||||
|
self:T( self )
|
||||||
|
|
||||||
if self.CargoHostName then
|
if self.CargoHostName then
|
||||||
|
|
||||||
-- A Host has been given, signal the host
|
-- A Host has been given, signal the host
|
||||||
local CargoHostGroup = Group.getByName( self.CargoHostSpawn:SpawnGroupName() )
|
local CargoHostGroup = self.CargoHostSpawn:GetGroupFromIndex()
|
||||||
local CargoHostUnit
|
local CargoHostUnit
|
||||||
if CargoHostGroup == nil then
|
if CargoHostGroup and CargoHostGroup:IsAlive() then
|
||||||
CargoHostUnit = StaticObject.getByName( self.CargoHostName )
|
CargoHostUnit = CargoHostGroup:GetUnit(1)
|
||||||
else
|
else
|
||||||
CargoHostUnit = CargoHostGroup:getUnits()[1]
|
CargoHostUnit = StaticObject.getByName( self.CargoHostName )
|
||||||
end
|
end
|
||||||
|
|
||||||
return CargoHostUnit
|
return CargoHostUnit
|
||||||
@ -129,7 +130,7 @@ self:T()
|
|||||||
if SignalUnit then
|
if SignalUnit then
|
||||||
|
|
||||||
self:T( 'Signalling Unit' )
|
self:T( 'Signalling Unit' )
|
||||||
local SignalVehiclePos = SignalUnit:getPosition().p
|
local SignalVehiclePos = SignalUnit:GetPositionVec3()
|
||||||
SignalVehiclePos.y = SignalVehiclePos.y + 2
|
SignalVehiclePos.y = SignalVehiclePos.y + 2
|
||||||
|
|
||||||
if self.SignalType.ID == CARGO_ZONE.SIGNAL.TYPE.SMOKE.ID then
|
if self.SignalType.ID == CARGO_ZONE.SIGNAL.TYPE.SMOKE.ID then
|
||||||
@ -251,11 +252,16 @@ end
|
|||||||
|
|
||||||
|
|
||||||
function CARGO_ZONE:GetCargoHostUnit()
|
function CARGO_ZONE:GetCargoHostUnit()
|
||||||
self:T()
|
self:T( self )
|
||||||
|
|
||||||
local CargoHostUnit = Group.getByName( self.CargoHostSpawn:SpawnGroupName() ):getUnit(1)
|
if self.CargoHostSpawn then
|
||||||
if CargoHostUnit and CargoHostUnit:isExist() then
|
local CargoHostGroup = self.CargoHostSpawn:GetGroupFromIndex(1)
|
||||||
return CargoHostUnit
|
if CargoHostGroup and CargoHostGroup:IsAlive() then
|
||||||
|
local CargoHostUnit = CargoHostGroup:GetUnit(1)
|
||||||
|
if CargoHostUnit and CargoHostUnit:IsAlive() then
|
||||||
|
return CargoHostUnit
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
@ -347,7 +353,7 @@ self:T()
|
|||||||
local Valid = true
|
local Valid = true
|
||||||
|
|
||||||
self.CargoClient = Client
|
self.CargoClient = Client
|
||||||
local ClientUnit = Client:GetClientGroupUnit()
|
local ClientUnit = Client:GetClientGroupDCSUnit()
|
||||||
|
|
||||||
return Valid
|
return Valid
|
||||||
end
|
end
|
||||||
@ -451,7 +457,7 @@ CARGO_GROUP = {
|
|||||||
function CARGO_GROUP:New( CargoType, CargoName, CargoWeight, CargoGroupTemplate, CargoZone ) local self = BASE:Inherit( self, CARGO:New( CargoType, CargoName, CargoWeight ) )
|
function CARGO_GROUP:New( CargoType, CargoName, CargoWeight, CargoGroupTemplate, CargoZone ) local self = BASE:Inherit( self, CARGO:New( CargoType, CargoName, CargoWeight ) )
|
||||||
self:T( { CargoType, CargoName, CargoWeight, CargoGroupTemplate, CargoZone } )
|
self:T( { CargoType, CargoName, CargoWeight, CargoGroupTemplate, CargoZone } )
|
||||||
|
|
||||||
self.CargoSpawn = SPAWN:New( CargoGroupTemplate )
|
self.CargoSpawn = SPAWN:NewWithAlias( CargoGroupTemplate, CargoName )
|
||||||
self.CargoZone = CargoZone
|
self.CargoZone = CargoZone
|
||||||
|
|
||||||
CARGOS[self.CargoName] = self
|
CARGOS[self.CargoName] = self
|
||||||
@ -499,10 +505,10 @@ self:T()
|
|||||||
if SpawnCargo then
|
if SpawnCargo then
|
||||||
if self.CargoZone:GetCargoHostUnit() then
|
if self.CargoZone:GetCargoHostUnit() then
|
||||||
--- ReSpawn the Cargo from the CargoHost
|
--- ReSpawn the Cargo from the CargoHost
|
||||||
self.CargoGroupName = self.CargoSpawn:FromHost( self.CargoZone:GetCargoHostUnit(), 60, 30, self.CargoName, false ).name
|
self.CargoGroupName = self.CargoSpawn:SpawnFromUnit( self.CargoZone:GetCargoHostUnit(), 60, 30 ):GetName()
|
||||||
else
|
else
|
||||||
--- ReSpawn the Cargo in the CargoZone without a host ...
|
--- ReSpawn the Cargo in the CargoZone without a host ...
|
||||||
self.CargoGroupName = self.CargoSpawn:InZone( self.CargoZone:GetCargoZoneName(), self.CargoName ).name
|
self.CargoGroupName = self.CargoSpawn:SpawnInZone( self.CargoZone ):GetName()
|
||||||
end
|
end
|
||||||
self:StatusNone()
|
self:StatusNone()
|
||||||
end
|
end
|
||||||
@ -534,7 +540,7 @@ self:T()
|
|||||||
|
|
||||||
local Valid = true
|
local Valid = true
|
||||||
|
|
||||||
local ClientUnit = Client:GetClientGroupUnit()
|
local ClientUnit = Client:GetClientGroupDCSUnit()
|
||||||
|
|
||||||
local CarrierPos = ClientUnit:getPoint()
|
local CarrierPos = ClientUnit:getPoint()
|
||||||
local CarrierPosMove = ClientUnit:getPoint()
|
local CarrierPosMove = ClientUnit:getPoint()
|
||||||
@ -630,8 +636,10 @@ self:T()
|
|||||||
self:T( 'self.CargoName = ' .. self.CargoName )
|
self:T( 'self.CargoName = ' .. self.CargoName )
|
||||||
self:T( 'self.CargoGroupName = ' .. self.CargoGroupName )
|
self:T( 'self.CargoGroupName = ' .. self.CargoGroupName )
|
||||||
|
|
||||||
self.CargoSpawn:FromCarrier( Client:GetClientGroupUnit(), TargetZoneName, self.CargoGroupName )
|
--self.CargoSpawn:FromCarrier( Client:GetClientGroupDCSUnit(), TargetZoneName, self.CargoGroupName )
|
||||||
|
|
||||||
|
self.CargoSpawn:SpawnFromUnit( Client:GetClientGroupUnit(), self.CargoGroupName ):RouteToZone( ZONE:New( TargetZoneName ), true )
|
||||||
|
|
||||||
self:StatusUnLoaded()
|
self:StatusUnLoaded()
|
||||||
|
|
||||||
return self
|
return self
|
||||||
@ -645,7 +653,7 @@ CARGO_PACKAGE = {
|
|||||||
|
|
||||||
function CARGO_PACKAGE:New( CargoType, CargoName, CargoWeight, CargoClient ) local self = BASE:Inherit( self, CARGO:New( CargoType, CargoName, CargoWeight ) )
|
function CARGO_PACKAGE:New( CargoType, CargoName, CargoWeight, CargoClient ) local self = BASE:Inherit( self, CARGO:New( CargoType, CargoName, CargoWeight ) )
|
||||||
|
|
||||||
self:T( { CargoType, CargoName, CargoWeight, CargoClient.ClientName } )
|
self:T( { CargoType, CargoName, CargoWeight, CargoClient } )
|
||||||
|
|
||||||
self.CargoClient = CargoClient
|
self.CargoClient = CargoClient
|
||||||
|
|
||||||
@ -657,16 +665,16 @@ end
|
|||||||
|
|
||||||
|
|
||||||
function CARGO_PACKAGE:Spawn()
|
function CARGO_PACKAGE:Spawn()
|
||||||
self:T()
|
self:T( self )
|
||||||
|
|
||||||
-- this needs to be checked thoroughly
|
-- this needs to be checked thoroughly
|
||||||
|
|
||||||
local CargoClientInitGroup = self.CargoClient:ClientGroup()
|
local CargoClientGroup = self.CargoClient:ClientGroup()
|
||||||
if not CargoClientInitGroup then
|
if not CargoClientGroup then
|
||||||
if not self.CargoClientInitGroupSpawn then
|
if not self.CargoClientSpawn then
|
||||||
self.CargoClientInitGroupSpawn = SPAWN:New( self.CargoClient:GetClientGroupName() )
|
self.CargoClientSpawn = SPAWN:New( self.CargoClient:GetClientGroupName() )
|
||||||
end
|
end
|
||||||
self.CargoClientInitGroupSpawn:Spawn( self.CargoClient:GetClientGroupName() )
|
self.CargoClientSpawn:ReSpawn( 1 )
|
||||||
end
|
end
|
||||||
|
|
||||||
local SpawnCargo = true
|
local SpawnCargo = true
|
||||||
@ -705,7 +713,7 @@ self:T()
|
|||||||
self:T( self.CargoClient.ClientName )
|
self:T( self.CargoClient.ClientName )
|
||||||
self:T( 'Client Exists.' )
|
self:T( 'Client Exists.' )
|
||||||
|
|
||||||
if routines.IsUnitInRadius( self.CargoClient:GetClientGroupUnit(), Client:ClientPosition(), 150 ) then
|
if routines.IsUnitInRadius( self.CargoClient:GetClientGroupDCSUnit(), Client:ClientPosition(), 150 ) then
|
||||||
Near = true
|
Near = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -720,7 +728,7 @@ self:T()
|
|||||||
|
|
||||||
local Valid = true
|
local Valid = true
|
||||||
|
|
||||||
local ClientUnit = Client:GetClientGroupUnit()
|
local ClientUnit = Client:GetClientGroupDCSUnit()
|
||||||
|
|
||||||
local CarrierPos = ClientUnit:getPoint()
|
local CarrierPos = ClientUnit:getPoint()
|
||||||
local CarrierPosMove = ClientUnit:getPoint()
|
local CarrierPosMove = ClientUnit:getPoint()
|
||||||
@ -812,7 +820,7 @@ self:T()
|
|||||||
local OnBoarded = false
|
local OnBoarded = false
|
||||||
|
|
||||||
if self.CargoClient and self.CargoClient:ClientGroup() then
|
if self.CargoClient and self.CargoClient:ClientGroup() then
|
||||||
if routines.IsUnitInRadius( self.CargoClient:GetClientGroupUnit(), self.CargoClient:ClientPosition(), 10 ) then
|
if routines.IsUnitInRadius( self.CargoClient:GetClientGroupDCSUnit(), self.CargoClient:ClientPosition(), 10 ) then
|
||||||
|
|
||||||
-- Switch Cargo from self.CargoClient to Client ... Each cargo can have only one client. So assigning the new client for the cargo is enough.
|
-- Switch Cargo from self.CargoClient to Client ... Each cargo can have only one client. So assigning the new client for the cargo is enough.
|
||||||
self:StatusLoaded( Client )
|
self:StatusLoaded( Client )
|
||||||
|
|||||||
@ -175,6 +175,24 @@ self:T()
|
|||||||
|
|
||||||
local ClientGroup = self:ClientGroup()
|
local ClientGroup = self:ClientGroup()
|
||||||
|
|
||||||
|
if ClientGroup then
|
||||||
|
if ClientGroup:isExist() then
|
||||||
|
return UNIT:New( ClientGroup:getUnit(1) )
|
||||||
|
else
|
||||||
|
return UNIT:New( self.ClientGroupUnit )
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Returns the DCSUnit of the @{CLIENT}.
|
||||||
|
-- @treturn DCSUnit
|
||||||
|
function CLIENT:GetClientGroupDCSUnit()
|
||||||
|
self:T()
|
||||||
|
|
||||||
|
local ClientGroup = self:ClientGroup()
|
||||||
|
|
||||||
if ClientGroup then
|
if ClientGroup then
|
||||||
if ClientGroup:isExist() then
|
if ClientGroup:isExist() then
|
||||||
return ClientGroup:getUnits()[1]
|
return ClientGroup:getUnits()[1]
|
||||||
@ -189,7 +207,7 @@ end
|
|||||||
function CLIENT:GetUnit()
|
function CLIENT:GetUnit()
|
||||||
self:T()
|
self:T()
|
||||||
|
|
||||||
return UNIT:New( self:GetClientGroupUnit() )
|
return UNIT:New( self:GetClientGroupDCSUnit() )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -198,7 +216,7 @@ end
|
|||||||
function CLIENT:ClientPosition()
|
function CLIENT:ClientPosition()
|
||||||
--self:T()
|
--self:T()
|
||||||
|
|
||||||
ClientGroupUnit = self:GetClientGroupUnit()
|
ClientGroupUnit = self:GetClientGroupDCSUnit()
|
||||||
|
|
||||||
if ClientGroupUnit then
|
if ClientGroupUnit then
|
||||||
if ClientGroupUnit:isExist() then
|
if ClientGroupUnit:isExist() then
|
||||||
@ -294,7 +312,7 @@ self:T()
|
|||||||
end
|
end
|
||||||
MESSAGE:New( Message, MessageCategory, MessageDuration, MessageId ):ToClient( self )
|
MESSAGE:New( Message, MessageCategory, MessageDuration, MessageId ):ToClient( self )
|
||||||
else
|
else
|
||||||
if self:GetClientGroupUnit() and not self:GetClientGroupUnit():inAir() then
|
if self:GetClientGroupDCSUnit() and not self:GetClientGroupDCSUnit():inAir() then
|
||||||
if timer.getTime() - self.Messages[MessageId].MessageTime >= self.Messages[MessageId].MessageDuration + 10 then
|
if timer.getTime() - self.Messages[MessageId].MessageTime >= self.Messages[MessageId].MessageDuration + 10 then
|
||||||
MESSAGE:New( Message, MessageCategory, MessageDuration, MessageId ):ToClient( self )
|
MESSAGE:New( Message, MessageCategory, MessageDuration, MessageId ):ToClient( self )
|
||||||
self.Messages[MessageId].MessageTime = timer.getTime()
|
self.Messages[MessageId].MessageTime = timer.getTime()
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
Include.File( "Routines" )
|
Include.File( "Routines" )
|
||||||
Include.File( "Base" )
|
Include.File( "Base" )
|
||||||
Include.File( "Menu" )
|
Include.File( "Menu" )
|
||||||
|
Include.File( "Group" )
|
||||||
|
|
||||||
DATABASE = {
|
DATABASE = {
|
||||||
ClassName = "DATABASE",
|
ClassName = "DATABASE",
|
||||||
@ -138,6 +139,9 @@ function DATABASE:Spawn( SpawnTemplate )
|
|||||||
|
|
||||||
self:_RegisterGroup( SpawnTemplate )
|
self:_RegisterGroup( SpawnTemplate )
|
||||||
coalition.addGroup( SpawnCountryID, SpawnCategoryID, SpawnTemplate )
|
coalition.addGroup( SpawnCountryID, SpawnCategoryID, SpawnTemplate )
|
||||||
|
|
||||||
|
local SpawnGroup = GROUP:New( Group.getByName( SpawnTemplate.name ) )
|
||||||
|
return SpawnGroup
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -206,7 +210,7 @@ end
|
|||||||
|
|
||||||
--- Track DCSRTE DEAD or CRASH events for the internal scoring.
|
--- Track DCSRTE DEAD or CRASH events for the internal scoring.
|
||||||
function DATABASE:OnDeadOrCrash( event )
|
function DATABASE:OnDeadOrCrash( event )
|
||||||
self:T( { event } )
|
--self:T( { event } )
|
||||||
|
|
||||||
local TargetUnit = nil
|
local TargetUnit = nil
|
||||||
local TargetGroup = nil
|
local TargetGroup = nil
|
||||||
@ -241,7 +245,7 @@ function DATABASE:OnDeadOrCrash( event )
|
|||||||
TargetUnitCategory = DATABASECategory[TargetCategory]
|
TargetUnitCategory = DATABASECategory[TargetCategory]
|
||||||
TargetUnitType = TargetType
|
TargetUnitType = TargetType
|
||||||
|
|
||||||
self:T( { TargetUnitName, TargetGroupName, TargetPlayerName, TargetCoalition, TargetCategory, TargetType } )
|
--self:T( { TargetUnitName, TargetGroupName, TargetPlayerName, TargetCoalition, TargetCategory, TargetType } )
|
||||||
end
|
end
|
||||||
|
|
||||||
for PlayerName, PlayerData in pairs( self.Players ) do
|
for PlayerName, PlayerData in pairs( self.Players ) do
|
||||||
|
|||||||
180
Moose/Group.lua
180
Moose/Group.lua
@ -13,13 +13,14 @@ GROUP = {
|
|||||||
ClassName="GROUP",
|
ClassName="GROUP",
|
||||||
}
|
}
|
||||||
|
|
||||||
function GROUP:New( _Group )
|
function GROUP:New( DCSGroup )
|
||||||
local self = BASE:Inherit( self, BASE:New() )
|
local self = BASE:Inherit( self, BASE:New() )
|
||||||
self:T( _Group:getName() )
|
self:T( DCSGroup:getName() )
|
||||||
|
|
||||||
self._Group = _Group
|
self.DCSGroup = DCSGroup
|
||||||
self.GroupName = _Group:getName()
|
self.GroupName = DCSGroup:getName()
|
||||||
self.GroupID = _Group:getID()
|
self.GroupID = DCSGroup:getID()
|
||||||
|
self.Controller = DCSGroup:getController()
|
||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
@ -29,13 +30,32 @@ function GROUP:NewFromName( GroupName )
|
|||||||
local self = BASE:Inherit( self, BASE:New() )
|
local self = BASE:Inherit( self, BASE:New() )
|
||||||
self:T( GroupName )
|
self:T( GroupName )
|
||||||
|
|
||||||
self._Group = Group.getByName( GroupName )
|
self.DCSGroup = Group.getByName( GroupName )
|
||||||
self.GroupName = self._Group:getName()
|
if self.DCSGroup then
|
||||||
self.GroupID = self._Group:getID()
|
self.GroupName = self.DCSGroup:getName()
|
||||||
|
self.GroupID = self.DCSGroup:getID()
|
||||||
|
end
|
||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function GROUP:GetDCSGroup()
|
||||||
|
self:T( { self.GroupName } )
|
||||||
|
self.DCSGroup = Group.getByName( self.GroupName )
|
||||||
|
return self.DCSGroup
|
||||||
|
end
|
||||||
|
|
||||||
|
function GROUP:GetDCSUnit( UnitNumber )
|
||||||
|
self:T( { self.GroupName, UnitNumber } )
|
||||||
|
return self.DCSGroup:getUnit( UnitNumber )
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function GROUP:Activate()
|
||||||
|
self:T( { self.GroupName } )
|
||||||
|
trigger.action.activateGroup( self:GetDCSGroup() )
|
||||||
|
return self:GetDCSGroup()
|
||||||
|
end
|
||||||
|
|
||||||
function GROUP:GetName()
|
function GROUP:GetName()
|
||||||
self:T( self.GroupName )
|
self:T( self.GroupName )
|
||||||
@ -43,40 +63,59 @@ function GROUP:GetName()
|
|||||||
return self.GroupName
|
return self.GroupName
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function GROUP:GetPoint()
|
||||||
|
self:T( self.GroupName )
|
||||||
|
|
||||||
|
local GroupPoint = self:GetUnit(1):GetPoint()
|
||||||
|
self:T( GroupPoint )
|
||||||
|
return GroupPoint
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function GROUP:Destroy()
|
function GROUP:Destroy()
|
||||||
self:T( self.GroupName )
|
self:T( self.GroupName )
|
||||||
|
|
||||||
for Index, UnitData in pairs( self._Group:getUnits() ) do
|
for Index, UnitData in pairs( self.DCSGroup:getUnits() ) do
|
||||||
self:CreateEventCrash( timer.getTime(), UnitData )
|
self:CreateEventCrash( timer.getTime(), UnitData )
|
||||||
end
|
end
|
||||||
|
|
||||||
self._Group:destroy()
|
self.DCSGroup:destroy()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function GROUP:GetUnit( UnitNumber )
|
function GROUP:GetUnit( UnitNumber )
|
||||||
self:T( self.GroupName )
|
self:T( { self.GroupName, UnitNumber } )
|
||||||
return UNIT:New( self._Group:getUnit( UnitNumber ) )
|
return UNIT:New( self.DCSGroup:getUnit( UnitNumber ) )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function GROUP:IsAir()
|
function GROUP:IsAir()
|
||||||
self:T()
|
self:T()
|
||||||
|
|
||||||
local IsAirResult = self._Group:getCategory() == Group.Category.AIRPLANE or self._Group:getCategory() == Group.Category.HELICOPTER
|
local IsAirResult = self.DCSGroup:getCategory() == Group.Category.AIRPLANE or self.DCSGroup:getCategory() == Group.Category.HELICOPTER
|
||||||
|
|
||||||
self:T( IsAirResult )
|
self:T( IsAirResult )
|
||||||
return IsAirResult
|
return IsAirResult
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function GROUP:IsAlive()
|
||||||
|
self:T()
|
||||||
|
|
||||||
|
local IsAliveResult = self.DCSGroup and self.DCSGroup:isExist()
|
||||||
|
|
||||||
|
self:T( IsAliveResult )
|
||||||
|
return IsAliveResult
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function GROUP:AllOnGround()
|
function GROUP:AllOnGround()
|
||||||
self:T()
|
self:T()
|
||||||
|
|
||||||
local AllOnGroundResult = true
|
local AllOnGroundResult = true
|
||||||
|
|
||||||
for Index, UnitData in pairs( self._Group:getUnits() ) do
|
for Index, UnitData in pairs( self.DCSGroup:getUnits() ) do
|
||||||
if UnitData:inAir() then
|
if UnitData:inAir() then
|
||||||
AllOnGroundResult = false
|
AllOnGroundResult = false
|
||||||
end
|
end
|
||||||
@ -92,7 +131,7 @@ self:T()
|
|||||||
|
|
||||||
local MaxVelocity = 0
|
local MaxVelocity = 0
|
||||||
|
|
||||||
for Index, UnitData in pairs( self._Group:getUnits() ) do
|
for Index, UnitData in pairs( self.DCSGroup:getUnits() ) do
|
||||||
|
|
||||||
local Velocity = UnitData:getVelocity()
|
local Velocity = UnitData:getVelocity()
|
||||||
local VelocityTotal = math.abs( Velocity.x ) + math.abs( Velocity.y ) + math.abs( Velocity.z )
|
local VelocityTotal = math.abs( Velocity.x ) + math.abs( Velocity.y ) + math.abs( Velocity.z )
|
||||||
@ -129,13 +168,13 @@ end
|
|||||||
|
|
||||||
|
|
||||||
function GROUP:Embarking( Point, Duration, EmbarkingGroup )
|
function GROUP:Embarking( Point, Duration, EmbarkingGroup )
|
||||||
trace.f( self.ClassName, { self.GroupName, Point, Duration, EmbarkingGroup._Group } )
|
trace.f( self.ClassName, { self.GroupName, Point, Duration, EmbarkingGroup.DCSGroup } )
|
||||||
|
|
||||||
local Controller = self:_GetController()
|
local Controller = self:_GetController()
|
||||||
|
|
||||||
trace.i( self.ClassName, EmbarkingGroup.GroupID )
|
trace.i( self.ClassName, EmbarkingGroup.GroupID )
|
||||||
trace.i( self.ClassName, EmbarkingGroup._Group:getID() )
|
trace.i( self.ClassName, EmbarkingGroup.DCSGroup:getID() )
|
||||||
trace.i( self.ClassName, EmbarkingGroup._Group.id )
|
trace.i( self.ClassName, EmbarkingGroup.DCSGroup.id )
|
||||||
|
|
||||||
Controller:pushTask( { id = 'Embarking',
|
Controller:pushTask( { id = 'Embarking',
|
||||||
params = { x = Point.x,
|
params = { x = Point.x,
|
||||||
@ -169,9 +208,112 @@ trace.f( self.ClassName, { self.GroupName, Point, Radius } )
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function GROUP:Route( GoPoints )
|
||||||
|
self:T( GoPoints )
|
||||||
|
|
||||||
|
local Points = routines.utils.deepCopy( GoPoints )
|
||||||
|
local MissionTask = { id = 'Mission', params = { route = { points = Points, }, }, }
|
||||||
|
|
||||||
|
--self.Controller.setTask( self.Controller, MissionTask )
|
||||||
|
|
||||||
|
routines.scheduleFunction( self.Controller.setTask, { self.Controller, MissionTask}, timer.getTime() + 1 )
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
function GROUP:RouteToZone( Zone, Randomize, Speed, Formation )
|
||||||
|
self:T( Zone )
|
||||||
|
|
||||||
|
local GroupPoint = self:GetPoint()
|
||||||
|
|
||||||
|
local PointFrom = {}
|
||||||
|
PointFrom.x = GroupPoint.x
|
||||||
|
PointFrom.y = GroupPoint.y
|
||||||
|
PointFrom.type = "Turning Point"
|
||||||
|
PointFrom.action = "Cone"
|
||||||
|
PointFrom.speed = 20 / 1.6
|
||||||
|
|
||||||
|
|
||||||
|
local PointTo = {}
|
||||||
|
local ZonePoint
|
||||||
|
|
||||||
|
if Randomize then
|
||||||
|
ZonePoint = Zone:GetRandomPoint()
|
||||||
|
else
|
||||||
|
ZonePoint = Zone:GetPoint()
|
||||||
|
end
|
||||||
|
|
||||||
|
PointTo.x = ZonePoint.x
|
||||||
|
PointTo.y = ZonePoint.y
|
||||||
|
PointTo.type = "Turning Point"
|
||||||
|
|
||||||
|
if Formation then
|
||||||
|
PointTo.action = Formation
|
||||||
|
else
|
||||||
|
PointTo.action = "Cone"
|
||||||
|
end
|
||||||
|
|
||||||
|
if Speed then
|
||||||
|
PointTo.speed = Speed
|
||||||
|
else
|
||||||
|
PointTo.speed = 20 / 1.6
|
||||||
|
end
|
||||||
|
|
||||||
|
local Points = { PointFrom, PointTo }
|
||||||
|
|
||||||
|
self:T( Points )
|
||||||
|
|
||||||
|
self:Route( Points )
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
function GROUP:CopyRoute( Begin, End, Randomize, Radius )
|
||||||
|
self:T( { Begin, End } )
|
||||||
|
|
||||||
|
local Points = {}
|
||||||
|
|
||||||
|
-- Could be a Spawned Group
|
||||||
|
local GroupName = string.match( self:GetName(), ".*#" )
|
||||||
|
if GroupName then
|
||||||
|
GroupName = GroupName:sub( 1, -2 )
|
||||||
|
else
|
||||||
|
GroupName = self:GetName()
|
||||||
|
end
|
||||||
|
|
||||||
|
self:T( { GroupName } )
|
||||||
|
|
||||||
|
local Template = _Database.Groups[GroupName].Template
|
||||||
|
|
||||||
|
if Template then
|
||||||
|
if not Begin then
|
||||||
|
Begin = 0
|
||||||
|
end
|
||||||
|
if not End then
|
||||||
|
End = 0
|
||||||
|
end
|
||||||
|
|
||||||
|
for TPointID = Begin + 1, #Template.route.points - End do
|
||||||
|
if Template.route.points[TPointID] then
|
||||||
|
Points[#Points+1] = routines.utils.deepCopy( Template.route.points[TPointID] )
|
||||||
|
if Randomize then
|
||||||
|
if not Radius then
|
||||||
|
Radius = 500
|
||||||
|
end
|
||||||
|
Points[#Points].x = Points[#Points].x + math.random( Radius * -1, Radius )
|
||||||
|
Points[#Points].y = Points[#Points].y + math.random( Radius * -1, Radius )
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return Points
|
||||||
|
end
|
||||||
|
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function GROUP:_GetController()
|
function GROUP:_GetController()
|
||||||
|
|
||||||
return self._Group:getController()
|
return self.DCSGroup:getController()
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@ -174,12 +174,12 @@ function MISSION:ReportToAll()
|
|||||||
local AlivePlayers = ''
|
local AlivePlayers = ''
|
||||||
for ClientID, Client in pairs( self._Clients ) do
|
for ClientID, Client in pairs( self._Clients ) do
|
||||||
if Client:ClientGroup() then
|
if Client:ClientGroup() then
|
||||||
if Client:GetClientGroupUnit() then
|
if Client:GetClientGroupDCSUnit() then
|
||||||
if Client:GetClientGroupUnit():getLife() > 0.0 then
|
if Client:GetClientGroupDCSUnit():getLife() > 0.0 then
|
||||||
if AlivePlayers == '' then
|
if AlivePlayers == '' then
|
||||||
AlivePlayers = ' Players: ' .. Client:GetClientGroupUnit():getPlayerName()
|
AlivePlayers = ' Players: ' .. Client:GetClientGroupDCSUnit():getPlayerName()
|
||||||
else
|
else
|
||||||
AlivePlayers = AlivePlayers .. ' / ' .. Client:GetClientGroupUnit():getPlayerName()
|
AlivePlayers = AlivePlayers .. ' / ' .. Client:GetClientGroupDCSUnit():getPlayerName()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -486,7 +486,7 @@ trace.scheduled("MISSIONSCHEDULER","Scheduler")
|
|||||||
if Mission.GoalFunction ~= nil then
|
if Mission.GoalFunction ~= nil then
|
||||||
Mission.GoalFunction( Mission, Client )
|
Mission.GoalFunction( Mission, Client )
|
||||||
end
|
end
|
||||||
_Database:_AddMissionTaskScore( Client:GetClientGroupUnit(), Mission.Name, 25 )
|
_Database:_AddMissionTaskScore( Client:GetClientGroupDCSUnit(), Mission.Name, 25 )
|
||||||
|
|
||||||
-- if not Mission:IsCompleted() then
|
-- if not Mission:IsCompleted() then
|
||||||
-- end
|
-- end
|
||||||
|
|||||||
31
Moose/Moose_Create_Embedded.bat
Normal file
31
Moose/Moose_Create_Embedded.bat
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
rem Generate Moose_Embedded.lua
|
||||||
|
|
||||||
|
copy Trace.lua ^
|
||||||
|
+ Routines.lua ^
|
||||||
|
+ Base.lua ^
|
||||||
|
+ Menu.lua ^
|
||||||
|
+ Group.lua ^
|
||||||
|
+ Unit.lua ^
|
||||||
|
+ Zone.lua ^
|
||||||
|
+ Database.lua ^
|
||||||
|
+ Cargo.lua ^
|
||||||
|
+ Client.lua ^
|
||||||
|
+ Message.lua ^
|
||||||
|
+ Stage.lua ^
|
||||||
|
+ Task.lua ^
|
||||||
|
+ GoHomeTask.lua ^
|
||||||
|
+ DestroyBaseTask.lua ^
|
||||||
|
+ DestroyGroupsTask.lua ^
|
||||||
|
+ DestroyRadarsTask.lua ^
|
||||||
|
+ DestroyUnitTypesTask.lua ^
|
||||||
|
+ PickupTask.lua ^
|
||||||
|
+ DeployTask.lua ^
|
||||||
|
+ NoTask.lua ^
|
||||||
|
+ RouteTask.lua ^
|
||||||
|
+ Mission.lua ^
|
||||||
|
+ CleanUp.lua ^
|
||||||
|
+ Spawn.lua ^
|
||||||
|
+ Movement.lua ^
|
||||||
|
+ Sead.lua ^
|
||||||
|
Moose_Embedded.lua
|
||||||
|
|
||||||
10379
Moose/Moose_Embedded.lua
Normal file
10379
Moose/Moose_Embedded.lua
Normal file
File diff suppressed because it is too large
Load Diff
@ -66,41 +66,51 @@ routines.utils.oneLineSerialize = function(tbl) -- serialization of a table all
|
|||||||
tbl_str[#tbl_str + 1] = '{'
|
tbl_str[#tbl_str + 1] = '{'
|
||||||
|
|
||||||
for ind,val in pairs(tbl) do -- serialize its fields
|
for ind,val in pairs(tbl) do -- serialize its fields
|
||||||
|
local ind_str = {}
|
||||||
if type(ind) == "number" then
|
if type(ind) == "number" then
|
||||||
tbl_str[#tbl_str + 1] = '['
|
ind_str[#ind_str + 1] = '['
|
||||||
tbl_str[#tbl_str + 1] = tostring(ind)
|
ind_str[#ind_str + 1] = tostring(ind)
|
||||||
tbl_str[#tbl_str + 1] = ']='
|
ind_str[#ind_str + 1] = ']='
|
||||||
else --must be a string
|
else --must be a string
|
||||||
tbl_str[#tbl_str + 1] = '['
|
ind_str[#ind_str + 1] = '['
|
||||||
tbl_str[#tbl_str + 1] = routines.utils.basicSerialize(ind)
|
ind_str[#ind_str + 1] = routines.utils.basicSerialize(ind)
|
||||||
tbl_str[#tbl_str + 1] = ']='
|
ind_str[#ind_str + 1] = ']='
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local val_str = {}
|
||||||
if ((type(val) == 'number') or (type(val) == 'boolean')) then
|
if ((type(val) == 'number') or (type(val) == 'boolean')) then
|
||||||
tbl_str[#tbl_str + 1] = tostring(val)
|
val_str[#val_str + 1] = tostring(val)
|
||||||
tbl_str[#tbl_str + 1] = ','
|
val_str[#val_str + 1] = ','
|
||||||
elseif type(val) == 'string' then
|
tbl_str[#tbl_str + 1] = table.concat(ind_str)
|
||||||
tbl_str[#tbl_str + 1] = routines.utils.basicSerialize(val)
|
tbl_str[#tbl_str + 1] = table.concat(val_str)
|
||||||
tbl_str[#tbl_str + 1] = ','
|
elseif type(val) == 'string' then
|
||||||
|
val_str[#val_str + 1] = routines.utils.basicSerialize(val)
|
||||||
|
val_str[#val_str + 1] = ','
|
||||||
|
tbl_str[#tbl_str + 1] = table.concat(ind_str)
|
||||||
|
tbl_str[#tbl_str + 1] = table.concat(val_str)
|
||||||
elseif type(val) == 'nil' then -- won't ever happen, right?
|
elseif type(val) == 'nil' then -- won't ever happen, right?
|
||||||
tbl_str[#tbl_str + 1] = 'nil,'
|
val_str[#val_str + 1] = 'nil,'
|
||||||
|
tbl_str[#tbl_str + 1] = table.concat(ind_str)
|
||||||
|
tbl_str[#tbl_str + 1] = table.concat(val_str)
|
||||||
elseif type(val) == 'table' then
|
elseif type(val) == 'table' then
|
||||||
if ind == "__index" then
|
if ind == "__index" then
|
||||||
tbl_str[#tbl_str + 1] = "__index"
|
-- tbl_str[#tbl_str + 1] = "__index"
|
||||||
tbl_str[#tbl_str + 1] = ',' --I think this is right, I just added it
|
-- tbl_str[#tbl_str + 1] = ',' --I think this is right, I just added it
|
||||||
else
|
else
|
||||||
|
|
||||||
tbl_str[#tbl_str + 1] = _Serialize(val)
|
val_str[#val_str + 1] = _Serialize(val)
|
||||||
tbl_str[#tbl_str + 1] = ',' --I think this is right, I just added it
|
val_str[#val_str + 1] = ',' --I think this is right, I just added it
|
||||||
|
tbl_str[#tbl_str + 1] = table.concat(ind_str)
|
||||||
|
tbl_str[#tbl_str + 1] = table.concat(val_str)
|
||||||
end
|
end
|
||||||
elseif type(val) == 'function' then
|
elseif type(val) == 'function' then
|
||||||
tbl_str[#tbl_str + 1] = "function " .. tostring(ind)
|
-- tbl_str[#tbl_str + 1] = "function " .. tostring(ind)
|
||||||
tbl_str[#tbl_str + 1] = ',' --I think this is right, I just added it
|
-- tbl_str[#tbl_str + 1] = ',' --I think this is right, I just added it
|
||||||
else
|
else
|
||||||
env.info('unable to serialize value type ' .. routines.utils.basicSerialize(type(val)) .. ' at index ' .. tostring(ind))
|
-- env.info('unable to serialize value type ' .. routines.utils.basicSerialize(type(val)) .. ' at index ' .. tostring(ind))
|
||||||
env.info( debug.traceback() )
|
-- env.info( debug.traceback() )
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
tbl_str[#tbl_str + 1] = '}'
|
tbl_str[#tbl_str + 1] = '}'
|
||||||
return table.concat(tbl_str)
|
return table.concat(tbl_str)
|
||||||
|
|||||||
@ -132,5 +132,3 @@ self:T( { event } )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
1105
Moose/Spawn.lua
1105
Moose/Spawn.lua
File diff suppressed because it is too large
Load Diff
@ -226,7 +226,7 @@ self:T()
|
|||||||
local RouteMessage = "Fly to "
|
local RouteMessage = "Fly to "
|
||||||
self:T( Task.LandingZones )
|
self:T( Task.LandingZones )
|
||||||
for LandingZoneID, LandingZoneName in pairs( Task.LandingZones.LandingZoneNames ) do
|
for LandingZoneID, LandingZoneName in pairs( Task.LandingZones.LandingZoneNames ) do
|
||||||
RouteMessage = RouteMessage .. LandingZoneName .. ' at ' .. routines.getBRStringZone( { zone = LandingZoneName, ref = Client:GetClientGroupUnit():getPoint(), true, true } ) .. ' km. '
|
RouteMessage = RouteMessage .. LandingZoneName .. ' at ' .. routines.getBRStringZone( { zone = LandingZoneName, ref = Client:GetClientGroupDCSUnit():getPoint(), true, true } ) .. ' km. '
|
||||||
end
|
end
|
||||||
Client:Message( RouteMessage, self.MSG.TIME, Mission.Name .. "/StageRoute", "Co-Pilot: Route", 20 )
|
Client:Message( RouteMessage, self.MSG.TIME, Mission.Name .. "/StageRoute", "Co-Pilot: Route", 20 )
|
||||||
|
|
||||||
@ -243,7 +243,7 @@ self:T()
|
|||||||
|
|
||||||
-- check if the Client is in the landing zone
|
-- check if the Client is in the landing zone
|
||||||
self:T( Task.LandingZones.LandingZoneNames )
|
self:T( Task.LandingZones.LandingZoneNames )
|
||||||
Task.CurrentLandingZoneName = routines.IsUnitInZones( Client:GetClientGroupUnit(), Task.LandingZones.LandingZoneNames )
|
Task.CurrentLandingZoneName = routines.IsUnitInZones( Client:GetClientGroupDCSUnit(), Task.LandingZones.LandingZoneNames )
|
||||||
|
|
||||||
if Task.CurrentLandingZoneName then
|
if Task.CurrentLandingZoneName then
|
||||||
|
|
||||||
@ -284,11 +284,13 @@ self:T()
|
|||||||
Client:Message( "We have arrived at the landing zone.", self.MSG.TIME, Mission.Name .. "/StageArrived", "Co-Pilot: Arrived", 10 )
|
Client:Message( "We have arrived at the landing zone.", self.MSG.TIME, Mission.Name .. "/StageArrived", "Co-Pilot: Arrived", 10 )
|
||||||
|
|
||||||
Task.HostUnit = Task.CurrentCargoZone:GetHostUnit()
|
Task.HostUnit = Task.CurrentCargoZone:GetHostUnit()
|
||||||
|
|
||||||
|
self:T( { Task.HostUnit } )
|
||||||
|
|
||||||
if Task.HostUnit then
|
if Task.HostUnit then
|
||||||
|
|
||||||
Task.HostUnitName = Task.HostUnit:getName()
|
Task.HostUnitName = Task.HostUnit:GetPrefix()
|
||||||
Task.HostUnitTypeName = Task.HostUnit:getTypeName()
|
Task.HostUnitTypeName = Task.HostUnit:GetTypeName()
|
||||||
|
|
||||||
local HostMessage = ""
|
local HostMessage = ""
|
||||||
Task.CargoNames = ""
|
Task.CargoNames = ""
|
||||||
@ -331,7 +333,7 @@ end
|
|||||||
function STAGELANDING:Validate( Mission, Client, Task )
|
function STAGELANDING:Validate( Mission, Client, Task )
|
||||||
self:T()
|
self:T()
|
||||||
|
|
||||||
Task.CurrentLandingZoneName = routines.IsUnitInZones( Client:GetClientGroupUnit(), Task.LandingZones.LandingZoneNames )
|
Task.CurrentLandingZoneName = routines.IsUnitInZones( Client:GetClientGroupDCSUnit(), Task.LandingZones.LandingZoneNames )
|
||||||
if Task.CurrentLandingZoneName then
|
if Task.CurrentLandingZoneName then
|
||||||
|
|
||||||
-- Client is in de landing zone.
|
-- Client is in de landing zone.
|
||||||
@ -357,7 +359,7 @@ self:T()
|
|||||||
return -1
|
return -1
|
||||||
end
|
end
|
||||||
|
|
||||||
if Task.IsLandingRequired and Client:GetClientGroupUnit():inAir() then
|
if Task.IsLandingRequired and Client:GetClientGroupDCSUnit():inAir() then
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -397,14 +399,14 @@ end
|
|||||||
function STAGELANDED:Validate( Mission, Client, Task )
|
function STAGELANDED:Validate( Mission, Client, Task )
|
||||||
self:T()
|
self:T()
|
||||||
|
|
||||||
if not routines.IsUnitInZones( Client:GetClientGroupUnit(), Task.CurrentLandingZoneName ) then
|
if not routines.IsUnitInZones( Client:GetClientGroupDCSUnit(), Task.CurrentLandingZoneName ) then
|
||||||
self:T( "Client is not anymore in the landing zone, go back to stage Route, and remove cargo menus." )
|
self:T( "Client is not anymore in the landing zone, go back to stage Route, and remove cargo menus." )
|
||||||
Task.Signalled = false
|
Task.Signalled = false
|
||||||
Task:RemoveCargoMenus( Client )
|
Task:RemoveCargoMenus( Client )
|
||||||
return -2
|
return -2
|
||||||
end
|
end
|
||||||
|
|
||||||
if Task.IsLandingRequired and Client:GetClientGroupUnit():inAir() then
|
if Task.IsLandingRequired and Client:GetClientGroupDCSUnit():inAir() then
|
||||||
self:T( "Client went back in the air. Go back to stage Landing." )
|
self:T( "Client went back in the air. Go back to stage Landing." )
|
||||||
Task.Signalled = false
|
Task.Signalled = false
|
||||||
return -1
|
return -1
|
||||||
@ -464,7 +466,7 @@ function STAGEUNLOAD:Validate( Mission, Client, Task )
|
|||||||
self:T()
|
self:T()
|
||||||
env.info( 'STAGEUNLOAD:Validate()' )
|
env.info( 'STAGEUNLOAD:Validate()' )
|
||||||
|
|
||||||
if routines.IsUnitInZones( Client:GetClientGroupUnit(), Task.CurrentLandingZoneName ) then
|
if routines.IsUnitInZones( Client:GetClientGroupDCSUnit(), Task.CurrentLandingZoneName ) then
|
||||||
else
|
else
|
||||||
Task.ExecuteStage = _TransportExecuteStage.FAILED
|
Task.ExecuteStage = _TransportExecuteStage.FAILED
|
||||||
Task:RemoveCargoMenus( Client )
|
Task:RemoveCargoMenus( Client )
|
||||||
@ -473,7 +475,7 @@ self:T()
|
|||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
if not Client:GetClientGroupUnit():inAir() then
|
if not Client:GetClientGroupDCSUnit():inAir() then
|
||||||
else
|
else
|
||||||
Task.ExecuteStage = _TransportExecuteStage.FAILED
|
Task.ExecuteStage = _TransportExecuteStage.FAILED
|
||||||
Task:RemoveCargoMenus( Client )
|
Task:RemoveCargoMenus( Client )
|
||||||
@ -578,7 +580,7 @@ self:T()
|
|||||||
self:T( "Task.CurrentLandingZoneName = " .. Task.CurrentLandingZoneName )
|
self:T( "Task.CurrentLandingZoneName = " .. Task.CurrentLandingZoneName )
|
||||||
|
|
||||||
if not Task.IsSlingLoad then
|
if not Task.IsSlingLoad then
|
||||||
if not routines.IsUnitInZones( Client:GetClientGroupUnit(), Task.CurrentLandingZoneName ) then
|
if not routines.IsUnitInZones( Client:GetClientGroupDCSUnit(), Task.CurrentLandingZoneName ) then
|
||||||
Task:RemoveCargoMenus( Client )
|
Task:RemoveCargoMenus( Client )
|
||||||
Task.ExecuteStage = _TransportExecuteStage.FAILED
|
Task.ExecuteStage = _TransportExecuteStage.FAILED
|
||||||
Task.CargoName = nil
|
Task.CargoName = nil
|
||||||
@ -587,7 +589,7 @@ self:T()
|
|||||||
return -1
|
return -1
|
||||||
end
|
end
|
||||||
|
|
||||||
if not Client:GetClientGroupUnit():inAir() then
|
if not Client:GetClientGroupDCSUnit():inAir() then
|
||||||
else
|
else
|
||||||
-- The carrier is back in the air, undo the loading process.
|
-- The carrier is back in the air, undo the loading process.
|
||||||
Task:RemoveCargoMenus( Client )
|
Task:RemoveCargoMenus( Client )
|
||||||
@ -673,7 +675,7 @@ self:T()
|
|||||||
function STAGEARRIVE:Validate( Mission, Client, Task )
|
function STAGEARRIVE:Validate( Mission, Client, Task )
|
||||||
self:T()
|
self:T()
|
||||||
|
|
||||||
Task.CurrentLandingZoneID = routines.IsUnitInZones( Client:GetClientGroupUnit(), Task.LandingZones )
|
Task.CurrentLandingZoneID = routines.IsUnitInZones( Client:GetClientGroupDCSUnit(), Task.LandingZones )
|
||||||
if ( Task.CurrentLandingZoneID ) then
|
if ( Task.CurrentLandingZoneID ) then
|
||||||
else
|
else
|
||||||
return -1
|
return -1
|
||||||
|
|||||||
@ -12,27 +12,71 @@ UNIT = {
|
|||||||
ClassName="UNIT",
|
ClassName="UNIT",
|
||||||
}
|
}
|
||||||
|
|
||||||
function UNIT:New( _Unit )
|
function UNIT:New( DCSUnit )
|
||||||
local self = BASE:Inherit( self, BASE:New() )
|
local self = BASE:Inherit( self, BASE:New() )
|
||||||
self:T( _Unit:getName() )
|
self:T( DCSUnit:getName() )
|
||||||
|
|
||||||
self._Unit = _Unit
|
self.DCSUnit = DCSUnit
|
||||||
self.UnitName = _Unit:getName()
|
self.UnitName = DCSUnit:getName()
|
||||||
self.UnitID = _Unit:getID()
|
self.UnitID = DCSUnit:getID()
|
||||||
|
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function UNIT:IsAlive()
|
||||||
|
self:T( self.UnitName )
|
||||||
|
|
||||||
|
return ( self.DCSUnit and self.DCSUnit:isExist() )
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function UNIT:GetName()
|
||||||
|
self:T( self.UnitName )
|
||||||
|
|
||||||
|
return self.UnitName
|
||||||
|
end
|
||||||
|
|
||||||
|
function UNIT:GetTypeName()
|
||||||
|
self:T( self.UnitName )
|
||||||
|
|
||||||
|
return self.DCSUnit:getTypeName()
|
||||||
|
end
|
||||||
|
|
||||||
|
function UNIT:GetPrefix()
|
||||||
|
self:T( self.UnitName )
|
||||||
|
|
||||||
|
local UnitPrefix = string.match( self.UnitName, ".*#" ):sub( 1, -2 )
|
||||||
|
self:T( UnitPrefix )
|
||||||
|
|
||||||
|
return UnitPrefix
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function UNIT:GetCallSign()
|
function UNIT:GetCallSign()
|
||||||
self:T( self.UnitName )
|
self:T( self.UnitName )
|
||||||
|
|
||||||
return self._Unit:getCallsign()
|
return self.DCSUnit:getCallsign()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function UNIT:GetPoint()
|
||||||
|
self:T( self.UnitName )
|
||||||
|
|
||||||
|
local UnitPos = self.DCSUnit:getPosition().p
|
||||||
|
|
||||||
|
local UnitPoint = {}
|
||||||
|
UnitPoint.x = UnitPos.x
|
||||||
|
UnitPoint.y = UnitPos.z
|
||||||
|
|
||||||
|
self:T( UnitPoint )
|
||||||
|
return UnitPoint
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function UNIT:GetPositionVec3()
|
function UNIT:GetPositionVec3()
|
||||||
self:T( self.UnitName )
|
self:T( self.UnitName )
|
||||||
|
|
||||||
local UnitPos = self._Unit:getPosition().p
|
local UnitPos = self.DCSUnit:getPosition().p
|
||||||
|
|
||||||
self:T( UnitPos )
|
self:T( UnitPos )
|
||||||
return UnitPos
|
return UnitPos
|
||||||
|
|||||||
@ -30,6 +30,17 @@ trace.f( self.ClassName, ZoneName )
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function ZONE:GetPoint()
|
||||||
|
self:T( self.ZoneName )
|
||||||
|
|
||||||
|
local Zone = trigger.misc.getZone( self.ZoneName )
|
||||||
|
local Point = { x = Zone.point.x, y = Zone.point.z }
|
||||||
|
|
||||||
|
self:T( { Zone, Point } )
|
||||||
|
|
||||||
|
return Point
|
||||||
|
end
|
||||||
|
|
||||||
function ZONE:GetRandomPoint()
|
function ZONE:GetRandomPoint()
|
||||||
trace.f( self.ClassName, self.ZoneName )
|
trace.f( self.ClassName, self.ZoneName )
|
||||||
|
|
||||||
@ -55,3 +66,4 @@ trace.f( self.ClassName, self.ZoneName )
|
|||||||
|
|
||||||
return Zone.radius
|
return Zone.radius
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -62,14 +62,13 @@ end
|
|||||||
do
|
do
|
||||||
local Mission = MISSION:New( 'Deliver secret letter', 'Operational', 'Pickup letter to the commander.', 'NATO' )
|
local Mission = MISSION:New( 'Deliver secret letter', 'Operational', 'Pickup letter to the commander.', 'NATO' )
|
||||||
|
|
||||||
Mission:AddClient( CLIENT:New( 'BE Package Test 1' ):Transport() )
|
Client_Package_1 = CLIENT:New( 'BE Package Test 1' ):Transport()
|
||||||
Mission:AddClient( CLIENT:New( 'BE Package Test 2' ):Transport() )
|
|
||||||
Mission:AddClient( CLIENT:New( 'DE Pickup Test 1' ):Transport() )
|
Mission:AddClient( Client_Package_1 )
|
||||||
Mission:AddClient( CLIENT:New( 'DE Pickup Test 2' ):Transport() )
|
|
||||||
|
|
||||||
Package_Pickup_Zone = CARGO_ZONE:New( 'Package Pickup Zone', 'DE Guard' ):GreenSmoke()
|
Package_Pickup_Zone = CARGO_ZONE:New( 'Package Pickup Zone', 'DE Guard' ):GreenSmoke()
|
||||||
|
|
||||||
Cargo_Package = CARGO_PACKAGE:New( 'Letter', 'Letter to Command', 0.1, 'DE Guard' )
|
Cargo_Package = CARGO_PACKAGE:New( 'Letter', 'Letter to Command', 0.1, Client_Package_1 )
|
||||||
--Cargo_Goods = CARGO_STATIC:New( 'Goods', 20, 'Goods', 'Pickup Zone Goods', 'DE Collection Point' )
|
--Cargo_Goods = CARGO_STATIC:New( 'Goods', 20, 'Goods', 'Pickup Zone Goods', 'DE Collection Point' )
|
||||||
--Cargo_SlingLoad = CARGO_SLING:New( 'Basket', 40, 'Basket', 'Pickup Zone Sling Load', 'DE Cargo Guard' )
|
--Cargo_SlingLoad = CARGO_SLING:New( 'Basket', 40, 'Basket', 'Pickup Zone Sling Load', 'DE Cargo Guard' )
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@ -1,15 +1,81 @@
|
|||||||
Include.File( "Spawn" )
|
Include.File( "Spawn" )
|
||||||
|
|
||||||
SpawnTest = SPAWN:New( 'TEST' ):Schedule( 1, 1, 15, 0.4 ):Repeat()
|
|
||||||
|
|
||||||
SpawnTestPlane = SPAWN:New( 'TESTPLANE' ):Schedule( 1, 1, 15, 0.4 ):RepeatOnLanding()
|
-- Tests Batumi
|
||||||
|
---------------
|
||||||
|
Spawn_Plane_Scheduled = SPAWN:New( "Spawn Plane Scheduled" ):SpawnScheduled( 30, 0.4 )
|
||||||
|
Spawn_Helicopter_Scheduledd = SPAWN:New( "Spawn Helicopter Scheduled" ):SpawnScheduled( 30, 1 )
|
||||||
|
Spawn_Ship_Scheduled = SPAWN:New( "Spawn Ship Scheduled" ):SpawnScheduled( 30, 0.5 )
|
||||||
|
Spawn_Vehicle_Scheduled = SPAWN:New( "Spawn Vehicle Scheduled" ):SpawnScheduled( 30, 0.5 )
|
||||||
|
|
||||||
SpawnTestShipPlane = SPAWN:New( 'SHIPPLANE' ):Schedule( 1, 1, 15, 0.4 ):RepeatOnLanding()
|
-- Tests Tbilisi
|
||||||
|
----------------
|
||||||
SpawnTestShipHeli = SPAWN:New( 'SHIPHELI' ):Schedule( 1, 1, 15, 0.4 ):RepeatOnLanding()
|
Spawn_Plane_Limited_Repeat = SPAWN:New( "Spawn Plane Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
|
||||||
|
Spawn_Plane_Limited_RepeatOnLanding = SPAWN:New( "Spawn Plane Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
|
||||||
SpawnCH53E = SPAWN:New( 'VEHICLE' )
|
Spawn_Plane_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Plane Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
|
||||||
|
Spawn_Helicopter_Limited_Repeat = SPAWN:New( "Spawn Helicopter Limited Repeat" ):Limit( 1, 1 ):Repeat():Spawn()
|
||||||
|
Spawn_Helicopter_Limited_RepeatOnLanding = SPAWN:New( "Spawn Helicopter Limited RepeatOnLanding" ):Limit( 1, 1 ):Repeat():Spawn()
|
||||||
|
Spawn_Helicopter_Limited_RepeatOnEngineShutDown = SPAWN:New( "Spawn Helicopter Limited RepeatOnEngineShutDown" ):Limit( 1, 1 ):Repeat():Spawn()
|
||||||
|
|
||||||
|
|
||||||
SpawnTestHelicopterCleanUp = SPAWN:New( "TEST_HELI_CLEANUP" ):Limit( 3, 100 ):Schedule( 10, 0 ):RandomizeRoute( 1, 1, 1000 ):CleanUp( 180 )
|
-- Tests Soganlug
|
||||||
SpawnTestVehiclesCleanUp = SPAWN:New( "TEST_AAA_CLEANUP" ):Limit( 3, 100 ):Schedule( 10, 0 ):RandomizeRoute( 1, 1, 1000 )
|
Spawn_Plane_Limited_Scheduled = SPAWN:New( "Spawn Plane Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
|
||||||
|
Spawn_Helicopter_Limited_Scheduled = SPAWN:New( "Spawn Helicopter Limited Scheduled" ):Limit( 2, 10 ):SpawnScheduled( 30, 0 )
|
||||||
|
Spawn_Ground_Limited_Scheduled = SPAWN:New( "Spawn Vehicle Limited Scheduled" ):Limit( 1, 20 ):SpawnScheduled( 90, 0 )
|
||||||
|
|
||||||
|
-- Tests Sukhumi
|
||||||
|
Spawn_Plane_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Plane Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
|
||||||
|
Spawn_Helicopter_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Helicopter Limited Scheduled RandomizeRoute" ):Limit( 2, 10 ):RandomizeRoute( 1, 1, 4000 ):SpawnScheduled( 30, 0 )
|
||||||
|
Spawn_Vehicle_Limited_Scheduled_RandomizeRoute = SPAWN:New( "Spawn Vehicle Limited Scheduled RandomizeRoute" ):Limit( 10, 10 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 1, 0 )
|
||||||
|
|
||||||
|
|
||||||
|
-- Tests Kutaisi
|
||||||
|
----------------
|
||||||
|
-- Spawn Helicopters and Ground attack.
|
||||||
|
-- Observe when helicopters land but are not dead and are out of the danger zone, that they get removed after a while (+/- 180 seconds) and ReSpawn.
|
||||||
|
Spawn_Helicopter_Scheduled_CleanUp = SPAWN:New( "Spawn Helicopter Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):CleanUp( 180 ):SpawnScheduled( 10, 0 )
|
||||||
|
Spawn_Vehicle_Scheduled_CleanUp = SPAWN:New( "Spawn Vehicle Scheduled CleanUp" ):Limit( 3, 100 ):RandomizeRoute( 1, 1, 1000 ):SpawnScheduled( 10, 0 )
|
||||||
|
|
||||||
|
-- Test Matrix Visible Setup
|
||||||
|
|
||||||
|
SpawnTestVisible = SPAWN:New( "Spawn Vehicle Visible Scheduled" ):Limit( 200, 200 ):SpawnArray( 59, 20, 20, 10 ):SpawnScheduled( 10, 0.2 )
|
||||||
|
|
||||||
|
Spawn_Templates_1 = { "Spawn Vehicle Visible Template A",
|
||||||
|
"Spawn Vehicle Visible Template B",
|
||||||
|
"Spawn Vehicle Visible Template C",
|
||||||
|
"Spawn Vehicle Visible Template D",
|
||||||
|
"Spawn Vehicle Visible Template E",
|
||||||
|
"Spawn Vehicle Visible Template F",
|
||||||
|
"Spawn Vehicle Visible Template G",
|
||||||
|
"Spawn Vehicle Visible Template H",
|
||||||
|
"Spawn Vehicle Visible Template I",
|
||||||
|
"Spawn Vehicle Visible Template J"
|
||||||
|
}
|
||||||
|
|
||||||
|
Spawn_Vehicle_Visible_RandomizeTemplate_Scheduled_1 = SPAWN:New( "Spawn Vehicle Visible RandomizeTemplate Scheduled" )
|
||||||
|
:Limit( 40, 40 )
|
||||||
|
:RandomizeTemplate( Spawn_Templates_1 )
|
||||||
|
:SpawnArray( 49, 20, 8, 8 )
|
||||||
|
:SpawnScheduled( 10, 0.2 )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- Tests Maykop
|
||||||
|
Spawn_Infantry = SPAWN:New( "Spawn Infantry" )
|
||||||
|
:Limit( 10, 10 )
|
||||||
|
|
||||||
|
|
||||||
|
Spawn_Vehicle_Host = SPAWN:New( "Spawn Vehicle Host" )
|
||||||
|
:Limit( 10, 10 )
|
||||||
|
:SpawnArray( 0, 5, 8, 8 )
|
||||||
|
:SpawnScheduled( 10, 0.2 )
|
||||||
|
|
||||||
|
|
||||||
|
Spawn_Vehicle_SpawnToZone = SPAWN:New( "Spawn Vehicle SpawnToZone" )
|
||||||
|
:Limit( 10, 10 )
|
||||||
|
|
||||||
|
Spawn_Helicopter_SpawnToZone = SPAWN:New( "Spawn Helicopter SpawnToZone" )
|
||||||
|
:Limit( 10, 10 )
|
||||||
|
:SpawnScheduled( 60, 0.2 )
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user