Page 2 of 4 FirstFirst 1 2 3 4 LastLast
Results 11 to 20 of 35

Thread: Help To Analyze Crash Dump File Please

  1. #11
    Basic Member
    Join Date
    May 2014
    Posts
    270
    Quote Originally Posted by nostrademous View Post
    Well that's what the error seems to indicate with its error message. Also, it seems you want nearby enemies but you are requesting nearby allies
    Emmmm... So "BOT" in BOT:GetNearbyHeroes(nRadius, bool enemy, botMode) only used for the base location for querying nearby unit? I though that variable determine who's requesting the GetNearbyHeroes() function too because I have npcTarget as "BOT" there not npcBot. So the one who determine who's requesting the GetNearbyHeroes() function is the npcBot that's running the script where that code exist?. Well, if that's correct, I have to change some of codes. Sorry if my words are a bit confusing for you

  2. #12
    Basic Member
    Join Date
    Dec 2016
    Posts
    731
    Quote Originally Posted by arz_on4dt View Post
    Emmmm... So "BOT" in BOT:GetNearbyHeroes(nRadius, bool enemy, botMode) only used for the base location for querying nearby unit? I though that variable determine who's requesting the GetNearbyHeroes() function too because I have npcTarget as "BOT" there not npcBot. So the one who determine who's requesting the GetNearbyHeroes() function is the npcBot that's running the script where that code exist?. Well, if that's correct, I have to change some of codes. Sorry if my words are a bit confusing for you
    Okay, well 1) it doesn't seem to be the "space" as I test other LUA emulators and the space don't matter (at least in their implementation).
    2) you are right... disregard me ... it is 7am here and I just woke up.

  3. #13
    Basic Member
    Join Date
    May 2014
    Posts
    270
    Quote Originally Posted by nostrademous View Post
    Okay, well 1) it doesn't seem to be the "space" as I test other LUA emulators and the space don't matter (at least in their implementation).
    2) you are right... disregard me ... it is 7am here and I just woke up.
    No problem. Thanks for answering my question.

    So I have to give it a check first before do the loop, like "if tableNearbyEnemyHeroes ~= nil" ?
    Last edited by arz_on4dt; 02-08-2017 at 06:17 AM.

  4. #14
    Basic Member
    Join Date
    Dec 2016
    Posts
    731
    Quote Originally Posted by arz_on4dt View Post
    No problem. Thanks for answering my question.
    actually the fact you are using npcTarget as the BOT might be your issue. What if it's not valid b/c of handle drop? Check "not npcTarget:IsNull()" or some other check before using it because you obtain it form GetTarget() and it could be "nil" or invalid.

  5. #15
    Basic Member
    Join Date
    May 2014
    Posts
    270
    Quote Originally Posted by nostrademous View Post
    actually the fact you are using npcTarget as the BOT might be your issue. What if it's not valid b/c of handle drop? Check "not npcTarget:IsNull()" or some other check before using it because you obtain it form GetTarget() and it could be "nil" or invalid.
    Emmm, that make sense, but I already added some check. Here is my complete code
    Code:
    local npcTarget = npcBot:GetTarget();
    	if ( npcTarget ~= nil and CanCastIgniteOnTarget( npcTarget )   )
    	then
    		if ( npcTarget:GetActualIncomingDamage( nDamage, DAMAGE_TYPE_MAGICAL  ) > npcTarget:GetHealth() and GetUnitToUnitDistance( npcTarget, npcBot ) < ( nCastRange + 200 ) )
    		then
    			local tableNearbyEnemyHeroes = npcTarget:GetNearbyHeroes( nRadius, false, BOT_MODE_NONE );
    			local tableNearbyEnemyCreeps = npcTarget:GetNearbyCreeps( nRadius, false );
    			for _,h in pairs(tableNearbyEnemyHeroes) 
    			do
    				if GetUnitToUnitDistance(h, npcTarget) < nRadius and CanCastIgniteOnTarget( h ) 
    				then
    					return BOT_ACTION_DESIRE_HIGH, h;
    				end
    			end
    			for _,c in pairs (tableNearbyEnemyCreeps) 
    			do
    				if GetUnitToUnitDistance(c, npcTarget) < nRadius  and CanCastIgniteOnTarget( c ) 
    				then
    					return BOT_ACTION_DESIRE_HIGH, c;
    				end
    			end
    			
    		end
    	end
    I use that for Winter Wyvren splinter blast. She always targeting hero instead of creeps around her.

  6. #16
    Basic Member
    Join Date
    Dec 2016
    Posts
    731
    Checking npcTarget ~= nil is not enough since the handle destruction patch.

    try
    if npcTarget ~= nil and not npcTarget:IsNull() and CanCastIgniteOnTarget( npcTarget ) then

    although I doubt that's your issue. I would check what the table returned is too to make sure it's not nil. It should return {} if there were no nearby heroes, not nil
    Last edited by nostrademous; 02-08-2017 at 06:40 AM.

  7. #17
    Basic Member
    Join Date
    May 2014
    Posts
    270
    Quote Originally Posted by nostrademous View Post
    Checking npcTarget ~= nil is not enough since the handle destruction patch.

    try
    if npcTarget ~= nil and not npcTarget:IsNull() and CanCastIgniteOnTarget( npcTarget ) then

    although I doubt that's your issue. I would check what the table returned is too to make sure it's not nil. It should return {} if there were no nearby heroes, not nil
    Okay, I'll try it.
    Sorry to bother you, but what about this question http://dev.dota2.com/showthread.php?...=1#post1419107

  8. #18
    Basic Member
    Join Date
    Dec 2016
    Posts
    731
    Quote Originally Posted by arz_on4dt View Post
    Is it just wrong to put other function ( that do other thing than leveling up ability ) inside AbilityLevelUpThink() since it's only used to leveling up ability?
    That's completely up to you. I would advise against it if you are working with anyone else as it will confuse them. If you are solo developing this then it doesn't matter although it is bad practice. Also, I'm not as familiar with mode-level bot over-write as I've exclusively done full over-write; but you have to consider the frequency that AbilityLevelUpThink() is going to be called at as it is possible it will only get called when you have "leveled up" which means anything else you put in there will only get called at those times too.

  9. #19
    Basic Member
    Join Date
    May 2014
    Posts
    270
    Quote Originally Posted by nostrademous View Post
    That's completely up to you. I would advise against it if you are working with anyone else as it will confuse them. If you are solo developing this then it doesn't matter although it is bad practice. Also, I'm not as familiar with mode-level bot over-write as I've exclusively done full over-write; but you have to consider the frequency that AbilityLevelUpThink() is going to be called at as it is possible it will only get called when you have "leveled up" which means anything else you put in there will only get called at those times too.
    Ok I understand. By the way, the problem before is still exist even though I add IsNull() check. OMG, it makes me so confused..

  10. #20
    Basic Member
    Join Date
    Dec 2016
    Posts
    731
    Quote Originally Posted by arz_on4dt View Post
    Ok I understand. By the way, the problem before is still exist even though I add IsNull() check. OMG, it makes me so confused..
    Well, clearly "npcTarget:GetNearbyHeroes( nRadius, false, BOT_MODE_NONE );" is failing for you and returning "nil". Please verify that is the case. Then we can brainstorm why that happens.

Posting Permissions

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