Cloning

Game Editor comments and discussion.

Cloning

Postby He360 » Thu May 28, 2009 12:31 am

I'm having trouble individualizing my clones. In the game when one clone dies, all of them die. Thus, I was wondering how do I fix this problem?

Thanks,
HE
Sometimes you don't need a goal in life.
He360
 
Posts: 22
Joined: Sun Apr 06, 2008 2:21 pm
Score: 0 Give a positive score

Re: Cloning

Postby skydereign » Thu May 28, 2009 12:59 am

Well you know that clones are done by cloneindex, so you can use this to get the actual Actor*. This is a pointer to the clone itself, there are several functions to get the right actor, this is the one I use.
Code: Select all
Actor *
getCloneIdx (const char *cname, int cindex)    //g_GetCloneByIndex, its original name
{
    char buffer[50];

    sprintf(buffer,"%s.%i",cname,cindex);

    return(getclone(buffer));
}

DestroyActor, instead of the actor name, can take an Actor*, so you would just plug in the actors name and index. If this is not what you wanted, or doesn't make sense, I can give an example.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Cloning

Postby Caaz Games » Thu May 28, 2009 1:07 am

lol couldn't on the clone actor,
just on collision destroy event actor?
You are welcome to join my forum. 4 active members lol but it's a cool place. active... much talking :D it's fun!
http://caaz.freeforums.org/
User avatar
Caaz Games
 
Posts: 729
Joined: Wed Feb 14, 2007 9:09 am
Location: California....knows how to party!
Score: 25 Give a positive score

Re: Cloning

Postby skydereign » Thu May 28, 2009 1:09 am

Yeah, but if you have a lot of clones, and they are all waiting for this collision, also He360 did not specify how they are being destroyed.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Cloning

Postby He360 » Thu May 28, 2009 2:18 am

skydereign wrote:Yeah, but if you have a lot of clones, and they are all waiting for this collision, also He360 did not specify how they are being destroyed.



Part of the game involves the enemies being destroyed with a punch. But I cloned a lot of the same enemies (kind of like the Teenage Mutant Ninja Turtles game on PS2 with their enemies.

Also, I have a sort of space shooter level in which I'm trying to destroy the same looking enemies (clones) with a bullet.

A side note is, I admit I'm not good at programming (I will study it MUCH more after finishing my Master's). Thus, what is the best way to make individualized destroyable clones without much knowledge of programming and without them all dying after one of them is shot.

Thanks again,
HE
Sometimes you don't need a goal in life.
He360
 
Posts: 22
Joined: Sun Apr 06, 2008 2:21 pm
Score: 0 Give a positive score

Re: Cloning

Postby BlarghNRawr » Thu May 28, 2009 2:59 am

instead of destroying the actor on a collision, destroy collide actor or event actor
that way only the 1 clone will be destroyed

(also if you want do destry one clone explicitly you can click the little [+] sign next to the actor and choose the clone you want)
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron