Skip to content
Axosh edited this page Aug 21, 2021 · 6 revisions

Credits

This would have taken forever to do as an individual coder, so I need to make sure to give credit where it is due up front. I heavily leaned on a lot of existing open-source mods and libraries, in some cases lifting entire chunks of code from them:

How Do I Run This Addon?

If Dota2 is installed in the default location, then you'll want to put the contents of:

  • game here: C:\Program Files (x86)\Steam\steamapps\common\dota 2 beta\game\dota_addons\avalore
  • content here: C:\Program Files (x86)\Steam\steamapps\common\dota 2 beta\content\dota_addons\avalore

Install Dota2 Workshop Tools, then launch that. Then open:

C:\Program Files (x86)\Steam\steamapps\common\dota 2 beta\content\dota_addons\avalore\maps\avalore.vmap

in Hammer. You should be able to just run this out of the box without building.

Where To Get Started with Dota2 Addons?

You'll want to load all the code up in some editor - personally I like using Visual Studio Code, but Sublime Text is also popular. Within Visual Studio Code, I use a couple of extensions that help:

  • dota-reborn-code -- this gives you some intellisense about Dota API functions
  • Lua (Linter) -- one of the popular lua linters to help avoid stupid syntax mistakes

addon_game_mode.lua is going to be the basic starting point where the main game loop runs and everything gets setup/initialized.

Check out the Valve Dota Dev Wiki, particularly the scripting api to get a general idea of what functions are available.

Other Useful Stuff

This Project

Framework Files

  • addon_game_mode.lua -- primary game loop, initialization, etc.
  • constants.lua -- constants to make values easily changeable throughout the code, and more searchable
  • events.lua -- code for dota engine events that get registered in addon_game_mode.lua
  • score.lua -- score object for keeping track of score, stats, etc.
  • spawners.lua -- object for keeping track of spawners and handling custom spawning
  • utility_functions.lua -- static functions for doing common tasks

Specific Sections

  • items
  • modifiers
  • game rounds logic
  • npc txt files
  • panorama & ui

Clone this wiki locally