Indeed thanks Santi that's what I meant. For example if the AI bot
spots a hydralisk at some point, then later on sees a lurker with the
same unit pointer, it can automatically deduce that the enemy got one
less hydralisk (and one more lurker). It is thus particularly easy to
keep track of the enemy army composition and prevent him from "faking"
having additional units.
> 2) did you try ->exists()? In the case the latter doesn't do, you
could also check if ->getHitpoints() > 0 (I am not sure if there is -
>isAlive()...)
Last time I checked getHitPoints() is always > 0 during both the
onUnitEvade and onUnitDestroy callbacks. I'm not sure exists() is 100%
appropriate for enemy units, since the doc states "if exists() returns
false and the unit is not owned by self(), then the unit may or may
not exist" which seems a little ambiguous. isAlive() doesn't exist,
unfortunately :-p
On Sep 24, 12:29 pm, Santi Ontañón <
santi.onta...@gmail.com> wrote:
> On sep 24, 2011, at 6:25 p.m., Krasimir Krystev wrote:
>
> > hey
> > 1) When a unit goes in the FoW, many of its attribs become unknown, including its position or used to last time I checked.
>
> Sure, but what Simon means is that when it becomes available again, you know it's the same unit as before. So, the AI does not have to reason about whether it's the same unit as before, or it's a new unit.
>
>
>
>
>
>
>
> > 2) did you try ->exists()? In the case the latter doesn't do, you could also check if ->getHitpoints() > 0 (I am not sure if there is ->isAlive()...)
>
> > BR
>