Hi ppl, I wanna know, how can I make this:
I have one player called P and 3 clone actor called E. So, when I click on
player, the player will move RANDOR to clone 1 or clone 2 or clone 3...
Is this possible?
Thanks, Camper
int random;
random = rand(number of clones);
switch(random)
{
case 0:MoveTo("Event Actor", 0.000000, 0.000000, 3.000000, "e.0", "");
break;
case 1:MoveTo("Event Actor", 0.000000, 0.000000, 3.000000, "e.1", "");
break;
//ect.
}
int random;//create the actor variable named random;
random = rand(3);// you know this since it was in your code :)
switch(random)//switch the variable so you don't have to do if(var == 1)ect; case is like if(var ==)
{
case 0:MoveTo("Event Actor", 0.000000, 0.000000, 3.000000, "e.0", "");//if case \\ 0 moveto actor 0
break;
case 1:MoveTo("Event Actor", 0.000000, 0.000000, 3.000000, "e.1", "");
break;
case 2:MoveTo("Event Actor", 0.000000, 0.000000, 3.000000, "e.2", "");
break;
}
Actor * getCloneIdx (const char *cname, int cindex) //g_GetCloneByIndex, its original name
{
char buffer[50];
sprintf(buffer,"%s.%i",cname,cindex);
return(getclone(buffer));
}
Actor* target;
int RANDOM;
RANDOM=rand(3);
target = getCloneIdx("E", RANDOM);
// Probably need a triggered variable
// Probably need a conditional
MoveTo("Event Actor", target->x, target->y, 100, "Game Center", "");
if(cloneindex==(ActorCount("factory")-1))
{
//Create Actor code here
}
Users browsing this forum: No registered users and 1 guest