• 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.

Unit only visible in fog of war

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,338
Hi,

Is there a way to make a building only "visible" in the fog of war? That is when players are actually in vision, they see nothing. But when they move out of vision, the building's model will appear in the fog of war (imagine a mirage or something like that). Preferably would like this possible without triggers...
 
Level 25
Joined
May 11, 2007
Messages
4,650
Yes triggers will be needed.

[Event]Every X amounts of seconds.

[Actions]Check distance between your units and the building.
If distance <= unit visibility range:
set hideBuilding = true;

if hideBuilding
hide Building
else
unhide Building
 
Level 25
Joined
May 11, 2007
Messages
4,650
But he didn't want them to become transparent, he wanted to hide them..
And it's for a building or unit in the fog of war, and buildings and units in the fog of war are unselectable by default, so there is no need to add locust to them.
 
But he didn't want them to become transparent, he wanted to hide them..

Precisely. That's why I responded to his query

What if a building is invisible? Won't it still show up on the fog of war?

And it's for a building or unit in the fog of war, and buildings and units in the fog of war are unselectable by default, so there is no need to add locust to them.

It was a warning regarding ShowUnit() in general.
 
Status
Not open for further replies.
Top