Author |
Message |
TheSilentCrab
Joined: Sun Oct 31, 2010 5:23 pm Posts: 17
|
 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?
|
Thu Jan 19, 2012 1:58 pm |
|
 |
Asklar
Data Realms Elite
Joined: Fri Jan 07, 2011 8:01 am Posts: 6211 Location: In your office, earning your salary.
|
 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.
|
Thu Jan 19, 2012 5:03 pm |
|
 |
Azukki
Joined: Sat Nov 03, 2007 9:44 pm Posts: 1916 Location: Flint Hills
|
 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.
|
Sat Jan 21, 2012 10:26 am |
|
 |
TheSilentCrab
Joined: Sun Oct 31, 2010 5:23 pm Posts: 17
|
 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.
|
Sun Jan 22, 2012 8:12 pm |
|
 |
|