From 81f8e84ca4f77e1a94a564f2dd4ca3f3062840db Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Thu, 29 Aug 2024 10:22:14 +0200 Subject: [PATCH 1/2] xx --- Moose Development/Moose/Ops/CTLD.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Moose Development/Moose/Ops/CTLD.lua b/Moose Development/Moose/Ops/CTLD.lua index 9a8669efa..666503509 100644 --- a/Moose Development/Moose/Ops/CTLD.lua +++ b/Moose Development/Moose/Ops/CTLD.lua @@ -1331,7 +1331,7 @@ CTLD.UnitTypeCapabilities = { --- CTLD class version. -- @field #string version -CTLD.version="1.1.16" +CTLD.version="1.1.17" --- Instantiate a new CTLD. -- @param #CTLD self @@ -2760,8 +2760,9 @@ end -- @param Core.Zone#ZONE Zone Zone to spawn in. -- @param #CTLD_CARGO Cargo The cargo type to spawn. -- @param #boolean RandomCoord Randomize coordinate. +-- @param #boolean FromLoad Create only **one** crate per cargo type, as we are re-creating dropped crates that CTLD has saved prior. -- @return #CTLD self -function CTLD:InjectStatics(Zone, Cargo, RandomCoord) +function CTLD:InjectStatics(Zone, Cargo, RandomCoord, FromLoad) self:T(self.lid .. " InjectStatics") local cratecoord = Zone:GetCoordinate() if RandomCoord then @@ -2779,6 +2780,7 @@ function CTLD:InjectStatics(Zone, Cargo, RandomCoord) local cgotype = cargotype:GetType() local cgomass = cargotype:GetMass() local cratenumber = cargotype:GetCratesNeeded() or 1 + if FromLoad == true then cratenumber=1 end for i=1,cratenumber do local cratealias = string.format("%s-%s-%d", cratename, cratetemplate, math.random(1,100000)) local isstatic = false @@ -2822,7 +2824,7 @@ end function CTLD:InjectStaticFromTemplate(Zone, Template, Mass) self:T(self.lid .. " InjectStaticFromTemplate") local cargotype = self:GetStaticsCargoFromTemplate(Template,Mass) -- #CTLD_CARGO - self:InjectStatics(Zone,cargotype,true) + self:InjectStatics(Zone,cargotype,true,true) return self end @@ -6326,7 +6328,7 @@ end injectstatic:SetStaticResourceMap(map) end if injectstatic then - self:InjectStatics(dropzone,injectstatic) + self:InjectStatics(dropzone,injectstatic,false,true) end end end @@ -6654,7 +6656,7 @@ function CTLD_HERCULES:Cargo_SpawnStatic(Cargo_Drop_initiator,Cargo_Drop_Positio local Zone = ZONE_RADIUS:New("Cargo Static " .. math.random(1,10000),position,100) if not dead then local injectstatic = CTLD_CARGO:New(nil,"Cargo Static Group "..math.random(1,10000),"iso_container",CTLD_CARGO.Enum.STATIC,true,false,1,nil,true,4500,1) - self.CTLD:InjectStatics(Zone,injectstatic,true) + self.CTLD:InjectStatics(Zone,injectstatic,true,true) end return self end From f531fdaa7055bd56bd3afb8a03857833d7c3122b Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Thu, 29 Aug 2024 10:25:13 +0200 Subject: [PATCH 2/2] #RANGE less noise --- Moose Development/Moose/Functional/Range.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Moose Development/Moose/Functional/Range.lua b/Moose Development/Moose/Functional/Range.lua index 2a4fb2611..d613325bf 100644 --- a/Moose Development/Moose/Functional/Range.lua +++ b/Moose Development/Moose/Functional/Range.lua @@ -1340,7 +1340,7 @@ end -- @return #RANGE self function RANGE:SetSoundfilesPath( path ) self.soundpath = tostring( path or "Range Soundfiles/" ) - self:I( self.lid .. string.format( "Setting sound files path to %s", self.soundpath ) ) + self:T2( self.lid .. string.format( "Setting sound files path to %s", self.soundpath ) ) return self end @@ -1636,9 +1636,9 @@ function RANGE:AddBombingTargetUnit( unit, goodhitrange, randommove ) -- Debug or error output. if _isstatic == true then - self:I( self.lid .. string.format( "Adding STATIC bombing target %s with good hit range %d. Random move = %s.", name, goodhitrange, tostring( randommove ) ) ) + self:T( self.lid .. string.format( "Adding STATIC bombing target %s with good hit range %d. Random move = %s.", name, goodhitrange, tostring( randommove ) ) ) elseif _isstatic == false then - self:I( self.lid .. string.format( "Adding UNIT bombing target %s with good hit range %d. Random move = %s.", name, goodhitrange, tostring( randommove ) ) ) + self:T( self.lid .. string.format( "Adding UNIT bombing target %s with good hit range %d. Random move = %s.", name, goodhitrange, tostring( randommove ) ) ) else self:E( self.lid .. string.format( "ERROR! No bombing target with name %s could be found. Carefully check all UNIT and STATIC names defined in the mission editor!", name ) ) end @@ -1706,7 +1706,7 @@ function RANGE:AddBombingTargetScenery( scenery, goodhitrange) -- Debug or error output. if name then - self:I( self.lid .. string.format( "Adding SCENERY bombing target %s with good hit range %d", name, goodhitrange) ) + self:T( self.lid .. string.format( "Adding SCENERY bombing target %s with good hit range %d", name, goodhitrange) ) else self:E( self.lid .. string.format( "ERROR! No bombing target with name %s could be found!", name ) ) end @@ -2196,7 +2196,7 @@ function RANGE:onafterStatus( From, Event, To ) end -- Check range status. - self:I( self.lid .. text ) + self:T( self.lid .. text ) end @@ -2397,7 +2397,7 @@ function RANGE:onafterSave( From, Event, To ) if f then f:write( data ) f:close() - self:I( self.lid .. string.format( "Saving player results to file %s", tostring( filename ) ) ) + self:T( self.lid .. string.format( "Saving player results to file %s", tostring( filename ) ) ) else self:E( self.lid .. string.format( "ERROR: Could not save results to file %s", tostring( filename ) ) ) end @@ -2476,7 +2476,7 @@ function RANGE:onafterLoad( From, Event, To ) -- Info message. local text = string.format( "Loading player bomb results from file %s", filename ) - self:I( self.lid .. text ) + self:T( self.lid .. text ) -- Load asset data from file. local data = _loadfile( filename ) @@ -2849,7 +2849,7 @@ function RANGE:_DisplayRangeInfo( _unitname ) -- Check if we have a player. if unit and playername then - self:I(playername) + --self:I(playername) -- Message text. local text = "" @@ -4104,7 +4104,7 @@ end -- @return #string Name of the player. -- @return #boolean If true, group has > 1 player in it function RANGE:_GetPlayerUnitAndName( _unitName, PlayerName ) - self:I( _unitName ) + --self:I( _unitName ) if _unitName ~= nil then