Results 1 to 2 of 2

Thread: GetUnitList() and GetNearbyHeroes() return different value about illusions

  1. #1
    Basic Member
    Join Date
    Dec 2016
    Posts
    121

    GetUnitList() and GetNearbyHeroes() return different value about illusions

    Code:
    Code:
    local NearbyEnemyHeroes = npcBot:GetNearbyHeroes(1000 , true, BOT_MODE_NONE );
    	local HeroNum = #NearbyEnemyHeroes;
    	if (HeroNum > 0) then
    		print('HeroNum='..HeroNum);
    		for k, hero in pairs(NearbyEnemyHeroes) do
    			if (hero:IsIllusion()) then
    				print('there is a illusion in NearbyEnemyHeroes');
    			end
    		end
    	end
    	local EnemyHeroes = GetUnitList(UNIT_LIST_ENEMY_HEROES);
    	local EnemyNum = #EnemyHeroes;
    	if (EnemyNum > 0) then
    		print ('EnemyNum = '..EnemyNum);
    		for k, hero in pairs(EnemyHeroes) do
    			if (hero:IsIllusion()) then
    				print('there is a illusion in NearbyEnemyHeroes');
    			end
    		end
    	end

    Result when I use naga siren and its illusion aprroach test hero:
    Code:
    [VScript] EnemyNum = 4
    [VScript] HeroNum=1

    So in a real pvp game we determine illusion by extra damage it takes when attack/cast spell on it or less damage it produce when attacking.

    But in a bot game I can't get the actual damage result from a single action. For example I can store the current health of enemy hero, calculate how many hp it lost(delta_hp) during past x sec, but I can't get how many hp enemy unit loses just because my right click hit it, the target may take other damage from eslewhere when I performing the attack action, so I can't compare it(delta_hp) to GetActualIncomingDamage(rightclick, DAMAGE_TYPE_PHYSICAL) to see if unit is an illusion and is taking extra damage or not.And as above showed, IsIllusion() didn't work on enemy hero. So if you are using GetUnitList() to calculate how much rawoffensive power enemy has around certain place, or how many net worth enemy team has, remember each illusion will be calculate as a real hero, and there is no way a bot can tell whether it is a illusion or not.

  2. #2
    Basic Member
    Join Date
    Dec 2016
    Posts
    524
    That explains why my bots always attack the real heroes regardless of illusions. GetUnitList() for the win.

Posting Permissions

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