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.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login