Data Realms Fan Forums http://45.55.195.193/ |
|
Gibbing detection http://45.55.195.193/viewtopic.php?f=73&t=29602 |
Page 1 of 1 |
Author: | TheSilentCrab [ Thu Jan 19, 2012 1:58 pm ] |
Post subject: | Gibbing detection |
I'm working on an attachable that kills its parent after it itself is destroyed. I've tried using self:IsSetToDelete(), but it doesn't seem to work right. Is there a function to see either or not an attachable, or anything else, will be gibbed in the next tick? |
Author: | Asklar [ Thu Jan 19, 2012 5:03 pm ] |
Post subject: | Re: Gibbing detection |
I'm not sure if it will work, but you could try self.ToDelete == true. Or, alternatively, you could check through the actor if the attachable is still there which would be easier. The problem would be detecting the attachable, but you can find those codes around. |
Author: | Azukki [ Sat Jan 21, 2012 10:26 am ] |
Post subject: | Re: Gibbing detection |
Try the destroy function? function Destroy(self) if self.RootID ~= self.ID self.parent = ToActor( MovableMan:GetMOFromID(self.rootID) ) self.parent.Health = 0 end end This might work, unless the destroy function happens too late for the rootID to still properly be the parent. |
Author: | TheSilentCrab [ Sun Jan 22, 2012 8:12 pm ] |
Post subject: | Re: Gibbing detection |
Thanks a lot Azukki. I knew there was a function like that, but I forgot how it's called and I couldn't find it anywhere in the code. It works perfectly now. |
Page 1 of 1 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |