Results 1 to 6 of 6

Thread: Mirana's Arrow will be consider in GetIncomingTrackingProjectiles()

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

    Mirana's Arrow will be consider in GetIncomingTrackingProjectiles()

    It will return a nil value for .caster
    Found this when I try to code for dodging linear projectile.

    And a suggestion for linear projectile, once it be seen, bot won't lose track of its information. It's like people won't think pudge hook or mirana arrow are not there because it get behind trees for 0.x sec. What my bot doing right now is start dodge when he see the arrow is released, stop dodge because the arrow pass behind trees and get shoot on his head.
    Code:
    [VScript] try dodge projectile
    [VScript] cant dodge after calculation, desperate
    Last edited by lunarbreez; 02-27-2017 at 07:03 PM.

  2. #2
    Basic Member
    Join Date
    Dec 2016
    Posts
    733
    Quote Originally Posted by lunarbreez View Post
    And it will return a nil value for .caster
    Found this when I try to code for dodging linear projectile.
    I wonder what separates "tracking" from "non-tracking" projectiles in the code implementation. Certain abilities can be ground-target and unit-targeted (like Mirana's Arrow, or Lion's Earth Spike). It would be interesting to know if it still shows up at "tracking" if used with ground-targeting (aka POINT).

  3. #3
    Basic Member
    Join Date
    Dec 2016
    Posts
    123
    Quote Originally Posted by nostrademous View Post
    I wonder what separates "tracking" from "non-tracking" projectiles in the code implementation. Certain abilities can be ground-target and unit-targeted (like Mirana's Arrow, or Lion's Earth Spike). It would be interesting to know if it still shows up at "tracking" if used with ground-targeting (aka POINT).
    I was using mirana and I know I was aimming the ground not the bot, so yes it still gets into tracking projectile no matter how.

  4. #4
    Valve Developer
    Join Date
    Sep 2011
    Posts
    1,704
    Do you have any simple code that demonstrates GetIncomingTrackingProjectiles() returning Mirana's Arrow? I'm definitely not seeing that.

  5. #5
    Basic Member
    Join Date
    Dec 2016
    Posts
    123
    Quote Originally Posted by ChrisC View Post
    Do you have any simple code that demonstrates GetIncomingTrackingProjectiles() returning Mirana's Arrow? I'm definitely not seeing that.
    Sorry...I guess is mirana's auto attack that cause the error, not the arrow. He lose my vision when my auto attack is tracking him. So get a nil for caster.

    Code:
    function Think()
    local npcBot = GetBot();
    npcBot:Action_MoveToLocation(GetRuneSpawnLocation( RUNE_BOUNTY_1 ));
    local TableProjectiles = npcBot:GetIncomingTrackingProjectiles();
    	local nearestprojectile = nil;
    	local lowest_distance = 9999;
    	for k, Projectile in pairs(TableProjectiles) do
    		if (GetUnitToLocationDistance( npcBot, Projectile.location) < lowest_distance and Projectile.caster:GetTeam() ~= GetTeam() ) then
    			lowest_distance = GetUnitToLocationDistance( npcBot, Projectile.location);
    			nearestprojectile = Projectile.ability;
    		end
    	end
    end

    [VScript] Script Runtime Error: ...beta\game\dota\scripts\vscripts\bots\bot_bloods eeker.lua:8: attempt to index field 'caster' (a nil value)
    stack traceback:
    ...beta\game\dota\scripts\vscripts\bots\bot_bloods eeker.lua:8: in function <...beta\game\dota\scripts\vscripts\bots\bot_blood seeker.lua:1>
    [VScript] Script Runtime Error: ...beta\game\dota\scripts\vscripts\bots\bot_bloods eeker.lua:8: attempt to index field 'caster' (a nil value)
    stack traceback:

  6. #6
    Valve Developer
    Join Date
    Sep 2011
    Posts
    1,704
    Ah, currently caster only works for non-nomal attacks. I'll update it so that it works for normal attacks too.

Posting Permissions

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