View unanswered posts | View active topics It is currently Thu Mar 28, 2024 10:31 pm



Reply to topic  [ 6 posts ] 
 Exceptions for dying actors 
Author Message
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 Exceptions for dying actors
I couldn't redact a better title.


So, I'm making a particle which changes it's position to an actor's one. Now, if the actor dies, the game crashes.
Obviously, I made the particle delete itself if actor.Health < 1.

But, that doesn't work if the actor is gibbed.

Is there any function to check that? Or any way?


Thu Jun 21, 2012 12:35 am
Profile
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3138
Location: A little south and a lot west of Moscow
Reply with quote
Post Re: Exceptions for dying actors
Check that the actor's ID isn't 255 -- you can always access that.


Thu Jun 21, 2012 1:03 am
Profile WWW
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: Exceptions for dying actors
Ah, I forgot that.

Many much thanks, Master.


Thu Jun 21, 2012 2:07 am
Profile

Joined: Fri Sep 10, 2010 1:48 am
Posts: 666
Location: Halifax, Canada
Reply with quote
Post Re: Exceptions for dying actors
Correct me if I'm wrong but couldn't you just add an 'if MovableMan:IsActor(actor) then' check before referencing the actor?


Thu Jun 21, 2012 4:20 am
Profile
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3138
Location: A little south and a lot west of Moscow
Reply with quote
Post Re: Exceptions for dying actors
Yeah, that also works -- probably better in this case, admittedly. Checking the ID works better for generic objects.


Thu Jun 21, 2012 4:58 am
Profile WWW

Joined: Fri Sep 10, 2010 1:48 am
Posts: 666
Location: Halifax, Canada
Reply with quote
Post Re: Exceptions for dying actors
Yeah, of course, since you don't have to figure out which class they fit in, I was wondering why you chose that instead. Also I'd imagine it's great for attachables (or at least a similar method is for getting pointers to them) since they don't seem to fit in any class; it took me irritatingly long to figure it out the other day.
But then again, attachables are generally kind of screwy, for example, PresetMan:ReloadAllScripts() doesn't affect them but self:ReloadScripts() does you can't stick pie buttons on them as far as I can tell, though that may be deliberate.


Thu Jun 21, 2012 5:39 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 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.067s | 15 Queries | GZIP : Off ]