Enable cheat dota 2 bot command

Enable cheat dota 2 bot command

Enable cheat dota 2 bot command

Dota 2 AI Quick Start

Dota 2 7.00 (The New Journey) introduced Bots API, which is quite good news for people like me. I am a fan of the game but I never manage to have enough skills or APM to compete with online players. So being able to write my own bots must be a lot of fun. However the official document is very bare bone and unfriendly for people who are new to Dota 2 modding. So here is a simple quick start for people who want to start writing Dota 2 bots.

Your Working Directory

Find your Dota 2 installation directory, let’s call it $DOTA . Go to $DOTA\dota 2 beta\game\dota\scripts\vscripts and you will find a bots_example directory. Make a copy of that, rename it to bots — all bots code resides inside that directory. If you start a practice match with bots, it should read bot scripts from that location.

Now you can take a look at official reference (minus the reference, just read the introduction). Here is TL;DR:

  1. Bot scripts can be either overr >$DOTA\dota 2 beta\game\dota\scripts\npc , which is a good reference. Game item names can be found here, which is not mentioned on the wiki.

Start a Bot vs. Bot Match

Enable Dota 2 console by adding – console launching options.

For bot vs. bot match to work, the example script need to be modified. Open hero_selection. lua and you can see the script tries to select 0-4 for radiant and 5-9 for dire. However, this is only true if you are in the game. For bot vs. bot match, 0-1 is reserved (maybe for coaches?) so radiant is 2-6 and dire is 7-11 .

Create a lobby (Play Dota -> Create Lobby) and edit lobby settings. Choose Local Dev Script for Radiant and choose any difficulty except none. Also tick Enable Cheats.

Make yourself either a coach or unassigned player and start the match.

Speed Up Development

Show console: after you have added – console launch options, you can toggle console with a hotkey (default is \ ). You can find all the debug info in console, including your print() statement in Lua script, which is very useful.

Reload code: after you change your bot scripts, it will not automatically reload if you have an on-going game. You can use dota_bot_reload_scripts command in console to reload your bot scripts. The is the single most important trick I’ve learned and I am surprised that it is not mentioned in the wiki.

Also please note there is a bug in recent Dota 2 (as of writing) that will crash the game if reload bot scripts in bot vs. bot lobby game. So for now you can start a practice match instead.

Speed up game: if you are testing your bot strategies, you might want to speed up the game. Use host_timescale 4.0 to make the game run at 4x speed. You can change the 4 to anything you prefer. You have to enable cheats to achieve this (use sv_cheats 1 ).

Thread: Test/Cheat Commands

Thread Tools
Display
  • Linear Mode
  • Switch to Hybrid Mode
  • Switch to Threaded Mode

Test/Cheat Commands

Test/Cheat Commands
When hosting practice match, you’ll need to “enable cheats” for these to work.
When in game, press enter and type.

Command Example Equivalent Console Command Description/Notes
-lvlup n -lvlup 9000 dota_hero_level n Levels up your hero.
-levelbots n -levelbots 5 dota_bot_give_level n Levels up all bots.
-gold n -gold 15000 dota_give_gold Gives you gold.
-refresh -refresh dota_hero_refresh Resets cooldowns and gives full hp/mana. Enable cheat dota 2 bot command
-respawn -respawn dota_hero_respawn Respawns your hero.
-spawncreeps -spawncreeps dota_spawn_creeps Spawns creeps instantly.
-spawnneutrals -spawnneutrals dota_spawn_neutrals Spawns neutrals instantly.
-disablecreepspawn
-enablecreepspawn
-disablecreepspawn
-enablecreepspawn
dota_creeps_no_spawning_enable
dota_creeps_no_spawning_disable
Disables lane creep spawning. Use – enablecreepspawn to undo this change.
-startgame -startgame dota_start_game Sets timer to 0:00, creeps spawns. game starts.
-allvision
-normalvision
-allvision
-normalvision
dota_all_vision_enable
dota_all_vision_disable
Gives vision for both teams. Use – normalvision to undo this change.
-clearwards -clearwards dota_clear_wards Destroys all wards.
-wtf
-unwtf
-wtf
-unwtf
dota_ability_debug_enable
dota_ability_debug_disable
Removes cooldown, Mana cost etc. Use – unwtf to undo this change.
-dumpbots -dumpbots dota_bot_dump_state Displays AI status.
-timescale n host_timescale
-createhero [enemy] -createhero npc_dota_hero_antimage
-createhero npc_dota_hero_antimage enemy
-createhero antimage
-createhero anti
-createhero npc_dota_goodguys_siege
-createhero goodguys_siege enemy
dota_create_unit Creates the specified unit [as an enemy].

You can create up to 5 Dire heroes with this command, and up to 22 heroes in total.
The prefixes behind the defining hero/unit names can be left out like in the given examples.
The hero names can also be truncated. -item -item item_blink dota_create_item Gives the specified item.

Warning: Do not use uppercase. Give it a try to see what happens. -givebots -givebots item_blink dota_bot_give_item Give all bots the specified item.

List: See above. -ping -ping dota_ping Displays ping time with server along with the packet loss information.
This command can be used in a non-cheat game, too. -spawnrune -spawnrune dota_spawn_rune Spawns an intermediate rune.
Spawn spot and/or the rune type cannot be manipulated.

An alphabetical item list provided by bridger.

If you know more commands/console commands, please let me know. I will add them in here.

Special thanks to ThoAppelsin and budwing for providing some updates to the list.

Last edited by CvP; 02-15-2014 at 10:46 PM .

Enable cheat dota 2 bot command

Leave a comment

Design a site like this with WordPress.com
Get started