Page 1 of 1

actor *whose*

PostPosted: Mon May 12, 2008 7:03 pm
by Kalladdolf
having a question. (tell me if it was stupid)
for example I wanna destroy an actor WHOSE health is less than 1.
the thing is: the actor isn't supposed to destroy itself, something else does.
and it's gotta be a specific actor outta many clones.
so the code I would need would be something like:
Code: Select all
DestroyActor("Cloneactor");-->//whose health is less than one.

maybe I picked a wrecked example, it also should work with MoveTo, drawing lines to actors, but always the clones which you have picked before.
got it?
:?
:wink:
xD
PS: srry

Re: actor *whose*

PostPosted: Tue May 13, 2008 12:13 am
by makslane
If you know the clone index, try:

Code: Select all
char sActor[64];

sprintf(sActor, "Cloneactor.%d", cloneindex);
DestroyActor(sActor);

Re: actor *whose*

PostPosted: Fri May 16, 2008 1:09 pm
by Bee-Ant
Well, I have other idea... not really simple, but easy to understand for even newbie
1. make "checker" actor same size with your view
2. AnimationFinish>checker>Destroy Event actor
3. Enemy>Collision>checker
Code: Select all
if(health<1)
{
     DestroyActor("Event Actor");
}

4. Player>Keydown or something>Create Actor>checker>parrented with view>set the x and y position to be half of your x and y view size
5. checker>CreateActor>VisibilityState>Dont Draw Only