Results 1 to 5 of 5

Thread: Unit scoped functions are very inconsistent as to what they apply to

  1. #1

    Unit scoped functions are very inconsistent as to what they apply to

    A recent example for me

    WasRecentlyDamagedByCreep() works for hero. Does not work for any type of creep

    GetAttackTarget() works for hero and lane creeps, however does not work for neutral creeps.

    For me, the main issue isn't them not working.
    It's that there is no documentation on what they apply to.
    Combined with unimplemented unit scoped functions simply returning nil, which in many cases is also a valid return value for when the function IS implemented.

    This means you have things silently failing, which are generally hard to debug

    It would be nice to have at least one of the following
    1) All unit scoped functions implemented for all unit types
    2) Documentation on which are not implemented
    3) an exception is raised when an unimplemented unit scoped function is called, rather than returning nil
    https://github.com/ThePianoDentist/t...dentistdotabot Lina bot which pulls small camp when 'laning' (Aim to work on pulling and stacking bots initially)
    https://github.com/ThePianoDentist/dotabots-ml-tools Parsing data from bot games

  2. #2
    Basic Member
    Join Date
    Oct 2016
    Posts
    88
    1 is the most important, but 2 and 3 would be nice too.

  3. #3
    another example I found just now

    TimeSinceDamagedByCreep() always returning -1 for lane creeps (untested fully but it may be always returning +1 for neutrals)
    so doing creep:TimeSinceDamagedByCreep() < 1.5 makes it seem like everything is working until you wonder why conditional always passing and you put prints in
    https://github.com/ThePianoDentist/t...dentistdotabot Lina bot which pulls small camp when 'laning' (Aim to work on pulling and stacking bots initially)
    https://github.com/ThePianoDentist/dotabots-ml-tools Parsing data from bot games

  4. #4
    Valve Developer
    Join Date
    Sep 2011
    Posts
    1,604
    I agree that cleaning up the documentation would be nice, but in the meantime if you run with "developer 1" you should see warnings every time something that's disallowed/unsupported is called.

  5. #5
    Basic Member
    Join Date
    Dec 2016
    Posts
    61
    Does GetAttackTarget() works for lane creeps?
    I tested here but it doesnt trigger and always return nil.

Posting Permissions

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