CreateActor()

Non-platform specific questions.

CreateActor()

Postby zoiba » Tue Aug 31, 2004 12:46 am

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:
User avatar
zoiba
 
Posts: 45
Joined: Mon Aug 09, 2004 9:44 am
Location: Italy
Score: 1 Give a positive score

Postby makslane » Wed Sep 01, 2004 12:52 am

It's my fault. The clone index don't be updated on actors created with CreateActor action.

I will fix this
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby makslane » Mon Sep 27, 2004 6:21 pm

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");
}
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby ingsan » Sun Mar 06, 2005 7:41 pm

:?
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest