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

[Trigger] Angle Problems

Status
Not open for further replies.
Level 5
Joined
Mar 24, 2008
Messages
98
Well.. I wanna Do a spell that hits units in front of him.
An example or Image of it is this one..

1273162456.jpg


The problems are.
I cant find the proper angle and the way to avoid other units getting damage except from the angle shown above.
Help?
 
  • Trg
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Set Points[1] = (Position of (Triggering unit))
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 2000.00 of Points[1] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)))) and do (Actions)
        • Loop - Actions
          • Set Points[2] = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Cos(((Facing of (Triggering unit)) - (Angle from Points[1] to Points[2])))) Greater than (Cos(45.00))
            • Then - Actions
              • Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Human\DispelMagic\DispelMagicTarget.mdl
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
          • Custom script: call RemoveLocation (udg_Points[2])
      • Custom script: call RemoveLocation (udg_Points[1])
There.
 
Status
Not open for further replies.
Top