Data Realms Fan Forums
http://forums.datarealms.com/

Exceptions for dying actors
http://forums.datarealms.com/viewtopic.php?f=73&t=31291
Page 1 of 1

Author:  Asklar [ Thu Jun 21, 2012 12:35 am ]
Post subject:  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?

Author:  TheLastBanana [ Thu Jun 21, 2012 1:03 am ]
Post subject:  Re: Exceptions for dying actors

Check that the actor's ID isn't 255 -- you can always access that.

Author:  Asklar [ Thu Jun 21, 2012 2:07 am ]
Post subject:  Re: Exceptions for dying actors

Ah, I forgot that.

Many much thanks, Master.

Author:  Bad Boy [ Thu Jun 21, 2012 4:20 am ]
Post subject:  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?

Author:  TheLastBanana [ Thu Jun 21, 2012 4:58 am ]
Post subject:  Re: Exceptions for dying actors

Yeah, that also works -- probably better in this case, admittedly. Checking the ID works better for generic objects.

Author:  Bad Boy [ Thu Jun 21, 2012 5:39 am ]
Post subject:  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.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/