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

Trigger that checks to see if attacked unit can attack (attacking unit)

Status
Not open for further replies.
Level 4
Joined
Feb 7, 2007
Messages
61
I'm trying to make a trigger to where a certain player's unit is attacked and a condition being followed to check to see if the attacking unit is attack-able.

For example, Archers are firing upon another player's unit, but that specific unit cannot attack back because the archer is across a river, or a place that the attacked unit is unable to get to.

Is there such condition? Because in my other topic

http://www.hiveworkshop.com/forums/world-editor-help-zone-98/how-make-type-trigger-167878/

Pharaoh_ has posted a trigger that says for a condition,

"(Can Attack) equal to false"

i was trying to look for this condition, but i cant seem to find it. Or is it a variable?
 
That "CanAttack" is a boolean. It's a variable.
I told you that you will have to use a trigger which checks when a unit dies (Unit - A unit dies) and is not of type "Archer". If the number of units remaining owned by the owner of the archers and are not of type archers are equal to 0, then set the CanAttack to True.
  • Set CanAttack = True
It's just a variable name; it could be "LOL" as a name, I just used it for your understanding, but I didn't anticipate the other way around. :p

The boolean will be set, once all the units that are not archers are killed, so that the attackers can then start attacking the archers. With the trigger I gave you that checks if CanAttack = False, it will prevents units from attacking archers, if the rest units are not yet killed.
 
Level 4
Joined
Feb 7, 2007
Messages
61
I have mobs that spawn a certain point of the map.

  • Move
    • Events
      • Unit - A unit enters Spawn1 <gen>
      • Unit - A unit enters Spawn2 <gen>
      • Unit - A unit enters Spawn3 <gen>
      • Unit - A unit enters Spawn4 <gen>
    • Conditions
      • (Owner of (Entering unit)) Equal to Player 12 (Brown)
    • Actions
      • Unit - Order (Entering unit) to Attack-Move To (Center of FinalAttack <gen>)
The point they trying to get to, is blocked off by a wall and a little gate in the middle. There are archers on a wall, and ground troops on the floor. When the mobs spawn and kill all the ground units, i want them to go and make their way to attack the gate if its still Alive. However, they will try to attack the archers on the wall, in which they cannot. So they stand there looking stupid, all up against the wall trying to attack the archers.

Heres what my map look like:

2v82wq0.png


In addition to that, this conflicts with my other problem in my other topic:

http://www.hiveworkshop.com/forums/triggers-scripts-269/gate-trigger-help-168043/
 
Status
Not open for further replies.
Top