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

How to make units not attack over obstacle?

Status
Not open for further replies.
Level 3
Joined
Mar 5, 2015
Messages
21
Hey,

I need a little help from you guys again.. :vw_wtf:

The problem is that on my map, I spawn units close to each other, but sepparated by a cliff (2 high). Units are supposed to run away from the cliff to attack a thing there, but they don't and they try to attack (and ranged units do) units on the other side of the cliff.

What I tried:

Make a gap of no visibility between them - did not work.
Put a line of sight block between them - did not work.


What I can't try:

Make them allied, I need them to be enemies.
Spawn them further away (I can, but it would mean change whole map).


To sum it up - how to make units, that are in enemy relation to each other, not attack each other, when there is a obstacle they should not see over?

And I realised it can be chaotic to read as I don't know how to explain it, so there is a picture. Large areas are the visibilities of left or right side, and small are the spawn areas of waves. :fp:

9fe7f2d80b.p.jpg
 

Deleted member 242951

D

Deleted member 242951

I think you should make them allied and then when they reach some good distance from each other you should change the owner of the unit. If you have any problems then message me or pass the map, I can fix it by other methods !!!!
 
Level 3
Joined
Jan 24, 2015
Messages
26
Doesn't a unit give vision of itself to nearby enemies when it attacks? I've never really known the rules of that, such as if it only gives vision to what it's attacking ( and thus its team if shared vision is enabled ), but that could be an issue.
 
Combine my http://www.hiveworkshop.com/forums/lab-715/demo-block-ranged-shooting-through-trees-249312/ with Maker's http://www.hiveworkshop.com/forums/...h-v1-1-1-1-a-205784/?prev=d=list&r=20&u=maker to get the result you want. Give them a melee attack for a few seconds then switch them back then continue in order to exploit pathing to accomplish your goal.

Otherwise you can try to make your own path checker and abuse Acquire range and/or range checks with cliff checks. Good luck, I might make my own system if nobody else does.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
But I don't get the problem.
There are 2 units that are separated by a cliff.
They are enemies and will attack each other on sight.
The problem is that neither of them knows that there is another unit behind the cliff because they cannot see it.
Unless you have disabled FoW or made some other visibility things that will make them see each other.

Neither of the above should be used in that way because 1, FoW should always be there and be removed by a visibility modifier; and 2, AI players shouldn't have visibility modifiers at all. (Unless that is necessary for their behavior which isn't in this case.)

So I don't really get what the problem is.
 

sentrywiz

S

sentrywiz

Make a region and create the obstacle there.
You can then make a trigger that stops each unit that tries to attack while in the region.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
You can also just order them to normal move and then 1 second later you order them to attack move.
By that time, they are out of range of each other.

I thought I had a good piece of code for that... can't find it any more though.
Gotta rip it from my project then.
 
Status
Not open for further replies.
Top