Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Question of tracking what units are closest in proximity to a si
Question of tracking what units are closest in proximity to a si
Sep 26 2017, 8:56 am
By: m.0.n.3.y  

Sep 26 2017, 8:56 am m.0.n.3.y Post #1



Question of tracking what units are closest in proximity to a single central unit

So here's the situation.

I have a human p1 controlling a single zergling. Players 4, 5, and 6 also have a single zergling each. I would like to track which player (4, 5, or 6) is closest in proximity to the p1's zergling.

The way I've thought of to do this is to stack multiple locations on top of p1's zergling, each being normal grid square than the last. For example, Location 1 would be the size of the zergling, location 2 would be 1 normal grid square bigger than location 1 on all sides, location 3 would be 1 normal gride square bigger than location 2 on all sides, and so on and so on. If X = zergling the visual would be this: X,location 1, location 2, location 3, location 4.

The triggers would be something like this:
Trigger
Players

  • Player 1
  • Conditions

  • Player 4 brings exactly 1 Zergling to Location 4
  • Player 5 and 6 bring exactly 0 Zergilng to Laction 3
  • Actions

  • Then it is determined that player 4 is the closest


  • Then repeat this for each location and each player.

    If two players are the same distance, as in p5, and p6 are both in location 3, then I'd just say that p5 is the closest. Tie just goes to one of the players.

    That's my idea, I was wondering if there's a better or more accurate way to do this? Or would this work just fine?

    Thanks for your help guys



    None.

    Sep 26 2017, 5:03 pm Roy Post #2

    An artist's depiction of an Extended Unit Death

    This would be a sufficient implementation for your requirements. It's worth pointing out that you can use the same set of locations for all players, so the number of locations you'll be using won't increase with the number of players.




    Sep 27 2017, 2:06 am m.0.n.3.y Post #3



    Quote from Roy
    This would be a sufficient implementation for your requirements. It's worth pointing out that you can use the same set of locations for all players, so the number of locations you'll be using won't increase with the number of players.
    Awesome thanks Roy!



    None.

    Options
      Back to forum
    Please log in to reply to this topic or to report it.
    Members in this topic: None.
    [06:51 pm]
    Vrael -- It is, and I could definitely use a company with a commitment to flexibility, quality, and customer satisfaction to provide effective solutions to dampness and humidity in my urban environment.
    [06:50 pm]
    NudeRaider -- Vrael
    Vrael shouted: Idk, I was looking more for a dehumidifer company which maybe stands out as a beacon of relief amidst damp and unpredictable climates of bustling metropolises. Not sure Amazon qualifies
    sounds like moisture control is often a pressing concern in your city
    [06:50 pm]
    Vrael -- Maybe here on the StarEdit Network I could look through the Forums for some Introductions to people who care about the Topics of Dehumidifiers and Carpet Cleaning?
    [06:49 pm]
    Vrael -- Perhaps even here I on the StarEdit Network I could look for some Introductions.
    [06:48 pm]
    Vrael -- On this Topic, I could definitely use some Introductions.
    [06:48 pm]
    Vrael -- Perhaps that utilizes cutting-edge technology and eco-friendly cleaning products?
    [06:47 pm]
    Vrael -- Do you know anyone with a deep understanding of the unique characteristics of your carpets, ensuring they receive the specialized care they deserve?
    [06:45 pm]
    NudeRaider -- Vrael
    Vrael shouted: I've also recently becoming interested in Carpet Cleaning, but I'd like to find someone with a reputation for unparalleled quality and attention to detail.
    beats me, but I'd make sure to pick the epitome of excellence and nothing less.
    [06:41 pm]
    Vrael -- It seems like I may need Introductions to multiple companies for the Topics that I care deeply about, even as early as Today, 6:03 am.
    [06:38 pm]
    Vrael -- I need a go-to solution and someone who understands that Carpets are more than just decorative elements in my home.
    Please log in to shout.


    Members Online: Moose