Git Product home page Git Product logo

dota-2-building-helper's People

Contributors

aerohand avatar mnoya avatar musshorn avatar space-jam- avatar xavierchn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dota-2-building-helper's Issues

Large building bug when attacked.

Some melee units struggle to attack larger buildings (size 4+). The gridnav blockers seem to wig out the pathfinding, try changing using SetHullSize on buildings to overcome this.

Ability cost isn't charged with shift queue

The first cast gets charged (when you press the ability) so subsequent casts aren't charged any abilitycost - I've only got buildings with goldcost so not sure if that is related?

Random bug

Hi,

I have been using this library for quite a while now, and I roughly know how it all works (just small things that get me). When I build towers, sometimes randomly the building doesn't get built. And thereafter whenever I try to build it still doesn't build, I've tried to debug this and it seems to me that 2 things happen, 1st one is that is fails to get into the builders queue. Second one is that it gets into the builders queue, then it when it is supposed to call "move_to_xxx" it just fails. I have had limited success in trying to replicate then bug so I can see exactly what is going on.

If you have any idea to this I would greatly appreciate the help, if you would like to get hold of me you can drop an email at [email protected].

I would like to chat to you about the library, to get a full understanding of it, and to maybe help in the future.

Regards Rexex

SetHullRadius fix

building:SetHullRadius( size * 32 - 32 )

Seems to work ok. Add it to PlaceBuilding and InitializeBuildingEntity

how's the panorama transition going?

hey, how's the panorama transition going?

If it's not looking good, maybe the best route would be to just use AOERadius KV (GreenTD uses it and has been pretty successful) and wait for client-side world particles.

Also, BMD mentioned that we could probably override that particle to make it a square shape, and may even be able to get it to snap to the grid.

Issuing a move command to a different unit can stop building

Reproduce:

  1. Issue a build command to a worker
  2. While they are walking to it, issue a move command to another worker
  3. The initial worker clears all work and stops

Problem is in builder_queue, need to reconsider the concept of the player.activeBuilder I think.

Working example

Is it possible that you make a working .vmap example? The game does not show any warnings, function addbuilding and etc are called but nothing happens... my hero does not react to a command to build something.

Construction Cancelled

Construction Cancelled callback is being called everytime you right click, no matter what you do.

If a builder is killed while holding a ghost building or going to a build site the panorama ghost will remain.

If a builder is killed or removed from the game while holding a ghost building or going to a build site the client side panorama ghost will say on the client.

In addition to this activeBuilder needs to be checked for null in RegisterLeft and right click as below.

function BuildingHelper:RegisterLeftClick( args )
  local x = args['X']
  local y = args['Y']
  local z = args['Z']
  local location = Vector(x, y, z)

  --get the player that sent the command
  local cmdPlayer = PlayerResource:GetPlayer(args['PlayerID'])

  if cmdPlayer.activeBuilder:IsNull() then
    return
  end

  if cmdPlayer.activeBuilder:HasAbility("has_build_queue") == false then
    cmdPlayer.activeBuilder:AddAbility("has_build_queue")
    local abil = cmdPlayer.activeBuilder:FindAbilityByName("has_build_queue")
    abil:SetLevel(1)
  end

  if cmdPlayer then
    cmdPlayer.activeBuilder:AddToQueue(location)
  end
end

function BuildingHelper:RegisterRightClick( args )
  --get the player that sent the command
  local cmdPlayer = PlayerResource:GetPlayer(args['PlayerID'])

  if cmdPlayer and not cmdPlayer.activeBuilder:IsNull() then
    cmdPlayer.activeBuilder:ClearQueue()
    cmdPlayer.activeBuilding = nil
    cmdPlayer.activeBuilder:Stop()
    cmdPlayer.activeBuilder.ProcessingBuilding = false

    if cmdPlayer.activeCallbacks.onConstructionCancelled ~= nil then
      cmdPlayer.activeCallbacks.onConstructionCancelled()
    end
  end
end

OnConstructionCancelled still called once (erroneously) after construction

I noticed this when I added an ability refund to OnConstructionCancelled, which tends to mess with gameplay when buildings don't cost anything!
Not sure if anyone else was having this problem but I solved it by adding:

local builder = keys.caster
builder.work = nil

To OnConstructionStarted in abilities.lua

Ability Cooldown with Shift-Queueing

Skip completly the cooldown and the cost while Shift-Queueing. Possible to fix on my end by charging the player only when tower is complete but the cooldown is a big issue, even if I manually put the cooldown on it skip it anyway.

Also it be nice if the cooldown be triggered only when clicking the emplacement.

Important functions to add

BuildingHelper:PlaceBuilding(name, size, position)

  • Places a new building on full health and returns the handle. Places grid nav blockers for its size.
  • Skips the construction phase and doesn't require a builder, this is most important to place the "base" buildings for the players when the game starts.

BuildingHelper:UpgradeBuilding(building, name)

  • To use after an upgrade is acquired (new "tier" of a building).
  • Replaces the old building by a new one by name and keeps the same blockers and position.

Add :Interrupt() on build

builder:Interrupt() -- Stops any instance of Hold/Stop the builder might have

Add that to build.lua = Caster will now cast after previously being issued to (S)top or (H)old. This way we can still keep using CastAbility functions (even tho using ExecuteOrderFromTable could have other benefits)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.