Page 2 of 2 FirstFirst 1 2
Results 11 to 16 of 16

Thread: GetTarget() is not accessible from the team context

  1. #11
    Valve Developer
    Join Date
    Sep 2011
    Posts
    1,698
    Okay thanks, I'll check out the trivial case.

    I've always been unsure about adding accessors that are two specific -- is it better for bot scripts to just hang data off the GetBot() table?

  2. #12
    Basic Member
    Join Date
    Mar 2012
    Posts
    1,769
    If I were to speak from my experience from other scripts I've seen, I'd say that Lua is so easy to customize and offers so many possibilities that it can be extended in any way one sees fit. At first I used my own table as an object wrapper for GetBot() where I (redundantly) copied some functions from GetBot() that had a little more stuff. In the current version I use the GetBot() instance as it is easier than maintaining code for both the bot handle and my own handle. From this point of view, it is easier as it is accessible from any file (if I wouldn't use takeovers). Then again, as I said, if I were to use my own object instance, I could ignore your accessors and use my own. This freedom is rare in most languages, I'd say. So, TLDR, I don't see a problem as if someone doesn't want them (or uses their own objects/wrappers) they can just ignore them

    Another plus is for beginners as they will most likely use the built in functions and having helper functions will benefit them.

    Of course I don't speak for everyone, but I am sure most will agree.

    Can you also check this post when you have time ? (careful, as it is in the middle of a bunch of other topics that are unrelated to it; in retrospect, should have made a thread about it, but I was counting on quick answers, but I guess not that many people used GetEstimatedDamageToTarget() yet)
    Last edited by The Nomad; 06-28-2017 at 10:57 AM.
    Explanations on the normal, high and very high brackets in replays: here, here & here
    Why maphacks won't work in D2: here

  3. #13
    Quote Originally Posted by ChrisC View Post
    Okay thanks, I'll check out the trivial case.

    I've always been unsure about adding accessors that are two specific -- is it better for bot scripts to just hang data off the GetBot() table?
    What we currently have for this is fine.

    BTW. Is there a conceptual reason for why GetAttackTarget() doesn't work on enemy creeps/towers? (it would be helpful if it worked properly for all units)

  4. #14
    Basic Member
    Join Date
    Mar 2012
    Posts
    1,769
    Quote Originally Posted by ChrisC View Post
    If people would find these kind of accessors useful, I can add more that are specific to script usage.
    What did you have in mind? The only ones that'd come to mind would be GetMoveTarget(), GetMoveLocation(), GetAbilityTargetLocation(), GetTargetTree(). This is just guessing

    Quote Originally Posted by Platinum_dota2 View Post
    BTW. Is there a conceptual reason for why GetAttackTarget() doesn't work on enemy creeps/towers? (it would be helpful if it worked properly for all units)
    Obviously, it should only work on visible units
    Explanations on the normal, high and very high brackets in replays: here, here & here
    Why maphacks won't work in D2: here

  5. #15
    Basic Member
    Join Date
    Dec 2016
    Posts
    164
    I cant understant that why GetAttackTarget() return nil for enemy creeps??? this function will be useful for deny allied creeps.

  6. #16
    Basic Member
    Join Date
    Mar 2012
    Posts
    1,769
    OK, GetTarget() is fixed. According to the changelog, GetAttackTarget() should also work for enemies. Gonna test that
    I tried a GetNearby*() on an enemy creep but it returned nil. Since the creep is visible, I find it weird that it won't return anything since I know what it has around it. The only things I can think of are invisible units (which it'd most likely count, but my allies wouldn't since the enemy is invisible and this can be exploited to test for invisible heroes) and maybe vision range (where it can, for example, count things that to me are under the FoW or in trees like a Pudge with Blink Dagger waiting to hook someone). If this is the case, is there a way for GetNearby() to work on enemies without compromising exploitable loop holes? This can help, for example, to track how many nearby units an enemy Void can trap under his Chrono or how many units will be affected by an enemy Invo's Deafening Blast with Aghs. There might be other scenarios, but these are the ones that came to mind. For me, at the moment, I am trying to find a nice algo to track nearby towers for last hits
    Explanations on the normal, high and very high brackets in replays: here, here & here
    Why maphacks won't work in D2: here

Posting Permissions

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