View unanswered posts | View active topics It is currently Thu Apr 25, 2024 12:28 am



Reply to topic  [ 4 posts ] 
 Gibbing detection 
Author Message
User avatar

Joined: Sun Oct 31, 2010 5:23 pm
Posts: 17
Reply with quote
Post 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
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post 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
Profile
User avatar

Joined: Sat Nov 03, 2007 9:44 pm
Posts: 1916
Location: Flint Hills
Reply with quote
Post 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
Profile
User avatar

Joined: Sun Oct 31, 2010 5:23 pm
Posts: 17
Reply with quote
Post 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
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.054s | 17 Queries | GZIP : Off ]