Is unit visible to player?

s3rius

Linux is only free if your time is worthless.
Reaction score
130
I am in need of a condition that tells me whether a unit is visible to a certain player.
I've found the boolean condition IsUnitVisible, but that doesn't tell me whether the unit is in the sight range of a player, but only whether it's in the acquisition range of that certain player's units.

So, when I have a unit that has a sight range of 1000 and a acquisition range of 200, then IsUnitVisible will only be true when it's closer than 200. But I want it to be at 1000. (changing acquisition range is not an option, unfortunately).

Thanks to any helpers.

Edit: I've also tried IsUnitFogged. But that strangely also uses acquisition range, not sight range ~.~
 

Crusher

You can change this now in User CP.
Reaction score
121
hm i perhaps think that you can create an triger basse on faerie fire,or base it on something other... use shade ability and set range to your wish...:p
 

s3rius

Linux is only free if your time is worthless.
Reaction score
130
hm i perhaps think that you can create an triger basse on faerie fire,or base it on something other... use shade ability and set range to your wish...:p

And how should that help me?
 

s3rius

Linux is only free if your time is worthless.
Reaction score
130
dummy unit mabye?

That would sometimes result in more than 100 dummy units which all would have to have a reference to their "originals"

I am trying to create a Movement AI for my survival map. And the creeps should preferably attack players they already see. The only way that I could think of is with that InUnitVisible.
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
why not just using acquision range then?
it does the same thing....
 

Somatic

You can change this now in User CP.
Reaction score
84
They would attack enemies within their "Aquistion" Range as thats the range they will start to attack the enemy, be it whether they do see or not, unless you fix the aquistion range and the sight range to be the same.
 

s3rius

Linux is only free if your time is worthless.
Reaction score
130
Well, there are two problems.
1) By adding a high acquisition range the creeps will automatically attack the unit with least HP - which I don't want them to do.

2) There are not only the player's heroes on the map, but also different kinds of barricades. The creeps would also attack them (since they also have very few HP). And I only want them to attack barricades when they're "passing through" them. Thus I need to keep the acquisition range at <200.


IsUnitVisible also works a bit different. With it I can determine which heroes are visible to a player - not to a single unit of a player.
If, for example, Creep A is at the south end of the map, and Creep B at the north end: Then creep A spots an enemy, creep B, although he is faar away, will more likely attack this spotted enemy than anyone else.
So I am controling my creeps via triggers and I don't want them to use their usual "AI"
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
then why not use IsUnitVisible in the opposite way?
just make it ignore the rest in case they are in their acquision range (unless the distance is below 200)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top