• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

How to check if unit uses ability "Hide" (like night elf warriors that make unit invisible at night when he doesn't move)?

Status
Not open for further replies.
Level 1
Joined
Nov 25, 2022
Messages
1
I want to make some abilities that give a hero bonus when he is invisible, is there ability to check that? Because Hide ability doesn't use any buff
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
It depends entirely on what is making the unit invisible/hidden. Their own ability? Shadowmeld? Windwalk? Sorceress cast invisibility on them? Permanent Invis?

Detect if a unit is invisble under Shadow Meld is old but hints at a possible solution:

You could move a different locusted dummy unit owned by Neutral Hostile with an actual sight range of like 50 or something onto the position of the potentially-invisible unit check IsUnitVisible against Netural Hostile. I expect that a hidden unit would return false and a visible unit would return true. By using NH you don't have to worry about revealing part of the map for a player, but you could probably use an unused player slot for the same purpose.
 
Status
Not open for further replies.
Top