Hey !
Be aware that doing this by only checking random coordinates can be very long if the map is full or nearly full of bases. You can even make an infinite loop here.
That being said, the problem in the events is that you take 1 set of random coordinates per cycle of the main loop. So in total, you take maximum NrOfBases coordinates, even if one random set is valid or not.
The second problem is that, if it find any base that is further enough, then it decides that it is a valid position. Instead, it should be only if ALL bases are further enough.
So you need to change the base loop here, by making it a while instead of a for, and by modifying you "validation" detection. The easiest should be to do something like this :
EDIT ! I forgot the While in the main loop....
Hi, sorry for responding so late...
I tried your code (the one with the while loop), but the bases still spawn within that minimum distance...
I then tried with MinDistance being less than "distance(Base.X, Base.Y, X, Y)", but that didn't load...