Jump to content

Recommended Posts

Posted (edited)

I got several crashes while testing my moose framework....

The crashes happened when i RESPAWNED a group using coalition.addGroup() method in lua. Mist calls this function also. I had to destroy the group first before respawning, and then all went well.

 

Are you calling somewhere addGroup() for Groups that are already existing in the sim and need to be respawned?

 

Hope it helps, just sharing some experience of mine.

 

The pieces in RED is what i added to avoid the crashes:

 

--- Will re-spawn a group based on a given index. 
-- Note: Uses @{DATABASE} module defined in MOOSE. 
-- @param #SPAWN self 
-- @param #string SpawnIndex The index of the group to be spawned. 
-- @return Group#GROUP The group that was spawned. You can use this group for further actions. 
function SPAWN:ReSpawn( SpawnIndex )
    self:F( { self.SpawnTemplatePrefix, SpawnIndex } )          
 if not SpawnIndex then         
   SpawnIndex = 1     
 end      [color=Red]
 local SpawnGroup = self:GetGroupFromIndex( SpawnIndex )
 if SpawnGroup then
   local SpawnDCSGroup = SpawnGroup:GetDCSGroup()
   if SpawnDCSGroup then
     SpawnGroup:Destroy() 
   end
 end
[/color]  return self:SpawnWithIndex( SpawnIndex )
end

 

I check if the group that i want to respawn already exists. And if it exists, i destroy the group before respawning...

 

Sven

Edited by FlightControl

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Posted
FlightControl: Are you calling somewhere addGroup() for Groups that are already existing in the sim and need to be respawned?

 

:thumbup::thumbup: Good point

I had mistake in script.

Thank you.

MB2 Czech DCS server. Youtube české Tutorialy youtube-logo.png
Discord MB2 1.Flight  | =UVP= Czech school of TOP GUN | DCS at Airshow - Aviaticka Pout

thumbnail_email.jpg
4K player | ASUS B760-F | i7 13700KF 5,4Ghz | MSI 4080 SUPRIME X | 64Gb G.Skill 6000MHz | 2TB M2.PCIe4 for DCS | Corsair RM1000e | (build 2023)

 

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...