Skip to content
Martin Noya edited this page Jan 26, 2016 · 5 revisions

Building abilities

Using the various KeyValues and builder.lua callbacks gives you plenty of options to easily place buildings.
If you think some feature is missing or could be improved, don't hesitate to open an issue to request it.

Lua API

The library lua has many internal functions that aren't meant to be used outside of the system freely, while others were written specifically for that, to implement other custom systems based on the BH server Grid. Keep in mind the server grid isn't networked to the clients, the clientside grid is implemented through entity detection and as such, there can be discrepancies in the way the grid is displayed on the UI and its real state.

Core

  • BuildingHelper:PlaceBuilding(player, name, location, construction_size, pathing_size, angle)
  • BuildingHelper:UpgradeBuilding(building, newName)
  • BuildingHelper:GetConstructionSize(unit)
  • BuildingHelper:GetBlockPathingSize(unit)
  • BuildingHelper:SnapToGrid(size, location)
  • BuildingHelper:AreaMeetsCriteria(size, location, grid_type, option)
  • BuildingHelper:MeetsHeightCondition(location)
  • BuildingHelper:GetCellGridTypes(x, y)
  • BuildingHelper:CellHasGridType(x, y, grid_type)
  • DrawGridSquare(x, y, color)
  • IsBuilder(unit)
  • IsCustomBuilding(unit)

Use with caution

  • BuildingHelper:RemoveBuilding(building, bSkipEffects)
  • BuildingHelper:BlockGridSquares(construction_size, pathing_size, location)
  • BuildingHelper:BlockPSO(size, location)
  • BuildingHelper:AddGridType(size, location, grid_type, shape)
  • BuildingHelper:RemoveGridType(size, location, grid_type, shape)

Map Blockers

Apart from using blocked gridnav terrain to define non-buildable areas, you can also define areas blocked for construction without blocking any pathing. This is done as follows:

  1. Creating a block in Hammer (Shift+B) using the trigger material
  2. Tying it to a trigger_dota entity (Ctrl+T)
  3. Name the entity with the keyword bh_blocked

The shape can only be a rectangle and should not be rotated. If you need different shapes, use more rectangles.

Clone this wiki locally