• 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.

Stop firing through walls ?

Status
Not open for further replies.
Level 15
Joined
Nov 26, 2005
Messages
1,151
Ok, so in the picture is my situation.
What I want to ask is:

How to make Marine A UNABLE to attack MArine B from inside the base. I want it to be able to shoot only if it is on the wall (which is fully walkable.)

Any suggestions?

--------------------------------
EDIT:

Second question is where in the MPQ of warcraft are the Crates. Barrel and Barrel of Explosives models? Just couldn't find them anywhere...
 

Attachments

  • situationAB.JPG
    situationAB.JPG
    363.7 KB · Views: 164
Last edited:
Level 4
Joined
Apr 15, 2011
Messages
108
you could use sight blockers, as he cant see, he cant shoot. edit: but well you are member since 2005, you probably alredy know that, dont you ? ^^

so anyway, there is a way, I think... but its kinda stupid.

you create a region at that walkable but not shootable point, then if some unit attacks some unit; and if killing unit is in that region you dont want him to attack; and getting-hurt-unit is in that region where you want it to not attacked, you order him to stop.

tl;dr --- create two regions, order attacking one to stop if both units are in regions. multiply regions using region vars with arrays for more points.
 
Level 15
Joined
Nov 26, 2005
Messages
1,151
Ty for reply.

Actually both your ideas crossed my mind, but I am already using a region visibility modifier, so Idk if the line of sight blocker will work. (The visibility is automatically granted a bit outside the enxlosed base area.

And the region thing is actually what I am trying to do but it has it's flaws ..
Oh well, ty for reply and Uget rep. Any other suggestions are also welcome.

P.S.
Also I would be glad to receive an answer to my other rather annoyin question. xD Ty.
 
Level 13
Joined
Jun 1, 2008
Messages
360
Easy. Especially when you can walk on the wall..
Just check all points between the marines for the terrain height and order the unit to stop when its too high.
You can also pick destructibles (trees etc) around P3.


z, z0, r: real
x,y: integer
P,P2,P3: points

Event: unit is attacked
Actions:
P = pos of marine 1
Custom script: set udg_z0 = GetLocationZ(udg_P)
P2 = pos of marine 2 (remove those later, see here for leaks)
r (real) = distance between P and P2
y = integer(r/WallThickness) (number of points to check terrain height)
For each integer x from 1 to y do
P3 = P offset by x * y towards angle from P to P2
Custom script: set udg_z = GetLocationZ(udg_P3)
if z > z0 then order attacking unit to stop & remove points & skip remaining actions



Note: Since the unit will try to attack the other unit all the time this could lead to lags.
So better order the unit to attack another unit or add it to a unit group and dont check for collision every time..
 
Status
Not open for further replies.
Top