• 🏆 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!

[General] Detect units if they're seen by players

Status
Not open for further replies.
Level 20
Joined
Aug 13, 2013
Messages
1,696
How to detect if the unit is in visibility fog of war or black mask.

Because I'm making AI Casting a carrion swarm in 3000 range and the carrion swarm ability has a cast range of 3000.
The problem is he can cast the carrion swarm to the enemy units in 3000 range even there's no a vision to the picked unit.
 
Level 5
Joined
May 6, 2013
Messages
125
JASS:
constant native IsVisibleToPlayer           takes real x, real y, player whichPlayer returns boolean
constant native IsFoggedToPlayer            takes real x, real y, player whichPlayer returns boolean
constant native IsMaskedToPlayer            takes real x, real y, player whichPlayer returns boolean

Try to check if the location the unit is standing on is visible
 
Status
Not open for further replies.
Top