• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Walls and stuff

Status
Not open for further replies.
Level 3
Joined
Apr 11, 2009
Messages
43
I relised something about my maps recently and it is really pissing me off now. I want to make it that units cannot fire:

Through/Over Cliffs
OR
Through/Over Boundries
OR
Can't fire over/through a doodad like pathing blocker.
Either is fine

I am trying to have a "building" so to speak, but I don't want units firing through my "walls" which is terrain 2 levels above everything else. I want to units to go around and fire, rather then just firing through a wall.
GUI or JASS is fine, any solution will do.
Thanks!
P.S. If to do this is that hard, tell me and don't bother trying.
 
Level 3
Joined
Apr 11, 2009
Messages
43
If I ever can be bothered to build a trigger that actually works (which is just as likely as the apocalypse happening tomorrow) I will be sure to post it on the hive.
 
I relised something about my maps recently and it is really pissing me off now. I want to make it that units cannot fire:

Through/Over Cliffs
OR
Through/Over Boundries
OR
Can't fire over/through a doodad like pathing blocker.
Either is fine

I am trying to have a "building" so to speak, but I don't want units firing through my "walls" which is terrain 2 levels above everything else. I want to units to go around and fire, rather then just firing through a wall.
GUI or JASS is fine, any solution will do.
Thanks!
P.S. If to do this is that hard, tell me and don't bother trying.

dude if u search fast solution that is easy and no brain, use move type of foot and the nuke will go around.
 
Level 4
Joined
Jul 15, 2009
Messages
29
What you can do is make a trigger that detects the location Z of both the shooter and the target. Then if/then/else it; if the location of the target is greater than Location Z of shooter + some number, or less than Location Z of shooter - some number then do nothing, else kill target unit.
 
Level 9
Joined
Dec 21, 2006
Messages
490
a unit gets attacked
-
or
attacking unit in region - street
attacking unit...
AND
or
-attacked unit in region - house
attacked unit .....
-
issue order unit to stop

you have to do many regions but it works. for cliffs etc take satients solution
custom script set realvar1=getlocationZ(attacking unit)
custom script set real var2=....
if realvar1=realvar2 do nothing else issue order unit to stop
 
Level 10
Joined
Jan 28, 2009
Messages
442
Go to Object Editor and set the Custom Value of each unit to its attack range devided by 64.

  • Don't fire through walls
  • Events
    • A unit is attacked
  • Conditions
  • Actions
    • Set TempLoc Equal to Position of (Attacking unit)
    • Set CanAttack = True
    • For each Integer A from 1 to custom value of (Attacking unit)
      • Loop - Actions
        • Set TempLoc2 Equal to TempLoc offset by (64.00 x Integer A) towards Facing angle of (Attacking unit)
        • If/Then/Else - Multiple functions
          • Conditions
            • Or - Multiple conditions
              • Terrain pathing of type Amphibious pathing is off at TempLoc2 Equal to True
              • (Terrain cliff level at TempLoc2) Greater than (Terrain cliff level at TempLoc)
          • Then - Actions
            • Set CanAttack = False
          • Else - Actions
        • Custom script - call RemoveLocation(udg_TempLoc2)
    • Custom script - call RemoveLocation(udg_TempLoc)
    • If//Then/Else - Multiple functions
      • Conditions
        • CanAttack Equal to False
      • Then - Actions
        • Unit - Order (Attacking unit) to Stop
      • Else - Actions
 
Level 11
Joined
May 31, 2008
Messages
698
Set TempLoc2 Equal to TempLoc offset by (64.00 x Integer A) towards Facing angle of (Attacking unit)


Change that to angle from position of attacking unit to position of attacked unit because the unit is attacked event can register even before the unit turns or while it is still turning.
 
Status
Not open for further replies.
Top