Results 1 to 3 of 3

Thread: Questions regarding dota_bot_reload_scripts

  1. #1
    Basic Member
    Join Date
    Jan 2017
    Posts
    25

    Questions regarding dota_bot_reload_scripts

    I have found out some unexpected behaviors regarding dota_bot_reload_scripts.

    1) For "built-in" scripts like ability_item_usage_generic.lua, the code will get reloaded even without calling dota_bot_reload_scripts. Although it's not reloaded soon after saving, but rather at the game engine's own schedule.
    2) For other scripts, like if I have a helper.lua and require it in the script file, it will not get reloaded, even after calling dota_bot_reload_scripts. The only way to reload this script is on game restart.

    Is it possible to also reload the scripts in 2)? Either like in 1) or by calling dota_bot_reload_scripts

  2. #2
    Basic Member
    Join Date
    Nov 2015
    Posts
    108
    Modules loaded with require() are stored in the package.loaded table. You may be able to do something to this effect to force a reload. I haven't tested it other than printing package.loaded.modulename to see values.

    Code:
    package.loaded[GetScriptDirectory().."/filename"] = nil
    ModuleVar = require( GetScriptDirectory().."/filename")
    Last edited by ironmano; 03-19-2017 at 10:37 AM.

  3. #3
    ive never come across an issue like this, that I know of.

    I just put `require( GetScriptDirectory().."/filename")` in places I need to use that file contents and reload_scripts seems to reload everything fine
    https://github.com/ThePianoDentist/t...dentistdotabot Lina bot which pulls small camp when 'laning' (Aim to work on pulling and stacking bots initially)
    https://github.com/ThePianoDentist/dotabots-ml-tools Parsing data from bot games

Posting Permissions

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