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

Blocking ranged attacks

Status
Not open for further replies.
Level 8
Joined
Oct 1, 2010
Messages
408
Ok here is my problem. I'm working on Outland risk, and I want to use line of sight blockers so that ranged units cannot attack through walls etc. However, since its risk, fog of war and black mass are disabled, so line of sight does nothing. Any idea how to fix this?

Thanks for any help
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,229
There are 3 possible solutions.
1. A complex trigger system to detect when a unit should not be able to attack and stop it from doing so.
2. Give units 100% evasions when moving through such parts.
3. Upgrade to Starcraft II where I believe it is possible to prevent effects from working on different ground levels.

You could also try messing with invisiblity. Not sure if LOS blockers affect that though.
 
Level 8
Joined
Oct 1, 2010
Messages
408
It would be called moving to SC2 not upgrading...

I will work on this and try to design a simple triggered system for this for you.

Awesome thank you!

Thanks for the help everyone. Mckill and Dr Super Good, only problem I have with that is that I don't want the units to still be attacking, even if it does do no damage. I'm not sure if thats what Clouds does, but I think it is.
 
Level 8
Joined
Oct 1, 2010
Messages
408
Yes but I don't want ranged to be disabled near a wall, I just don't want them to attack through a wall. Like a wall like this even http://www.hiveworkshop.com/forums/models-530/wall-49720/?prev=search=orc%20wall&d=list&r=20

So I mean, does cloud work that if you cast it on the wall they won't be able to shoot through it? Because if Cloud is cast on anything but the wall, then the unit cannot attack even when a wall is not in between the two enemy units, which is not what I want.

Also, this is unrelated but I didn't want to make a whole new thread asking this: Is there a way to change the unit scale of every unit?

Thanks
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
For Unit Scale, go to Object Editor -> Units Tab -> Art - Scale Value -> Change It

For the disable attack, simply create region covering an area of sector of the wall
Basically, like this:


[REGION]



[REGION] [UNIT INSIDE WALL] [REGION]



[REGION]

Those who enter [REGION] cannot attack the unit inside wall
I'll create a test map for you
 
Level 8
Joined
Oct 1, 2010
Messages
408
OK thanks very much :) I have no knowledge of triggers so I haven't been able to test it, but I'll see if Priwin can.

Also, I know how to change unit scaling =P I was asking if you can change every units' scale at once, sorry for confusion.
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
Neither of your test maps are good. mckill's prevents every ranged attack,not only through walls.
defskull's isn't good either,it prevents melee attacks too and is very hard to implement also not efficient at all,can easily be abused. According to your system,units behind walls can't be attacked at all.
I'm sorry for being rude,i'm just telling the facts.
I'll try to make a system that will cover those flaws...
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
LoL ?
Melee can attack through walls, isn't that AMAZING ?
I just used a non-condition attack type because I know Melee CANNOT attack through walls
So, any attack made through walls is considered as RANGE attack, clear ?
Also, my regions are PERFECTLY covered up, so there is no little loophole in it that a unit can abuse it
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
I meant,all units in that safe region cannot be attacked at all. I'm pretty sure units won't be covered with walls from all sides so what will happen when melee units get between those walls? They won't be able to attack.
Also you don't know if those walls are buildable or not,if they are,regions can't do the job.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Referring to your statement, you're saying that it could have a 6734946t187 probabilities lol... (melee unit gets in wall... buildable walls... etc...)
We just do what we're capable of, maybe THAT could give him an idea
Okay, I wanna see your test map, it is SURELY perfect, no flaws and all... perfect 6734946t187 conditions applied
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Wait, I thought he wants a system where ranged units can't attack through walls? And from the looks of it, your systems disables when near the wall (haven't tested though).

I think you heard about this Condition, do you ?
Just add it to the trigger...
  • Disable Attack Range
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Safe Region <gen> contains (Attacked unit)) Equal to True) and (((Attacking unit) is A ranged attacker) Equal to True)
    • Actions
      • Unit - Order (Attacking unit) to Stop
Disable... Prevent... Blocking... it's the same dude.
Unless you want a REAL feeling of the game (arrows will be deflected upon hitting the walls) well THIS requires... what I don't know, an advance World Editor or something ?
And of course new model to play for the deflected arrows lol
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
ZZZZZZZZ
That's what are REGIONS for...
To set WHERE it's suppose to be LOCATED


[EXPOSED TERRAIN] [UNITS] [REGIONS/WALLS] [ATTACKING UNIT]

Well, when the attacking unit attacks from [ATTACKING UNIT] (this has been covered up by [REGIONS/WALLS]), it disables the attack
But when the attacking unit attacks from [EXPOSED TERRAIN] (no Regions created at this location), it will fire a normal attack
Of course like you said IF and only IF the walls are buildable OR not pre-placed, then Regions can't do the job pretty well because Regions are pre-placed asset
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
Neither of your test maps are good. mckill's prevents every ranged attack,not only through walls.
defskull's isn't good either,it prevents melee attacks too and is very hard to implement also not efficient at all,can easily be abused. According to your system,units behind walls can't be attacked at all.
I'm sorry for being rude,i'm just telling the facts.
I'll try to make a system that will cover those flaws...

Wo0T?...only enemies cant attack through walls in that test map, while allied units can...you can edit the AoE FYI coz its just a test map!...
 
