Page 1 of 10 1 2 3 ... LastLast
Results 1 to 10 of 98

Thread: January 19 Bot Update

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

    January 19 Bot Update

    Bugfixes
    • Fixed GetManaRegen() to return the correct value.
    • Changed Action_MoveToLocation() to more precisely move to the specified location in the bot script API.
    • Fixed Action_MoveToUnit() to work at all.
    • Fixed GetUnitList() to correctly return buildings.
    • Fixed crash when using dota_bot_reload_scripts when you aren't using bot scripts.
    • UpdateLaneAssignments() now expects as a return value a table of lanes. The heroes represented by table slots are the ones returned by the GetTeamMember() function.
    • Fixed global GetNeutralSpawners() function to return a table of alternating camp names and locations.

    Minions
    • Added the notion of minions, which are illusions, summoned units, dominated units, etc. Basically anything that's under control of your hero. But not couriers.
    • Added a script override for minion think -- MinionThink( hMinionUnit ) in bot_<foo>.lua. It's called once for every minion under control by a bot. For example, if you implemented it in bot_beastmaster.lua, it would get called once each for your boar and hawk when they were summoned.
    • Action commands that are usable on your hero are usable on the passed-in hMinionUnit.

    Couriers
    • Changed script function Action_CourierDeliver() to Action_Courier() that takes a unit handle of the courier and an action you'd like the courier to perform.
    • Added COURIER_ACTION_RETURN, COURIER_ACTION_SECRET_SHOP, COURIER_ACTION_STASH_ITEMS, COURIER_ACTION_TRANSFER_ITEMS, COURIER_ACTION_BURST, and COURIER_ACTION_TAKE_AND_TRANSFER_ITEMS constants.
    • Added global script functions GetNumCouriers(), GetCourier(), and GetCourierState().
    • Added COURIER_STATE_IDLE, COURIER_STATE_AT_BASE, COURIER_STATE_MOVING, COURIER_STATE_DELIVERING_ITEMS, COURIER_STATE_RETURNING_TO_BASE, and COURIER_STATE_DEAD constants.

    Other Additions
    • Added allied/enemy wards to global GetUnitList() function along with UNIT_LIST_ALLIED_WARDS and UNIT_LIST_ENEMY_WARDS constants.
    • Added unit-scoped GetNearbyBarracks() and GetNearbyShrines() functions.
    • Added unit-scoped Action_UseShrine() function.
    • Added unit-scoped Action_DisassembleItem() and Action_SetItemCombineLock() functions.
    • Added unit-scoped Action_Ping() and GetMostRecentPing() functions.
    • Added unit-scoped GetCurrentActiveAbility() function.
    • Added unit-scoped GetModifierStackCount() function.
    • Added unit-scoped GetBuybackCost() and GetBuybackCooldown() functions.
    • Added unit-scoped GetLevel() function.
    • Made the unit-scoped GetEstimatedDamageToTarget() function work with units that do not have bots (like creeps and towers).
    • Added ability-scoped CanBeDisassembled() and IsCombineLocked() functions. These functions obviously only work on items.
    Last edited by ChrisC; 01-19-2017 at 08:24 PM.

  2. #2
    Do the default bots up their talents? Also, are their choices of getting runes fixed? Because last time, they kept diving into a tower, just to get a rune in the other base.

  3. #3
    Basic Member
    Join Date
    Dec 2016
    Posts
    731
    Thank you. The only other thing I can think of is some form of system for bots to get event information that is available to human players via visual cues. Like Mirana arrow (projectiles), Zeus ultimate, Enigma ultimate, etc

  4. #4
    Basic Member
    Join Date
    Jun 2013
    Posts
    274
    Is DoBotScriptLaneAssignments() supposed to be UpdateLaneAssignments()? Because that function still works with the same return method we've been using. Only difference is the Undying lane resetting issue that I've had isn't an issue anymore. (Woohoo!)

    I'm really confused by MinionThink().
    So we summon a minion, need to get a handle on it so that it can be input to the function that runs when the minion is summoned where we can assign commands to it once because the function will only call once for each minion?
    I think I may be reading it wrong because I can't wrap my head around it.

    Other than that: Wow, what an update.
    Last edited by Cornbane; 01-19-2017 at 07:40 PM.

  5. #5
    Valve Developer
    Join Date
    Sep 2011
    Posts
    1,704
    When you summon a minion, MinionThink will start getting called for it (the call to MinionThink has a single parameter that is a handle to the minion in question). If you have two minions, MinionThink will get called twice, once for each of the minions.

    I'll be updating the wiki with the new stuff tomorrow which hopefully will clear up some details.

    hm, and I yeah I think it's supposed to be UpdateLaneAssignments, probably a copy/paste error.

  6. #6
    Basic Member
    Join Date
    Dec 2016
    Posts
    731
    FYI - "Added unit-scoped GetNearbyShrines() and GetNearbyBarracks() functions." this is listed twice

  7. #7
    Basic Member
    Join Date
    Dec 2016
    Posts
    731
    Also, uhm.

    Code:
    if GetCourierState() ~= COURIER_STATE_IDLE and GetCourierState() ~= COURIER_STATE_AT_BASE and GetCourierState() ~= COURIER_STATE_DEAD then
        npcBot:Action_Courier(COURIER_ACTION_BURST)
    end
    Code:
    [VScript] Script Runtime Error: ...\dota 2 beta\game\dota\scripts\vscripts\bots/utility.lua:1243: GetCourierState called with 0 arguments - expected 1
    stack traceback:
    	[C]: in function 'GetCourierState'
    I have tried:
    Code:
    function U.CourierThink(npcBot)
    	if GetNumCouriers() == 0 then return end
    	
    	local checkLevel, newTime = U.TimePassed(getHeroVar("LastCourierThink"), 1.0);
    
    	if not checkLevel then return end
    	setHeroVar("LastCourierThink", newTime)
    
    	--print(U.GetHeroName(npcBot), " SV: ", npcBot:GetStashValue(), ", CV: ", npcBot:GetCourierValue(), ", HII: ", U.HasImportantItem())
    	
    	if GetCourierState(GetCourier(1)) ~= COURIER_STATE_IDLE and GetCourierState(GetCourier(1)) ~= COURIER_STATE_AT_BASE and GetCourierState(GetCourier(1)) ~= COURIER_STATE_DEAD then
    		npcBot:Action_Courier(GetCourier(1), COURIER_ACTION_BURST)
    	end
    
    	if npcBot:IsAlive() and (npcBot:GetStashValue() > 500 or npcBot:GetCourierValue() > 0 or U.HasImportantItem()) and IsCourierAvailable() then
    		--print("got item");
    		npcBot:Action_Courier(GetCourier(1), COURIER_ACTION_TAKE_AND_TRANSFER_ITEMS)
    		return
    	end
    end
    At least I don't get the error, but I do get a crash... but it might be related to something else... no error printed to console
    Last edited by nostrademous; 01-19-2017 at 08:05 PM.

  8. #8
    Valve Developer
    Join Date
    Sep 2011
    Posts
    1,704
    Hm, not sure just looking at the code. GetCourier may be zero-based? So should be GetCourier(0)?

  9. #9
    Basic Member
    Join Date
    Dec 2016
    Posts
    731
    Is there a way to know that courier is "flying" other then trying to upgrade it and not being able to?

    Also, yes... GetCourier(0) seems to be how to get first courier... however... COURIER_ACTION_TAKE_AND_TRANSFER_ITEMS seems to not be how I call the courier to me.
    Last edited by nostrademous; 01-19-2017 at 09:03 PM.

  10. #10
    npcBot:Action_Courier(courier , COURIER_ACTION_TAKE_AND_TRANSFER_ITEMS) Does not work.

    Notes: both npcBot and courier are the correct handles, I'm calling this every 2 seconds, I'm also checking if the state is idle and if you replace the second parameter by something like COURIER_ACTION_SECRET_SHOP it does what it is supposed to do.

Posting Permissions

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