(1) I use the following code to create 50 planets and to put the coordinates for each planet into arrays:
int i;
int PlanetIterator = 0;
for (i = 0; i < 50; i++)
{
int randX = (round(rand(720))) + 600; //random x coordinate
int randY = (round(rand(615))) - 465; //random y coordinate
planetX[planetIterator] = randx;
planetY[planetIterator] = randy;
CreateActor("planetSmallBlue", "neutral", "no parent", "no path",
randx, randy, true);
planetIterator++;
}
(2) I want to select one of the randomly created planets to be the home base for the player. How do I do this?
I think I somehow need to use getactor() with the x and y coordinates stored in the arrays (that's why I created the arrays) but I'm not sure how. I have looked at other threads, which talk about how to see if a particular actor is at a given place, but I need to somehow select the actor that is at that place (i.e., I need to make it the "Event Actor").
Any ideas? Thanks.