From 36666df76fb59802f2967d4657b9086b1af83c34 Mon Sep 17 00:00:00 2001 From: Frank Date: Sat, 14 Mar 2020 19:19:55 +0100 Subject: [PATCH] Temp --- Moose Development/Moose/Core/Database.lua | 4 +-- Moose Development/Moose/Core/Spawn.lua | 30 ++++++++++++++++++++++- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/Moose Development/Moose/Core/Database.lua b/Moose Development/Moose/Core/Database.lua index f691fb143..a882aae66 100644 --- a/Moose Development/Moose/Core/Database.lua +++ b/Moose Development/Moose/Core/Database.lua @@ -187,7 +187,7 @@ end function DATABASE:AddUnit( DCSUnitName ) if not self.UNITS[DCSUnitName] then - self:T( { "Add UNIT:", DCSUnitName } ) + self:I( { "Add UNIT:", DCSUnitName } ) local UnitRegister = UNIT:Register( DCSUnitName ) self.UNITS[DCSUnitName] = UNIT:Register( DCSUnitName ) @@ -512,7 +512,7 @@ end function DATABASE:AddGroup( GroupName ) if not self.GROUPS[GroupName] then - self:T( { "Add GROUP:", GroupName } ) + self:I( { "Add GROUP:", GroupName } ) self.GROUPS[GroupName] = GROUP:Register( GroupName ) end diff --git a/Moose Development/Moose/Core/Spawn.lua b/Moose Development/Moose/Core/Spawn.lua index 0776d3362..ed6720066 100644 --- a/Moose Development/Moose/Core/Spawn.lua +++ b/Moose Development/Moose/Core/Spawn.lua @@ -1246,13 +1246,18 @@ function SPAWN:SpawnWithIndex( SpawnIndex, NoBirth ) if self:_GetSpawnIndex( SpawnIndex ) then if self.SpawnGroups[self.SpawnIndex].Visible then + env.info("FF visible ==> activate") self.SpawnGroups[self.SpawnIndex].Group:Activate() else + + env.info("FF get template") local SpawnTemplate = self.SpawnGroups[self.SpawnIndex].SpawnTemplate self:T( SpawnTemplate.name ) if SpawnTemplate then + + env.info("FF found template") local PointVec3 = POINT_VEC3:New( SpawnTemplate.route.points[1].x, SpawnTemplate.route.points[1].alt, SpawnTemplate.route.points[1].y ) self:T( { "Current point of ", self.SpawnTemplatePrefix, PointVec3 } ) @@ -1423,6 +1428,14 @@ function SPAWN:SpawnWithIndex( SpawnIndex, NoBirth ) SpawnGroup:SetAIOnOff( self.AIOnOff ) end + + env.info("FF Returning spawn group") + if SpawnGroup then + + else + + end + self:T3( SpawnTemplate.name ) @@ -1435,12 +1448,16 @@ function SPAWN:SpawnWithIndex( SpawnIndex, NoBirth ) --if self.Repeat then -- _DATABASE:SetStatusGroup( SpawnTemplate.name, "ReSpawn" ) --end + + --else + -- self:E("ERROR: No spawn template.") end + self.SpawnGroups[self.SpawnIndex].Spawned = true return self.SpawnGroups[self.SpawnIndex].Group else - --self:E( { self.SpawnTemplatePrefix, "No more Groups to Spawn:", SpawnIndex, self.SpawnMaxGroups } ) + self:E( { self.SpawnTemplatePrefix, "No more Groups to Spawn:", SpawnIndex, self.SpawnMaxGroups } ) end return nil @@ -1941,8 +1958,19 @@ function SPAWN:SpawnAtAirbase( SpawnAirbase, Takeoff, TakeoffAltitude, TerminalT SpawnTemplate.uncontrolled = self.SpawnUnControlled + env.info("FF spawning group with index "..self.SpawnIndex) + -- Spawn group. local GroupSpawned = self:SpawnWithIndex( self.SpawnIndex ) + + if GroupSpawned then + env.info("ERROR: spawn group is there!") + GroupSpawned:SmokeRed() + local n=#GroupSpawned:GetUnits() + env.info("FF n="..tostring(n)) + else + env.info("ERROR: spawn group not there!") + end -- When spawned in the air, we need to generate a Takeoff Event. if Takeoff == GROUP.Takeoff.Air then