Page 1 of 1

CreateActor()

PostPosted: Tue Aug 31, 2004 12:46 am
by zoiba
hi,
I have the suspect that runtime clone actor (CreateActor()) give the same name to all actors created.
http://www.ffx.it/GE/puzzle.zip
Here you can DL a little test.
I used getactor() function in order to test if twin actors stay one over the other and, in that case, destroy him, but, as you can see, getactor() get everytime the same clonename (palla.0), so actors will be destroyed in the order which they are created.
Have tried with off-line created clones and getactor() worked fine.
Is it possible or it's my fault?

bye :wink:

PostPosted: Wed Sep 01, 2004 12:52 am
by makslane
It's my fault. The clone index don't be updated on actors created with CreateActor action.

I will fix this

PostPosted: Mon Sep 27, 2004 6:21 pm
by makslane
In your "palla" actor, in the Collision with top side of palla event, you use this code:

Code: Select all
Actor *attore;

yvelocity=0;
y=((ceil(y/16))*16)-16;
attore=getactor(x,y+16);

if (attore->animpos==animpos)
{
    DestroyActor("Event Actor");
    strcpy(put.text, attore->clonename);
    DestroyActor(attore->clonename);

}


This code work fine in your game:

Code: Select all
Actor *attore;

yvelocity=0;
y=((ceil(y/16))*16)-16;
attore=getactor(x,y+16);

if (attore->animpos==animpos)
{
    DestroyActor("Event Actor");
    DestroyActor("Collide Actor");
}

PostPosted: Sun Mar 06, 2005 7:41 pm
by ingsan
:?