• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Unit only visible in fog of war

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,337
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,651
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,651
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.
 

Cokemonkey11

Spell Reviewer
Level 30
Joined
May 9, 2006
Messages
3,550
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