• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[Trigger] How to create a Unit Group in a line

Status
Not open for further replies.
Level 9
Joined
Oct 11, 2009
Messages
477
Hello! Could someone tell me on how to create a Unit Group in a line? I need a GUI version, that includes all units in the line with an infinite distance or it can also be picked units even if it is on other end of the map? Thanks in advance and +rep for the replier(s)!!!:grin::grin::grin:
 
If the units are stationary, use a region, if they can move, then errhhh... try a region too?
 
oooohhh, i misunderstood :P
Wouldn't this help :
  • Event : Unit - A unit starts the effect of an ability
  • Conditions : Ability beign cast equal to Shockwave
  • Actions : Set (UnitVariable) = Target of ability beign cast.
and then do whatever you want

EDIT : READ HERE
No wait, i kinda lost it. The trigger is wrong. I don't know how to do it.
Ask Maker or Pharaoh_
 
oooohhh, i misunderstood :P
Wouldn't this help :
  • Event : Unit - A unit starts the effect of an ability
  • Conditions : Ability beign cast equal to Shockwave
  • Actions : Set (UnitVariable) = Target of ability beign cast.
and then do whatever you want

Yes I tested it earlier but it detects nothing if the ability is cast on ground, if targeted on a unit, it only detects one unit, only the target unit. I am thinking of the unit offset function but I am still having problems.
 
Is there a "Unit in line of ability beign cast" and then set the range to (Shift + double click) infinite
 
I just recall something like that. Maybe i'm wrong. I don't know. There is something complex, but i ain't JASS'ing, MUI, MPI, just normal simple GUI..
 
In my CustomFilter system I have made a new Enumeration for units in a line.

JASS:
function EnumUnitsInRangeOfLine takes group theGroup, real x1, real y1, real x2, real y2, real r returns nothing
This requires my CustomFilter system (vJass), however, you can easily call it with

JASS:
call EnumUnitsInRangeOfLine(group, x1, y1, x2, y2, range)
To enumerate what you need.
 
In my CustomFilter system I have made a new Enumeration for units in a line.

JASS:
function EnumUnitsInRangeOfLine takes group theGroup, real x1, real y1, real x2, real y2, real r returns nothing
This requires my CustomFilter system (vJass), however, you can easily call it with

JASS:
call EnumUnitsInRangeOfLine(group, x1, y1, x2, y2, range)
To enumerate what you need.

Could I execute the line you've given as a Custom Script?, Because I am not good in JASS-ing.
 
Additional GUI:
  • Trigger
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to X
  • Actions
    • Set Points[1] = (Position of (Triggering unit))
    • Set Points[2] = (Target point of ability being cast)
    • For each (Integer A) from 1 to ((Distance between Points[1] and Points[2])/30), do (Actions)
      • Loop - Actions
        • Set Points[3] = (Points[1] offset by ((Real(IntegerA)*30) towards (Angle between Points[1] and Points[2])
        • Unit - Create 1 Footman for (Owner of (Triggering unit)) at Points[3] facing default building degrees
        • Unit Group - Add (Last created unit) to UnitGroup
        • Custom script: call RemoveLocation (udg_Points[3])
    • Custom script: call RemoveLocation (udg_Points[2])
    • Custom script: call RemoveLocation (udg_Points[1])
 
Additional GUI:
  • Trigger
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to X
  • Actions
    • Set Points[1] = (Position of (Triggering unit))
    • Set Points[2] = (Target point of ability being cast)
    • For each (Integer A) from 1 to ((Distance between Points[1] and Points[2])/30), do (Actions)
      • Loop - Actions
        • Set Points[3] = (Points[1] offset by ((Real(IntegerA)*30) towards (Angle between Points[1] and Points[2])
        • Unit - Create 1 Footman for (Owner of (Triggering unit)) at Points[3] facing default building degrees
        • Unit Group - Add (Last created unit) to UnitGroup
        • Custom script: call RemoveLocation (udg_Points[3])
    • Custom script: call RemoveLocation (udg_Points[2])
    • Custom script: call RemoveLocation (udg_Points[1])

Thanks Pharaoh! It also helped!:thumbs_up:
 
Status
Not open for further replies.
Back
Top