FlightControl Posted April 25, 2016 Posted April 25, 2016 (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 April 25, 2016 by FlightControl [TABLE][sIGPIC][/sIGPIC]| Join MOOSE community on: DISCORD :thumbup: Website of the MOOSE LUA Framework. MOOSE framework Downloads. Check out Example Missions to try out and learn. MOOSE YouTube Channel for live demonstrations and tutorials. [/TABLE]
FlightControl Posted April 25, 2016 Posted April 25, 2016 Forgot to mention in the previous post. I got these crashes since the last update... [TABLE][sIGPIC][/sIGPIC]| Join MOOSE community on: DISCORD :thumbup: Website of the MOOSE LUA Framework. MOOSE framework Downloads. Check out Example Missions to try out and learn. MOOSE YouTube Channel for live demonstrations and tutorials. [/TABLE]
paura19 Posted April 25, 2016 Author Posted April 25, 2016 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 Discord MB2 1.Flight | =UVP= Czech school of TOP GUN | DCS at Airshow - Aviaticka Pout 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)
Recommended Posts