Page 1 of 1

collide.ACT->HP = 0 <--not work.

PostPosted: Wed Feb 27, 2008 7:32 pm
by equinox
I am trying but I don't succeed in understanding.

Someone can help me,please?

actors = getAllActorsInCollision("Event Actor", &n);
if(actors){
for(i = 0; i < n; i++){
if(strcmp(actors[i].name, "PUNTO") == 0){// ZERO SE STRINGHE uguali
// PUNTO.HP = 0;// PUNTO is dead.
//ACT->HP = 0;// PUNTO is dead.
collide.ACT->HP = 0;// PUNTO is dead. <--- not work.
//DestroyActor(actors[i].clonename);

Re: collide.ACT->HP = 0 <--not work.

PostPosted: Wed Feb 27, 2008 7:44 pm
by Game A Gogo
what are you trying to do?

Re: collide.ACT->HP = 0 <--not work.

PostPosted: Thu Feb 28, 2008 9:21 am
by equinox
when (actor Hero) it collides with (PUNTO actor),

Hero removes 10 points from PUNTO.HP.

This in script to DRAW HERO. But I don't succeed.

You can help me,please?

Re: collide.ACT->HP = 0 <--not work.

PostPosted: Thu Feb 28, 2008 1:03 pm
by Game A Gogo
on collision event in Hero with Punto, do this script:
Code: Select all
Punto.HP-=10;

Re: collide.ACT->HP = 0 <--not work.

PostPosted: Thu Feb 28, 2008 6:01 pm
by equinox
Tnk fore reply...but yuor code not work.

Re: collide.ACT->HP = 0 <--not work.

PostPosted: Thu Feb 28, 2008 6:37 pm
by edh
Are you trying to remove HP from Punto until Punto is < 0 and then destroy Punto?

Are you looking for something like this?

Code: Select all
if ( actor in collision is Punto ) {
Punto.HP-=10;
if (Punto.HP <= 0) {
DestroyActor(Punto);
}
}

Re: collide.ACT->HP = 0 <--not work.

PostPosted: Thu Feb 28, 2008 7:49 pm
by equinox
exactly this I desired to do.
But I don't succeed in doing it alone, even if I have read and reread 1000 times the file doc and seen the tutorials. :o((((

Re: collide.ACT->HP = 0 <--not work.

PostPosted: Thu Feb 28, 2008 7:49 pm
by Game A Gogo
you need to do this in the Collision event, not draw actor