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

Thread: February 14 Bot Update

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

    February 14 Bot Update

    • Added GetDayTimeVisionRange(), GetNightTimeVisionRange(), and GetCurrentVisionRange() to the unit bot script API.
    • Added GetAcquisitionRange() to the unit bot script API.
    • Added IsAncientCreep() to the unit bot script API.
    • Updated GetDroppedItemList() to return a table of tables that contain { item, owner, location }.
    • Fixed the Delay action to terminate correctly.
    • Fixed the Shrine action to terminate when the shrine is used.
    • Fixed return value for GetAmountAlongLane().
    • Added BOT_ACTION_TYPE_SHRINE and BOT_ACTION_TYPE_DELAY.
    • Fixed a couple more item build bugs for the default bots.

  2. #2
    What does the GetAcquisitionRange() do?

  3. #3
    Basic Member
    Join Date
    Dec 2016
    Posts
    731
    Quote Originally Posted by Platinum_dota2 View Post
    What does the GetAcquisitionRange() do?
    I assume aggro range for neutrals for example

  4. #4
    Basic Member
    Join Date
    Dec 2016
    Posts
    123
    Code:
     in function 'GetUnitToLocationDistance'
    	...ota 2 beta\game\dota\scripts\vscripts\bots\utilities.lua:195: in function 'availablecamp'
    	...2 beta\game\dota\scripts\vscripts\bots\bot_alchemist.lua:25: in function <...2 beta\game\dota\scripts\vscripts\bots\bot_alchemist.lua:21>
    [VScript] Script Runtime Error: ...ota 2 beta\game\dota\scripts\vscripts\bots\utilities.lua:195: bad argument #2 to 'GetUnitToLocationDistance' (Vector expected, got table)
    stack traceback:
    is there anything changed with GetNeutralSpawners( ) or how lua deal with table[i] after update? the function I use to get distance from nearest camp now said it's a table and not vector, which works fine before the update.

    Code:
    ---------------------find availablecamp for farm
    tableNeutral =  {};
    
    function availablecamp() 
    	
    	if(math.floor(DotaTime()) < 30 ) then
    		tableNeutral = {};
    	end
    
    	if(math.floor(DotaTime()) == 30 ) then
    		tableNeutral = GetNeutralSpawners( );
    	end
    	
    	if ((math.floor(DotaTime()) + 60) % 120 == 0) then ---odd mins, camp respawn
    		tableNeutral = GetNeutralSpawners( );
    	end
    
    	local Allyhero = GetUnitList( UNIT_LIST_ALLIED_HEROES );
    	
    	if (DotaTime() > 30) then
    		for i = 1, 18 do ----there are 18 spawners on map
    			local j = i * 2; --odd number is camp type, even number is its vector
    			for hero_k, hero in pairs(Allyhero) do
    				local camp_loc = tableNeutral[j];
    				if ( camp_loc ~= nil and hero:IsAlive( ) and GetUnitToLocationDistance(hero, camp_loc) <= 300) then ---should add vision check and larger radius if possible
    					local NeutralCreeps = hero:GetNearbyNeutralCreeps(600);
    					if (#NeutralCreeps == 0 and tableNeutral[j]:IsLocationVisible()) then
    						table.remove( tableNeutral, j );
    						table.remove( tableNeutral, j-1 );
    					end
    				end
    			end		
    		end
    	end
    	
    	return tableNeutral;
    end
    Last edited by lunarbreez; 02-14-2017 at 05:18 PM.

  5. #5
    Valve Developer
    Join Date
    Sep 2011
    Posts
    1,704
    Quote Originally Posted by lunarbreez View Post
    Code:
     in function 'GetUnitToLocationDistance'
    	...ota 2 beta\game\dota\scripts\vscripts\bots\utilities.lua:195: in function 'availablecamp'
    	...2 beta\game\dota\scripts\vscripts\bots\bot_alchemist.lua:25: in function <...2 beta\game\dota\scripts\vscripts\bots\bot_alchemist.lua:21>
    [VScript] Script Runtime Error: ...ota 2 beta\game\dota\scripts\vscripts\bots\utilities.lua:195: bad argument #2 to 'GetUnitToLocationDistance' (Vector expected, got table)
    stack traceback:
    is there anything changed with GetNeutralSpawners( ) or how lua deal with table[i] after update? the function I use to get distance from nearest camp now said it's a table and not vector, which works fine before the update.
    Sorry, I think that got missed in the notes -- it now returns an array of { name, location } tables rather than alternating values.

  6. #6
    Basic Member
    Join Date
    Dec 2016
    Posts
    180
    Get the range at which this unit will start to attack a target
    this is defferent with GetAttackRange() of course, for example ( I'm not sure ) outworld devourer range attack may differ with this two function.
    better to see other ideas ....

  7. #7
    Basic Member
    Join Date
    Jan 2013
    Posts
    1,547
    IsAncientCreep() should be renamed just IsAncient(), to be consistent with the custom game scripting API. It's also misleading, as some units are ancient hero-creeps. Nothing also prohibits in the future introduction of ancient wards, or mechanical units.

  8. #8
    Are the bots now fixed from the notes I put in the 7.00 bots thread? (Especially the default bots not using courier and the support bot(s) on Dire warding bugs)

  9. #9
    Basic Member
    Join Date
    Dec 2016
    Posts
    731
    Quote Originally Posted by ZzZombo View Post
    IsAncientCreep() should be renamed just IsAncient(), to be consistent with the custom game scripting API. It's also misleading, as some units are ancient hero-creeps. Nothing also prohibits in the future introduction of ancient wards, or mechanical units.
    IsAncient() would be confusing since "THE" Ancient is your base. There currently is a unit-scoped "IsFort()" which is how you check if a unit is THE Ancient, but probably that should be renamed to IsAncient(). IsAncientCreep() is more specific to focus on ancient neutral creeps. Just my 0.02.

  10. #10
    Basic Member
    Join Date
    Jun 2013
    Posts
    274
    Quote Originally Posted by nostrademous View Post
    IsAncient() would be confusing since "THE" Ancient is your base. There currently is a unit-scoped "IsFort()" which is how you check if a unit is THE Ancient, but probably that should be renamed to IsAncient(). IsAncientCreep() is more specific to focus on ancient neutral creeps. Just my 0.02.
    I agree with this reasoning.

Posting Permissions

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