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

[JASS] IsVisible Function?

Status
Not open for further replies.
Level 14
Joined
Dec 12, 2012
Messages
1,007
Hello all,

I have another problem with my project, so I thought it would be the best to ask here again. :)

My problem is, I need a function that checks wether a Unit is visible or not, but not according to a specific player.

I found the IsUnitVisible function in the documentation, but this function relates only on the field of view of a certain player. I would like to have a function that returns true if a certain unit gets invisible (for example by using Windwalk), no matter which player can see it.

Is this possible?

lfh
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
Hi,

yes I thought about that too, but then I have to create a dummy unit which follows the certain unit all time, because it has to be in its field of view... so I would like to avoid this.

I found also the IsUnitHidden function, but I couldn't get it working... no matter what happens, it is always false... when exaclty returns this function "true"?
 
Level 17
Joined
Apr 27, 2008
Messages
2,455
Hi,

yes I thought about that too, but then I have to create a dummy unit which follows the certain unit all time, because it has to be in its field of view... so I would like to avoid this.

Even if the used player can see the whole map ?

I found also the IsUnitHidden function, but I couldn't get it working... no matter what happens, it is always false... when exaclty returns this function "true"?

I wouldn't be surprised if it's an other Not Yet Implemented function.
Have you tried it with the function ShowUnit ?
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
I wouldn't be surprised if it's an other Not Yet Implemented function.
Have you tried it with the function ShowUnit ?

Yet not, but I will try that.

Even if the used player can see the whole map ?

Hm, that would be great, but how can I do this for only this specific player? Because "disable black mask" only works for all players...
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
Hi again,

well I figured it out finally, with

JASS:
call CreateFogModifierRectBJ( true, Player(11), FOG_OF_WAR_VISIBLE, GetPlayableMapRect() )

you can modify the View for a specific player.

Just one additional question: Player(11) in code is Player12 in the game and has the color brown... so, if the user selects "brown" as a color, will this be a problem for the use of this dummy? Or doesn't this affect the dummy at all?

Thanks for the help,
lfh
 
Status
Not open for further replies.
Top