Results 1 to 10 of 10

Thread: GetNearbyCreeps() for allies

  1. #1
    Basic Member
    Join Date
    Mar 2012
    Posts
    2,014

    GetNearbyCreeps() for allies

    Is it just me or is this function broken? So far, a count using # on the result of GetNearbyCreeps() will always print the number that is equal to enemy creeps. That is, regardless of true/false on the second param.
    Can anyone else double-check this?
    Explanations on the normal, high and very high brackets in replays: here, here & here
    Why maphacks won't work in D2: here

  2. #2
    Basic Member
    Join Date
    Jun 2013
    Posts
    274
    Seems to be the case.

  3. #3
    Basic Member
    Join Date
    Mar 2012
    Posts
    2,014
    Chris, can you please check?
    Explanations on the normal, high and very high brackets in replays: here, here & here
    Why maphacks won't work in D2: here

  4. #4
    Basic Member
    Join Date
    Oct 2016
    Posts
    247
    yep broken, i played with it yesterday and thought i was just doing something wrong.

  5. #5
    Basic Member
    Join Date
    Mar 2012
    Posts
    2,014
    OK, in that case, can you please check other GetNearby*() funcs as well, please Chris?
    Explanations on the normal, high and very high brackets in replays: here, here & here
    Why maphacks won't work in D2: here

  6. #6
    Basic Member
    Join Date
    Dec 2016
    Posts
    731
    Quote Originally Posted by The Nomad View Post
    OK, in that case, can you please check other GetNearby*() funcs as well, please Chris?
    I am surprised this is possible since my bot is able to "deny" allied creeps without a hitch... which means the handles returned by GetNearbyCreeps() for boolean set to "allies" have to return allied creep handles (at least some of them).

    It is possible that if #AlliedCreep > #EnemyCreep it will only return #EnemyCreep of nearby allied creeps... I would still be able to deny creeps and not notice this.

    However, that means in the case where #AlliedCreep < #EnemyCreep something has to be filling the "handles" for where the difference in sizes is... because my code iterates all the nearbyAlliedCreep handles to find the one with the lowest health so it knows which one to deny. I'm guessing in this case it has to be that I'm getting AlliedCreep handles until there is no more, and then the rest is actually enemy creep handles... I mean it has to be some kind of valid handles or I would be seeing crashes.

    Theoretically it is possible that the way they implemented this is that they simply call a global GetUnitList(ALL) once per frame in their backend which happens to group types of units into locally clustered group (probably in how it is populated) and then only return a start iterator and a size when you call a GetNearby*() where the returned "size" has a bug of using the wrong clustered group size.

  7. #7
    Valve Developer
    Join Date
    Sep 2011
    Posts
    1,704
    Yeah, GetNearbyCreeps() is just broken (it was always grabbing enemies).

  8. #8
    Basic Member
    Join Date
    Dec 2016
    Posts
    731
    Quote Originally Posted by ChrisC View Post
    Yeah, GetNearbyCreeps() is just broken (it was always grabbing enemies).
    How am I able to deny then? Need friendly creep handles for that.

  9. #9
    Valve Developer
    Join Date
    Sep 2011
    Posts
    1,704
    Quote Originally Posted by nostrademous View Post
    How am I able to deny then? Need friendly creep handles for that.
    Were you using GetNearbyLaneCreeps()? That one worked correctly.

    If you were using GetNearbyCreeps() I have no idea.

  10. #10
    Basic Member
    Join Date
    Dec 2016
    Posts
    731
    Quote Originally Posted by ChrisC View Post
    Were you using GetNearbyLaneCreeps()? That one worked correctly.

    If you were using GetNearbyCreeps() I have no idea.
    You are right, I forgot I changed my code to use GetNearbyLaneCreeps().

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •