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

Thread: February 15 Bot Update

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

    February 15 Bot Update

    • Protected Action_AttackUnit() and Action_AttackMove() against being called too quickly.
    • Fixed the default bots from charging out of the fountain early.
    • Fixed default bots not using the courier.
    • Fixed ActionImmediate_Courier() not selecting a default courier correctly.
    • Fixed bots getting stuck on when warding dire top rune.


    Additionally, I've added a new way for hero-specific scripts to chain to the generic implementation while preventing the generic implementation from being shared between all heroes using hero-specific scripts.

    The new boilerplate code is:

    In your generic file top:
    Code:
    -------------------
    BotsInit = require( "game/botsinit" );
    local MyModule = BotsInit.CreateGeneric();
    -------------------
    In your generic file bottom:
    Code:
    -------------------
    return MyModule;
    -------------------
    In your hero-specific file top: (replacing the generic script name appropriately)
    Code:
    mode_laning_generic = dofile( GetScriptDirectory().."/mode_laning_generic" )
    Then in your hero-specific code, you can just call things like mode_laning_generic.OnStart() and it should work, and that generic instance is specific to that hero.

    All the previous boilerplate (https://developer.valvesoftware.com/...ntation_in_Lua) will still work as it did before, but the above is now the recommended method, and the wiki will be updated with it shortly.

  2. #2
    Basic Member
    Join Date
    Jun 2013
    Posts
    274
    I expected something like this would happen eventually. Newer versions of Lua no longer have module() either.
    I was pretty much doing something similar with custom functions to avoid using the generic files, but I believe I can transition back over with this new method.

    Will the "game" folder be properly added to uploaded too when uploading a bot script? I was under the impression it was everything in the "bots" folder.
    Last edited by Cornbane; 02-15-2017 at 05:38 PM.

  3. #3
    Nice.

  4. #4
    Basic Member
    Join Date
    Dec 2016
    Posts
    123
    A quick test of new update, Action_AttackUnit() is finally fixed.

    Can't wait taking advantage of all update during this week and make my bot better.

  5. #5
    Valve Developer
    Join Date
    Sep 2011
    Posts
    1,704
    Quote Originally Posted by Cornbane View Post
    I expected something like this would happen eventually. Newer versions of Lua no longer have module() either.
    I was pretty much doing something similar with custom functions to avoid using the generic files, but I believe I can transition back over with this new method.

    Will the "game" folder be properly added to uploaded too when uploading a bot script? I was under the impression it was everything in the "bots" folder.
    I believe it should be able to find it even for uploaded games. It's shipped with the depot and I think it always searches for files under dota/scripts/vscripts.

  6. #6
    Basic Member
    Join Date
    Dec 2016
    Posts
    123
    Thank you Cornbane ! Guess that's what I missed.
    Last edited by lunarbreez; 02-16-2017 at 08:18 AM.

  7. #7
    Basic Member
    Join Date
    Jun 2013
    Posts
    274
    Yeah it missed the update notes.

    You'd now do: tableNeutral[1].name and tableNeutral[1].location

  8. #8
    Basic Member
    Join Date
    Jan 2014
    Posts
    57
    Thanks Again! Now default bots are much more challenging! (even for community bots)

  9. #9
    Basic Member
    Join Date
    Jan 2017
    Posts
    25
    mode_laning_generic = dofile( GetScriptDirectory().."/mode_laning_generic" )

    Will this work for Mac? I believe the previous require approach will resolve to a wrong path on Mac

  10. #10
    Basic Member
    Join Date
    Dec 2016
    Posts
    180
    Thanks for this update Chris

    how we can share variables between bots. for example i want to set antimage in my team as carry. this cannot be done by using mode_..._antimage because others cant access this script. however, i define lua file called Team_assignments.lua to do this, saving tables and variables to save these basic settings.

    is there any better way to handle this?

Posting Permissions

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