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

I am back to the enemy? the enemy walks

Status
Not open for further replies.
Hi friends ^.^ I want to go behind enemy back without his notice.

of course that if you instruct me about how to make triggers that when enemy is back angel to me it make him ignore me and keep walk or do whatever he do.

thank you for reading and have a nice reading of the forum.

  • a try:
  • Untitled Trigger 001
    • Events
      • Unit - A unit comes within 256.00 of Mountain King 0028 <gen>
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Integer((Facing of (Triggering unit)))) Equal to (Integer((Facing of Mountain King 0028 <gen>)))
        • Then - Actions
          • Unit - Order (Triggering unit) to Human Mountain King - Storm Bolt Mountain King 0028 <gen>
        • Else - Actions
          • Do nothing
In this example I make all enemy have storm and no attack, which is ok for the map but it still not work because the angel not right note - to make them not use it on their will i will add mana only when the angle is right.


A thought - maybe check the area in front of the income unit? please explain how?
 
Level 3
Joined
Apr 8, 2006
Messages
41
set var_y = ((tan * UnitFacing(Mountain King)) * (PointX(LocOfUnit(toSee)) - PointX(LocOfUnit(MountainKing)))) + (PointY(LocOfUnit(MountainKing))))

if (UnitFacing(MountainKing) > 0 and UnitFacing(MountainKing) < 180) then
----if (PointY(LocOfUnit(toSee)) >= var_y then
--------<Mountain King can see the dude>
----else
--------<Mountain King can't see the dude>
else if (UnitFacing(MountainKing) > 180 and UnitFacing(MountainKing) < 360) then
----if (PointY(LocOfUnit(toSee)) <= var_y then
--------<Mountain King can see the dude>
----else
--------<Mountain King can't see the dude>
else if (UnitFacing(MountainKing) == 0 or UnitFacing(MountainKing) == 360) then
----if (PointX(LocOfUnit(toSee)) >= PointX(LocOfUnit(Mountain King))) then
--------<Mountain King can see the dude>
----else
--------<Mountain King can't see the dude>
else if (UnitFacing(MountainKing) == 180) then
----if (PointX(LocOfUnit(toSee)) <= PointX(LocOfUnit(Mountain King))) then
--------<Mountain King can see the dude>
----else
--------<Mountain King can't see the dude>

~~~~~~~~~~~~~~

This should work assuming Warcraft 3 uses Degrees (can't remember if they do) and that 0º/360º is -> that way.
If anyone wants to (and can) find some error in my trigonometry please do! (I'm a bit rusty)

Hope this helps!
Tell me if it doesn't, I might have made a math error XP
 
Status
Not open for further replies.
Top