Need a second set of eyes as I'm having a issue resolving a trashbag
-
during unit ura0106 OnKilled event i get a trashbag related error.
WARNING: Error running lua script: ...gramdata\faforever\gamedata\lua.nx2\lua\sim\unit.lua(5535): attempt to call method `Destroy' (a nil value) stack traceback: ...gramdata\faforever\gamedata\lua.nx2\lua\sim\unit.lua(5535): in function <...gramdata\faforever\gamedata\lua.nx2\lua\sim\unit.lua:5530> ...orever\gamedata\lua.nx2\lua\sim\units\mobileunit.lua(65): in function `DestroyAllTrashBags' ...gramdata\faforever\gamedata\lua.nx2\lua\sim\unit.lua(1921): in function <...gramdata\faforever\gamedata\lua.nx2\lua\sim\unit.lua:1914>
Which translates to this function within FAF unit.lua
DestroyAllTrashBags = function(self) oldUnit.DestroyAllTrashBags(self) self.MovementEffectsBag:Destroy() self.TopSpeedEffectsBag:Destroy() self.BeamExhaustEffectsBag:Destroy() self.IdleEffectsBag:Destroy() if self.TransportBeamEffectsBag then self.TransportBeamEffectsBag:Destroy() end if self.AmbientExhaustEffectsBag then for _, v in self.AmbientExhaustEffectsBag do v:Destroy() end end if self.EffectsBag then for _, v in self.EffectsBag do v:Destroy() end end if self.OmniEffectsBag then for k, v in self.OmniEffectsBag do v:Destroy() end end end,
ura0106 OnKilled event apparently is the trigger, though its not listed in the error log.
OnKilled = function(self, instigator, type, overkillRatio) ### Disables weapons self:SetWeaponEnabledByLabel('MainGun', false) ### Clears the current drone commands if any IssueClearCommands(self) ### Clears the offending drone from the parents table if not self.Parent:IsDead() then WARN('remove from parent') table.removeByValue(self.Parent.DroneTable, self) self.Parent = nil end ### Final command to finish off the fighters death event CAirUnit.OnKilled(self, instigator, type, overkillRatio) end,
Video of the unit and the resulting error:https://youtu.be/FK9i21f-H9w
Anyone see something that I'm missing?
Edit, full unit script...URA0106_script.zip
Resin
-
Figured it out...
Looks like something wasn't liking my use of BeamExhaustEffectsBag to store the emitters used for the afterburner effects. Dropping the Bag for locals, solved the issue completely.