FAForever Forums
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Login
    The current pre-release of the client ("pioneer" in the version) is only compatible to itself. So you can only play with other testers. Please be aware!

    Need a second set of eyes as I'm having a issue resolving a trashbag

    Scheduled Pinned Locked Moved Modding & Tools
    2 Posts 1 Posters 161 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R Offline
      Resin_Smoker
      last edited by Resin_Smoker

      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

      Kykhu Oss https://youtu.be/JUgyGTgeZb8
      Unit Thrower https://youtu.be/iV8YBXVxxeI
      Beam Tentacle https://youtu.be/le5SNwHvC4c
      Blackhole https://www.youtube.com/watch?v=D9NGQC5rr0c
      Resurection https://www.youtube.com/watch?v=WdbIQ4vHkMs

      1 Reply Last reply Reply Quote 1
      • R Offline
        Resin_Smoker
        last edited by

        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.

        Kykhu Oss https://youtu.be/JUgyGTgeZb8
        Unit Thrower https://youtu.be/iV8YBXVxxeI
        Beam Tentacle https://youtu.be/le5SNwHvC4c
        Blackhole https://www.youtube.com/watch?v=D9NGQC5rr0c
        Resurection https://www.youtube.com/watch?v=WdbIQ4vHkMs

        1 Reply Last reply Reply Quote 3
        • First post
          Last post