Page 2 of 2 FirstFirst 1 2
Results 11 to 18 of 18

Thread: March 30 Bot Update

  1. #11
    Basic Member
    Join Date
    Dec 2016
    Posts
    598
    Quote Originally Posted by arz_on4dt View Post
    Any suggestion how to optimize the code? I do exactly like ChrisC's ability_item_usage_lina.lua bots example. Which one better, passing variable like nearby creeps or heroes to function or get that data in each function. I'm afraid if I'm caching the variable handle and the handle destroyed it will lead to script error even crashing. Do actually GetBot() ever destroyed?
    It is faster to cache it and pass it as an arg to functions. When you iterate the list in function just check that the "not hUnit:IsNull()"

  2. #12
    Basic Member
    Join Date
    May 2014
    Posts
    226
    OK. Thank you for the suggestion . I'll change my code. So, is it considered as caching if I put this "local tableNearbyEnemyHeroes = npcBot:GetNearbyHeroes( nCastRange, true, BOT_MODE_NONE );" in AbilityUsageThink() and the pass it to some function call like this castDCDesire, castDCTarget = ConsiderDeathCoil(tableNearbyEnemyHeroes); ?
    Last edited by arz_on4dt; 04-01-2017 at 04:51 AM.

  3. #13
    Basic Member
    Join Date
    Dec 2016
    Posts
    598
    It would be only really caching if you passed that table to other functions as well. If ConsiderDeathCoil() is the only function to use that table, then it is better to acquire it as you need it.

    To truly cache you could do:
    npcBot.nearEnemies = npcBot:GetNearbyHeroes(1600, true, BOT_MODE_NONE)

    Then use that variable everywhere you need access to your enemies by doing the IsNull check as well as a range check to fit the range you want to consider.

    There is some downsides to that, but it is the fastest way, especially if you had your own wrapper to make aquiery of the table a JIT call.
    Last edited by nostrademous; 04-01-2017 at 05:27 AM.

  4. #14
    Basic Member
    Join Date
    Jan 2014
    Posts
    46
    Fixed some crashes related to bot AI.
    ^In the latest main client update.

  5. #15
    Quote Originally Posted by Riveon View Post
    ^In the latest main client update.
    It's actually broke the bot experiment script for me; they don't stay near the shrines when activated anymore...

  6. #16
    Basic Member
    Join Date
    Oct 2016
    Posts
    160
    Arz may have changed his code, im using his old code and they still stay near the shrine for me.

  7. #17
    Quote Originally Posted by Yavimaya View Post
    Arz may have changed his code, im using his old code and they still stay near the shrine for me.
    His latest is at 1st April and it was working fine, until the "Fixes related to bot AI" broke it and prevented the bots from staying near the shrine when activated.

    Edit: This seems fixed now.
    Last edited by DreadedGhoul575; 04-08-2017 at 04:16 AM.

  8. #18
    20170409012537_1.jpg

    Erm, guys, default bots don't level up all their talents, please fix.

Posting Permissions

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