Nostrademous / Dota2-FullOverwrite

Work in progress for a full-overwrite Dota 2 bot framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

defense is broken (again?)

Keithenneu opened this issue · comments

gotta fix this before I can move on to pushing.

Yeah, I noticed it isn't working. Also noticed that using TPs is not working.

At least no more crashes.

I'll fix TP use as soon as I verify that all my updates to Invoker (ported him to the same ability Use format as all the other heroes) is bug-free.

Looks like the usage of enemy_data is the issue.
How is it supposed to work now? Without enemy.Obj I suppose?
utils.ValidTarget(enemy) crashes with attempt to call method 'IsNull' (a nil value) though.
All I need to get is the location. utils.ValidTarget(enemy) ensures that I can call enemy:GetLocation(), right?

yeah. enemy.Obj doesn't exist. It was causing all kinds of crashes with illusions in prior code.

utils.ValidTarget(hUnit) ensure you have a valid target that can have all the API's on it called.

So enemy_data won't contain any handles, and I have to get them myself?

yeah, just use GetUnitList() for that. enemy_data will contain info about enemies (index/based-of enemy Player IDs) such as what items they had last time we saw them, etc.

K

In defendlane.lua:

function X:OnStart(myBot)
    local bot = GetBot()
    bot.defendLane = true
end

However, bot.defendLane is also the mode implementation.
I'll just rename the variable for now. But getting a wider solution might become necessary.

Edit: Can't find a place where the variable is used oO

I think we just need a standardized naming convention so we don't trample on each other.

about to push some changes to fix TP use - FYI

PR #185 should hotfix defense.
Still needs lots of improvements.