Level 8
Joined
Oct 1, 2010
Messages
408
Well thanks everyone for trying to help, but defskull I'm not sure if I understand your test map completely. What I wanted was a way to prevent ranged from attacking through walls, but when I tested your map and tried to alter it, deleted some walls and moved safe zone, it prevented all attacks from inside the safe zone (which would not work as there will not be any open region where units should not fight) and when I put the safe zone on the walls, the archers could still shoot through them. I'll post some screen shots here to better explain what I meant. I don't think I was very clear.





 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Well thanks everyone for trying to help, but defskull I'm not sure if I understand your test map completely. What I wanted was a way to prevent ranged from attacking through walls, but when I tested your map and tried to alter it, deleted some walls and moved safe zone, it prevented all attacks from inside the safe zone (which would not work as there will not be any open region where units should not fight) and when I put the safe zone on the walls, the archers could still shoot through them. I'll post some screen shots here to better explain what I meant. I don't think I was very clear.






Again, you're gonna need a Condition for that...
Ughhh, next time please specify you needs ^_^
Maybe, you didn't set the right Region size/location ?
You must set it wisely
Think like players that are trying to cheat the system
Think WHERE will they go/move/attack from
Create at THAT region
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
Ok,i'll make you a test map with system that should work.

EDIT: Here it is. Wherever your walls are,you will need to place dummy wall unit like in my test map. Don't worry,they're invisible and won't affect map in any other way except they will prevent shooting through walls.
I thought of using regions,but regions would require much greater work in triggers,they would add too many conditions so this way is better.
 

Attachments

  • Walls.w3x
    10.1 KB · Views: 71
Level 8
Joined
Oct 1, 2010
Messages
408
Ah thanks a lot garfield! But I'm having some problems, and I'm sure its something I'm doing wrong but I can't figure out what. So I opened your map, copied the unit, opened my map (under Window), pasted the unit in world editor, the values all looked the same to me, then I put down some of the dummy units like this

but in game it's not working


Please, any ideas what I did wrong? It worked great in the test map. Though I would prefer that the result is more like how melee units function around pathing blockers, where they can find there way around pathing blockers when agrod, if the way around is close by. For instance, agrod melee ground units won't walk all over the map to find the aggoring target if the path to them is not near by, where as in WoW they unit will find the shortest route to the aggoring target no matter where the target is.
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
Ill try to do the agro part,but...i don't see you did anything wrong..did you copy the trigger and variables?
Oh and you don't have to post your screenshots on any site,you can attach them to the post.

EDIT: The aggro part would require some complicated system,but i have an idea of how to do it. However i have to go now and i'll be absent for 3 days. After i come back,i'll do the system you need.
 
Level 8
Joined
Oct 1, 2010
Messages
408
Awesome thanks and sorry I did not know there was a trigger. I'll copy and paste that, and post results. Thanks so much man! I eagerly await your return :ogre_haosis:

Edit: Argh, is there an easier way to copy, paste triggers then doing every command by hand? I tried copying the trigger itself and I got this trigger error

http://i63.servimg.com/u/f63/15/73/40/29/trigge10.jpg

Its not a big problem now as I can put it on an older version of the map to test it, but for the future, I'd rather not copy paste each command by hand. Takes so bloody long to load each map through Window.

Also... is this what you meant by attaching pictures to a post garfield?

Thanks again!

Update: I imported trigger onto an older version of the map, copy pasted dummy unit and changed its scaling value and collision size to 15 (works a lotter for my purposes that way) and placed the dummy unit as closely together as I possibly could but the riflemen were still able to shoot through it.

Then, I reset collision size and scaling value, tried a new location with a bigger wall and more dummy units using archers and riflemen with no results still. No idea what I'm doing wrong here, but I know I am since it worked fine on the map you posted. I'll try to get permission from the terrainer and Priwin (I don't think he'll care, but he might want me to delete the triggers first) and then I'll send the map to you when you get back, unless I can get your email somehow before that.
 
Last edited:
Level 20
Joined
Jul 6, 2009
Messages
1,885
I have comp here ^^

First...when you want to attach picture to post,you have an option when creating post: "attatchments". Just upload your picture there. (You can also find this option when editing post and going to "go advanced" option)

For the system,i'm sorry i didn't explain how to import. It's important that you first import variables and things from object editor such as units and then trigger afterwards. I suggest you delete the trigger and re-import it,it should be fine and without errors if all variables and units are in your map already.
Now,when you want to make the dummy unit cover greater area,you need to change this:
  • Set TempGroup = (Units within 50.00 of Loc[2] matching ((Unit-type of (Matching unit)) Equal to Wall Dummy))
In that line,change that 50.00 value. Currently the dummy units take area with radius of 50.00. No need to change unit's size or collision.
 
Level 8
Joined
Oct 1, 2010
Messages
408
OK and I assume the same goes for making it smaller? about 15 would be what I would want. Also, do you think lots of these would cause lag? Use sparringly?

Totally awesome garfield thanks so much!

But only problem is like I said before, for walls I really need a trigger or something that does what your system does but also forces the ranged unit to act like it normally would when agrod. That is, move to the nearest location where attacking the unit behind the wall is possible.

The system you've provided works great for things like, cliffs, mountains and other areas where there is no close-by entrance to the other player's units, but its not really ideal for using the Auto-Attack command and things like this.
 
Level 8
Joined
Oct 1, 2010
Messages
408
Hmm... well... I would use this sparringly then. The thing is that this map is kind of cramped, its based off a unit size of .5 so the range just bypasses the terrain. I could change the units range but that would imbalance the game too much. I believe you that its very hard to do but if anyone can help it would be oh so amazing and I would so so grateful!

I'd just have to make sure not to spam this as risk does use a lot of units.
 
Level 8
Joined
Oct 1, 2010
Messages
408
Argh!!! That is too awesome!!! dkfdfk thanks a lot man! This should really be made more readily available to people. Someone at least needs to mark this thread as Solved so it will be easier to search for.

Thanks again! You rock

o_O in 24 hours I shall rep you sir!
 
Last edited:
Status
Not open for further replies.
Top