Prevent actors from spawning too close to each other?

NtGNtG Member Posts: 103
edited May 2012 in Working with GS (Mac)
Like the title says. I can't exactly go in to detail because it would reveal too much of my game. Basically I want the following code:

if magnitude(actor_Instance1X-actor_Instance2X,actor_Instance1Y-actor_Instance2Y) < 60
then destroy 1 instance of the actor

I have no idea if this is even possible because it would require that each spawned actor have knowledge of the location of the other spawned actors, Ugh so confusing lol.

Any suggestions would be great

Answers

  • NtGNtG Member Posts: 103
    edited May 2012
    Hi there, magnitude takes up performance so to many of them can hurt.

    If you can wait a week or two 9.93 will be released

    With writable tables you will be able to chart out a grid of spawn locations. And after you choose a random spawn point you will be able to remove that point for the list so the next actor will have to choose a different location.
    this way no 2 actors will spawn in the same location.

    i have a video ready for this once 9.93 is released.

    cheers


    The things is, I want them to spawn in the same location, but all of the spawned actors have the same motion behaviors so sometimes an actor will be following the correct path and be too close to the spawner when it is time for another actor to be spawned (where I want the actors to start at) and then the two actors will be traveling the in sync with each other, but too close to each other.

    ^That is probably a really confusing paragraph lol, but that is really the only way I can describe it without giving away too much detail.

    EDIT: I think I figured this out, just have it so if the actor is too close to the spawner then prevent spawn. Its funny how things can be fixed simply by writing the problem out lol.
Sign In or Register to comment.