Page 44 of 45 FirstFirst ... 34 42 43 44 45 LastLast
Results 431 to 440 of 447

Thread: API Requests

  1. #431
    Basic Member
    Join Date
    Dec 2016
    Posts
    731
    Doesn’t exist AFAIK. You can retrieve that info from the npc_abilities.txt through your own parsing into the Lua domain.

  2. #432
    Basic Member
    Join Date
    Oct 2016
    Posts
    247
    ok, that sounds way beyond my abilities.
    ill wait until chris puts it in - cornbane will want it eventually for his reactive buy script im sure.

  3. #433
    Basic Member
    Join Date
    Mar 2012
    Posts
    2,017
    Explanations on the normal, high and very high brackets in replays: here, here & here
    Why maphacks won't work in D2: here

  4. #434
    Basic Member
    Join Date
    Oct 2016
    Posts
    247
    i would second all of those requests nomad.

  5. #435
    Basic Member
    Join Date
    May 2014
    Posts
    270
    Quote Originally Posted by Yavimaya View Post
    does anyone know if there is a way to find out if a skill is upgradable by a scepter? (not HasScepter() )
    something that can read:
    Code:
    "HasScepterUpgrade"			"1"
    in the same manner as GetAbilityDamage(), etc?
    I've tried to make the parser based on nostrademous's HeroData.py (Thanks to nostrademous ) while learning basic Python coding too. If you want the abilities data file you can download it here https://www.dropbox.com/s/ykj9w5femi...arser.zip?dl=0.
    How to use it
    Code:
    local abilityData = dofile( GetScriptDirectory().."/AbilitiesData" )
    
    local bot = GetBot()
    --the ability that you want to get the HasScepterUpgrade value. In this example is bot's 5th slot ability
    local ability = bot:GetAbilityInSlot(5);
    if abilityData[ability:GetName()].HasScepterUpgrade == 1 then
        print("This ability has Scepter upgrade");
    end
    I've tried to make the parser for hero and unit file too ( but it's not that good yet, since I haven't filter the important data that I want to get + the good output format for the lua file. I just want to practice a basic Python ). If you find it useful you can download through that dropbox link.
    You have to re run the Python file every time the npc_hero/unit/abilities.txt get updated by the Dota 2 update so the data file get updated.
    Note : You must have Python installed in your machine to run the Python file (I use Python 3) and adjust the path of "npcDir" and "scriptDir" variable to match your current npc_.txt and script directory path.

    Question : Will I get Lua memory usage warning if I use this kind of module since there is a lot of data in it?
    Last edited by arz_on4dt; 12-03-2017 at 05:10 AM.

  6. #436
    Basic Member
    Join Date
    Mar 2012
    Posts
    2,017
    Quote Originally Posted by arz_on4dt View Post
    Question : Will I get Lua memory usage warning if I use this kind of module since there is a lot of data in it?
    There is no guaranteed YES or NO here. If you optimize a lot, chances are you won't when you start. But that depends on how much info you store along as you play. If there are a lot of closure and table creations, including persistent storage over a game of 70 minutes, there is a chance of degradation.

    Your best bet here is to optimize away anything you don't need. For example, you don't need to load the SpecialValues since you have the GetSpecialValue* functiosn which will be better than your table accessors anyway.
    Same for cast range, item cost, tags, quality, declarations etc.

    In the end you just need flags where the native code has no accessor functions. And that's a small table.
    Explanations on the normal, high and very high brackets in replays: here, here & here
    Why maphacks won't work in D2: here

  7. #437
    Basic Member
    Join Date
    Mar 2012
    Posts
    2,017
    Apart from these suggestions, while thinking of a nice roaming (solo & team) code design, I realized that the default team-wide implementation of UpdateRoamDesire() requires a target handle. Because we can't get handles on enemies (and using GetUnitList() or GetNearbyHeroes() each frame is inefficient for roaming since roaming happens once every X minutes), why not replace the roaming target handle with the player id of the target? That of course, means adding a GetRoamTargetPlayerId() function. GetRoamTarget() should not be removed in my opinion as it can still be used when fighting. But, that just means that while the team does not have vision on the target, then this function returns nil, but when vision occurs again, it should return the real handle.
    Explanations on the normal, high and very high brackets in replays: here, here & here
    Why maphacks won't work in D2: here

  8. #438
    Basic Member
    Join Date
    Mar 2012
    Posts
    2,017
    Please add some quick helper functions that return information about the current status of a target:
    • unit-scoped GetCurrentStatus() that returns integer constants like for example, 0 normal (or whatever name you can find), 1 being rooted, 2 stunned, 3 disarmed etc.; basically EXACTLY what we see shown above the hero
    • unit-scoped GetCurrentStatusDuration() that returns the remaining duration of the status; takes no parameters; this should return the value in the progress bar shown above the hero


    Also, it'd help if you could please make SetTarget() also internally set the Player Id (if the SetTarget parameter is valid) and add a unit-scoped GetTargetPlayerId(). I can't think of any way where a target that gets out of view (FoW or invisible) could return a valid handle that allows me to use GetPlayerId() that would ultimately let me use GetHeroLastSeenInfo() unless I continuosly hold every hero's info during fights which doesn't seem optimal, whereas a simple SetTarget() that sets both a handle and the player Id internally can do this easily

    If possible, also store the following player datain the table returned by GetHeroLastSeenInfo() on top of the location:
    • velocity and speed - to at least know if they had a rune or were slowed or something like that.
    • direction - to know the way they were headed


    Happy new year BTW
    Last edited by The Nomad; 01-01-2018 at 06:21 AM.
    Explanations on the normal, high and very high brackets in replays: here, here & here
    Why maphacks won't work in D2: here

  9. #439
    HI,ChrisC.
    I need an API to determine whether the unit is in attack point.
    Thanks.

  10. #440
    Basic Member
    Join Date
    Mar 2012
    Posts
    2,017
    You mean the attack point in the animation or attack range?
    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
  •