Current issues with implementing building ghost
I spent a lot of time today and yesterday trying to get building ghost going, without much success. So far, here's what we got:
Essentially this integrates with my BuildingHelper library, and prints out closed and open squares in an area around the cursor according to the building size.
The current BIG problem with building ghost is getting the target point AND the time the user clicked the ability. You can have one or the other, but not both. For example, you can have a
DOTA_ABILITY_BEHAVIOR_TOGGLE which is fine for getting the time the user clicked the ability, but then you have no target point. If you have a
DOTA_ABILITY_BEHAVIOR_POINT ability, you have the target point, but no idea when the ability click occurred.
If you try combining them, like
DOTA_ABILITY_BEHAVIOR_POINT | DOTA_ABILITY_BEHAVIOR_TOGGLE, _POINT will be overridden.
DOTA_ABILITY_BEHAVIOR_POINT | DOTA_ABILITY_BEHAVIOR_IMMEDIATE immediately gives you the point of the cursor.
DOTA_ABILITY_BEHAVIOR_POINT | DOTA_ABILITY_BEHAVIOR_NO_TARGET doesn't work either.
So then I tried force casting a _POINT ability with
CastAbility right after the user casted a _TOGGLE. This unfortunately just immediately gives you the cursor position. Same thing with
Then I tried putting
hero:GetCurrentActiveAbility() in a timer, hoping it would fire when the _POINT ability was clicked. It did not, and only fires during the phase part (i.e. the part where the point has already been selected by the player, and the hero is moving towards that point). I tried this same idea with ability:IsActivated(), no luck.
Next with Flash I tried listening to
globals.Loader_actionpanel.gameAPI.OnAbilityClicked, which only fires if the user clicks the ability with the mouse, and not otherwise.
Another different approach would be to use a _TOGGLE, and get the first left click of the user. But I don't think we can get normal mouse clicks through flash?
Ultimately if we're able to get the time BEFORE the 'phase' stage of the point ability, then we can move forward implementing building ghost. :biblethump:
Treat everyday as if you are a student, not a master. The student learns, grows and sees beauty. The master becomes bitter, resentful, and stagnates.