• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Pick units in a line?

Status
Not open for further replies.
Something like this:
  • Line Detect
  • Events
  • Conditions
  • Actions
    • Set Point[1] = Position of Unit
    • Set Point[2] = Target Point
    • For Each Integer A from 1 to 12, do (Actions)
      • Loop
        • Set TempReal = TempReal + 200
        • Unit Group - Pick Every unit in Point offset by TempReal towards Angle from Point[1] to Point[2] and do Actions
          • Loop
?
 
Pick every unit works by picking in a circular area of radius equal to the distance you select, if I'm not wrong. Sure you could do that, but it wouldn't really be a line. I think rects (GUI “regions”) is what you're looking for — they're quadrangular.

P.S. — For more complex forms, you should probably search for a snippet.
 
Well... I was able to make it check once every 2 triggers.
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Check[M_Int] Equal to True
    • Then - Actions
      • Do the Big Loop
      • Set Check[M_Int] = False
    • Else - Actions
      • Set Check[M_Int] = True
Hope it doesn't lag when multiple spells of this are cast (at once)

Also, regions won't do because they don't work well on diagonals.
 
Well, how about make a region that has a shape of line and has this thickness.... Worth a try but has some flaws maybe and worst might not work.

Approximating a region might make sense if you use the same line over and over again because there is the function

native IsUnitInRegion (region whichRegion, unit whichUnit) returns boolean

so you do not need to get the unit's coordinates nor do calculations.
 
Status
Not open for further replies.
Back
Top