• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[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:
 
Level 13
Joined
Feb 18, 2009
Messages
1,381
If the units are stationary, use a region, if they can move, then errhhh... try a region too?
 
Level 9
Joined
Oct 11, 2009
Messages
477
If the units are stationary, use a region, if they can move, then errhhh... try a region too?

No, I mean that to detect units like the first ability of the Tauren Chieftain in Melee maps, the Shockwave, I want to detect the units that is hit by the ability.
 
Level 13
Joined
Feb 18, 2009
Messages
1,381
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_
 
Level 9
Joined
Oct 11, 2009
Messages
477
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.
 
Level 13
Joined
Feb 18, 2009
Messages
1,381
Is there a "Unit in line of ability beign cast" and then set the range to (Shift + double click) infinite
 
Level 13
Joined
Feb 18, 2009
Messages
1,381
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.
 
Level 9
Joined
Oct 11, 2009
Messages
477
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])
 
Level 9
Joined
Oct 11, 2009
Messages
477
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.
Top