Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15

Thread: March 28 Bot Update

  1. #1
    Valve Developer
    Join Date
    Sep 2011
    Posts
    1,704

    March 28 Bot Update

    • Fixed NearbyTowers returning both towers and barracks, and NearbyBarracks returning nothing.
    • Fixed the autocourier of 1v1 not being usable by bots.
    • Added IsFacingLocation() to the bot script API.
    • Added GetModifierByName() to the bot script API.
    • Added GetModifierAuxiliaryUnits() to the bot script API, which returns a table of units related to the modifier. For example, Ember Spirit remnants.
    • Fixed crash in GetIncomingTrackingProjectiles().
    • Added IsRadiusVisible() to the global bot script API.
    • Increased max size of CreateHTTPRequest URL to 8192 bytes.
    • Fixed CreateHTTPRequest always returning nil.


    Just realized that I wrote the code for IsFacingLocation and then completely forgot to test it so uh...let me know if it works?

  2. #2
    Basic Member
    Join Date
    Dec 2016
    Posts
    707
    Was that my crash?

  3. #3
    Basic Member
    Join Date
    Dec 2016
    Posts
    707
    Also, would be nice if we could get a handle or index to the modifier by name so I don't have to iterate all the modifiers on a unit to find out the remain duration of the mod.

    Ergo...
    Code:
    function GetModifierRemainingDuration(hUnit, sName)
        if hUnit:HasModifier(sName) then
            local botModifierCount = hUnit:NumModifiers()
            if botModifierCount == 0 then return 0 end
            
            for i = 0, botModifierCount-1, 1 do
                local modName = hUnit:GetModifierName(i)
                if modName == sName then
                    return hUnit:GetModifierRemainingDuration(i)
                end
            end
        end
        return 0
    end
    Also, do you know off hand which one to check for enemy backdoor protection? I can do my own test I guess... but if you know offhand...
    modifier_backdoor_protection
    modifier_backdoor_protection_active
    modifier_backdoor_protection_in_base

  4. #4
    nice,welcome comeback ChrisC.hope to see more detail info on wiki.

  5. #5
    Basic Member
    Join Date
    Oct 2016
    Posts
    235
    Quote Originally Posted by ChrisC View Post
    • Fixed NearbyTowers returning both towers and barracks, and NearbyBarracks returning nothing.
    • Fixed the autocourier of 1v1 not being usable by bots.
    • Added IsFacingLocation() to the bot script API.
    • Added GetModifierByName() to the bot script API.
    • Added GetModifierAuxiliaryUnits() to the bot script API, which returns a table of units related to the modifier. For example, Ember Spirit remnants.
    • Fixed crash in GetIncomingTrackingProjectiles().
    • Added IsRadiusVisible() to the global bot script API.
    • Increased max size of CreateHTTPRequest URL to 8192 bytes.
    • Fixed CreateHTTPRequest always returning nil.


    Just realized that I wrote the code for IsFacingLocation and then completely forgot to test it so uh...let me know if it works?
    thanks for the ember fix Chris! ill have a play with that, i did actually get him working with a "UNIT_LIST_ALLIES" call and then name check, but cant get him to wait until they are in place before activating 100% of the time, but im sure this is my crappy coding.
    Could "GetModifierAuxiliaryUnits()" also be used to fix monkey king and his Ult monkeys doing what the main hero does? (using his skills, etc)

    If you havent seen my other posts, could you please take a look at IO and his huge "power" multiplier? other bots wont go near him because of it, making him a pretty cheating pick.

  6. #6
    Basic Member
    Join Date
    Dec 2016
    Posts
    121
    I wish we could have GetTurnAroundSpeed() and GetAttackingProjectileSpeed() to get turn around speed of any hero and projectile speed of ranged hero.

  7. #7
    Basic Member
    Join Date
    Dec 2016
    Posts
    29
    I still have an issue with Http requests:
    Code:
    function send()
        local request = CreateHTTPRequest("dashboard/")
        request:Send(
            function(result) 
                print("yay!")
            end
        )
    end
    will produce
    Code:
    Script Runtime Error: attempt to call a table value
    stack traceback:
    (traceback is actually empty)
    Server is just an xampp/apache that happened to be running.
    According to wireshark, POST requests are send and answered correctly.

  8. #8
    Basic Member
    Join Date
    Mar 2012
    Posts
    1,884
    Quote Originally Posted by nostrademous View Post
    Also, would be nice if we could get a handle or index to the modifier by name so I don't have to iterate all the modifiers on a unit to find out the remain duration of the mod.
    What could you do with a handle of modifiers?
    Explanations on the normal, high and very high brackets in replays: here, here & here
    Why maphacks won't work in D2: here

  9. #9
    Basic Member
    Join Date
    Dec 2016
    Posts
    707
    Quote Originally Posted by The Nomad View Post
    What could you do with a handle of modifiers?
    I meant index so I can quickly call GetModifierStackCount() and GetModifierRemainingDuration() directly without having to iterate.

  10. #10
    Valve Developer
    Join Date
    Sep 2011
    Posts
    1,704
    I think you can do GetModifierStackCount( GetModifierByName( name ) ) now.

    And that crash fix was one of your crashes, but not the strange Drow Ranger one. I'll probably need to repro that in a debug build to get more of a clue what's going on there.

Posting Permissions

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