
I might try re-doing the battleship animation, making sure it matches, and I'll see if I can solve it.
Actor *NMC()//Nearest Map Center - adjust to your situation
{
double dist1; // get the distance of one Map Center
double dist2;// get the distance of the previously closest MapCenter
char *PMC = "MapCenter.00";//create a string for previous MapCenter's clonename, assigning space to it
char *MCC = "MapCenter.00";//create a string for one MapCenter's clonename
char *CI = "00";// create a string for a cloneindex
int i;// create an integer for the cloneindex
for (i = 0; i < ActorCount("MapCenter"); i ++)//repeat for each MapCenter
{
strcpy(MCC, "MapCenter.");//Set MCC to MapCenter.
sprintf(CI, "%d", i);Copy the cloneindex integer into the CI string
strcat(MCC, CI);//add the cloneindex string to the clonename
dist1 = distance(x, y, getclone(MCC)->x, getclone(MCC)->y);//set a distance
dist2 = distance(x, y, getclone(PMC)->x, getclone(PMC)->y);//set another distance
if (i == 0){dist2 = 999999999;}//if it is the first time, dist2 should be greater than dist1
if (dist1 < dist2)
{
strcpy(PMC, MCC);//if dist1 is smaller than dist2, update the previous closest
}
}
return getclone(PMC);//return the closest one.
}
and I can make a new beta with the first few levels.
- Is there a way I can do an action only if the file exists (like loadvars)?
- Can I delete a file after it has been created?
Users browsing this forum: No registered users and 1 guest