Closed Keithenneu closed 7 years ago
Some of this is in already, although brittle. I need to create a wiki explaining the framework so it's easier for others to contribute. It will be here: https://github.com/Nostrademous/Dota2-FullOverwrite/wiki
Once I've chosen a target, how do I attack it? Including ult usage, and getting allies to help.
do...
if self:HasAction(ACTION_FIGHT) == false then print(utils.GetHeroName(bot), " - Fighting ", utils.GetHeroName(target)) self:AddAction(ACTION_FIGHT) self:setHeroVar("Target", target) end
I assume that's what you are asking..
Currently im adding ACTION_ATTACK, and set heroVar Target
to my chosen target.
The target is cleared by something just split seconds later though.
Edit:
I'm trying to use Target
to store my target while running towards it. It gets set to nil immediately, rendering it kinda useless. I'll try using GankTarget
for now.
If you set ACTION_FIGHT and set setHeroVar("Target", target) like you say you are... then the X:DoFight() in decision_tree.lua will be invoked
it's possible you are picking a target stand near their tower (within 750 units) so the bot kick into the GetEstimatedDamageToTarget() and thinks it can do 0 dmg probably since it is not "close" to the target which then hits the else self:RemoveAction(ACTION_FIGHT) self:setHeroVar("Target", nil) return false end
I would not call ACTION_FIGHT until you are near target... push ACTION_ROAM onto action stack and use X:DoRoam() instead to roam to the target and then invoke "ACTION_FIGHT" once you are there
That's what im doing actually. Just Target being cleared breaks it.
Is the target of roam standing under tower?
Nope. I'll try to find the exact function which invokes setHeroVar("Target", nil). That'll tell us more.
if myDmgToTarget > target:GetHealth() and towerDmgToMe < (bot:GetHealth() + 100) then
--print(utils.GetHeroName(bot), " - we are tower diving for the kill")
if target:IsAttackImmune() or (bot:GetLastAttackTime() + bot:GetSecondsPerAttack()) > GameTime() then
bot:Action_MoveToUnit(target)
else
bot:Action_AttackUnit(target, false)
end
return true
else
self:RemoveAction(ACTION_FIGHT)
self:setHeroVar("Target", nil)
return false
end
it probably doesn't think you can do enough damage to kill the target so it says don't fight and nil the "Target"
b/c it doesn't consider the damage from any Allies next to you... just your solo damage
I'm still in ACTION_ROAMING though
is the code checked in, in your fork?
Now it is.
lines 491 or 498 in decision_tree.lua probably doing it since "ShouldIFight()" is evaluated before ShouldIRoam
It's line 466. The utils function resets the target, if none is found.
okay, that clear is probably unnecessary in utils.FindTarget()
but fixing that I think you will then have it still cleared by 491 or MOST LIKELY 498 in decision_tree
So I just use GankTarget, and Target as soon as I'm close to it and switch do Action_Fight
right... best way to do that
however, you might find that you still don't attack until we add code for ally support since the code will probably estimate that you are not doing enough damage over the time (solo - since it doesn't consider allies for now) to get a kill and then stop fighting to fallback to last-hitting/laning
another way to fix it is for me to finish implementing "harassment" code as part of Laning so when you "roam" into a lane the code will know you are not a "Core" that requires last hits and instead focus you on harassment and creep deny
Thats true for full time roamers, but as a Jungler, I just want to kill someone and go back to farming. I'm not sure how to divide these classes of junglers. Maybe it's acutally ganking what I'm doing. Just like midlaners would. There are however junglers, who are something in between, like Chen (or Enigma, if times are hard.)
It just feels hard to put all this into a state machine.
don't get bogged down on that issue b/c:
It's kinda working now :) He's still a little suicidal, but that's just fine tuning.
Done.
I'd like to build some basic roaming, to allow Bloodseeker to get more active during the laning phase. What I want to do:
Are there any functions yet, to get data about lanes?:
This should yield good results and not be to hard to implement for now. Later on, this should be integrated with some overall tactic considerations and fighting logic.