• 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 make unit can't atk over tree wall

Status
Not open for further replies.
Level 11
Joined
Oct 20, 2007
Messages
342
how make unit can't atk over tree wall.

i have a line of tree to block out movement and sign range of unit,
when i see unit over there, my range unit attack over the tree wall,

how i make them can't attack if blocked by tree wall
(the tree wall created randomly in game)
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
I don't think you can unless you replace all projectiles by dummy units with that model and order them to die when in range of a tree. But with a large amount of units, that'll cause a lot of lag. This method should probably only be used in RPGs. If you're making a different kind of map, you probably can't do this.
 
Level 11
Joined
Oct 20, 2007
Messages
342
i have think be4, but as 1st post say, (the tree wall created randomly in game)(make by player)
so the direction is different in every game, too hard or imposible to create every region on the side and which way to which way, got block or not and many many....
 
Level 16
Joined
Jul 21, 2008
Messages
1,121
i have think be4, but as 1st post say, (the tree wall created randomly in game)(make by player)
so the direction is different in every game, too hard or imposible to create every region on the side and which way to which way, got block or not and many many....

It can be done checking, when unit attacks, if there is any tree in the path between attacker and attacked unit.
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
Actually, you can't. For as far as I know, you can only check for doodads in a region. And since you can't create regions, only move them, you can't shape them in the range and angle you need. And regions can only be created horizontally and vertically. So if the angle isn't 0, 90, 180 or 270, there's absolutely nothing you can do.
 
Level 11
Joined
Oct 20, 2007
Messages
342
and another problem if u use trigger to check it:
if you use trigger to check the region, let say if there have blocked tree,
you order it to stop???
then it auto attack again, then trigger stop again?

so the unit like jam at there??
 
Status
Not open for further replies.
Top