You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Additionally think there is an issue with spawned statics being registered in the database, since the last update.
Version not working:
2020-06-09 14:37:32.581 INFO SCRIPTING: *** MOOSE GITHUB Commit Hash ID: 2020-05-27T20:19:25.0000000Z-55760fcb42896f68fe0e6c58eaccbb40cf3e1fbf ***
Version working:
2020-06-09 14:36:37.538 INFO SCRIPTING: *** MOOSE GITHUB Commit Hash ID: 2020-05-20T21:04:36.0000000Z-9e4273f0667216536e5549f035b9660722deeffc ***
Additionally:
2020-06-09 14:36:44.421 INFO SCRIPTING: 13027( 29769)/I: DATABASE00003._RegisterStaticTemplate({[Coalition]=2,[Static]=Boron#001,[Country]=2,[Category]=4,})
No longer appears in the logs when spawning statics. Possibly not added to database
CODE:
zone = ZONE:FindByName( "z_test" )
vec2 = zone:GetVec2()
place = POINT_VEC2:NewFromVec2(vec2)
test1 = SPAWNSTATIC:NewFromStatic( "UH-1H cargo", country.id.USA )
static = test1:SpawnFromPointVec2(place, 1, ("Boron#001" ) )
s_name = static:GetName()
env.info(" Spawned NEW cargo at ".. zone:GetName() .." called " .. s_name )
On broken moose the error is
2020-06-09 14:37:41.878 ERROR DCS: Mission script error: : [string " local s_name = static:GetName()..."]:1: attempt to index global 'static' (a nil value)
stack traceback:
[C]: ?
[string " local s_name = static:GetName()..."]:1: in main chunk
The attached mission has the broken version, you can downgrade it to see working.
To reproduce, run the miz, observe the logs, either error or logging after a few seconds.
The text was updated successfully, but these errors were encountered:
function SPAWNSTATIC:SpawnFromPointVec2( PointVec2, Heading, NewName ) --R2.1
self:F( { PointVec2, Heading, NewName } )
local StaticTemplate, CoalitionID, CategoryID, CountryID = _DATABASE:GetStaticGroupTemplate( self.SpawnTemplatePrefix )
if StaticTemplate then
local StaticUnitTemplate = StaticTemplate.units[1]
StaticUnitTemplate.x = PointVec2.x
StaticUnitTemplate.y = PointVec2.z
StaticTemplate.route = nil
StaticTemplate.groupId = nil
StaticTemplate.name = NewName or string.format("%s#%05d", self.SpawnTemplatePrefix, self.SpawnIndex )
StaticUnitTemplate.name = StaticTemplate.name
StaticUnitTemplate.heading = ( Heading / 180 ) * math.pi
_DATABASE:_RegisterStaticTemplate( StaticTemplate, CoalitionID, CategoryID, CountryID)
self:F({StaticTemplate = StaticTemplate})
local Static = coalition.addStaticObject( self.CountryID or CountryID, StaticTemplate.units[1] )
self.SpawnIndex = self.SpawnIndex + 1
return _DATABASE:FindStatic(Static:getName())
end
return nil
end
NEW method:
function SPAWNSTATIC:SpawnFromPointVec2(PointVec2, Heading, NewName)
local vec2={x=PointVec2:GetX(), y=PointVec2:GetY()}
local Coordinate=COORDINATE:NewFromVec2(vec2)
return self:SpawnFromCoordinate(Coordinate, Heading, NewName)
end
Additionally think there is an issue with spawned statics being registered in the database, since the last update.
Version not working:
2020-06-09 14:37:32.581 INFO SCRIPTING: *** MOOSE GITHUB Commit Hash ID: 2020-05-27T20:19:25.0000000Z-55760fcb42896f68fe0e6c58eaccbb40cf3e1fbf ***
Version working:
2020-06-09 14:36:37.538 INFO SCRIPTING: *** MOOSE GITHUB Commit Hash ID: 2020-05-20T21:04:36.0000000Z-9e4273f0667216536e5549f035b9660722deeffc ***
Additionally:
2020-06-09 14:36:44.421 INFO SCRIPTING: 13027( 29769)/I: DATABASE00003._RegisterStaticTemplate({[Coalition]=2,[Static]=Boron#001,[Country]=2,[Category]=4,})
No longer appears in the logs when spawning statics. Possibly not added to database
CODE:
On broken moose the error is
The attached mission has the broken version, you can downgrade it to see working.
To reproduce, run the miz, observe the logs, either error or logging after a few seconds.
The text was updated successfully, but these errors were encountered: