GUI detection of units in front of caster

Ticer

New Member
Reaction score
2
I've looked around on the forums for a action that sets a variable to a group of units in a line in front of the caster. I've found some answers in vJass, but thats all greek to me. Is there a way to do it GUI?
 

Faust

You can change this now in User CP.
Reaction score
123
Why bother?
All you need is AceHart's GetUnitsInSector (or something like that) snippet.
You can call it with 1 line of custom script, it is all very convenient.
 

Ticer

New Member
Reaction score
2
Where can I find acehearts system?

edit:I found it, but it seems like a really complitcated system for just one spell/trigger
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
U need to have a loop and a variable integer of 150 and at start of loop ur variable = ur variable + 150 and and make a point there then make a group there with 150 radius then add the group to a new group that wil have al units in front of u. the biger the loop the futher the line wil go
 

Faust

You can change this now in User CP.
Reaction score
123
That's just the math. You put that thing in any trigger (and library I think).
THEN, you can use the whole computation with one line of command.
 

Ticer

New Member
Reaction score
2
Yeah, I downloaded his map and am looking at the trigger, alot simpler than his snippet made out to look like. Looking at it now in how to implement it.
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Easy here u go
Trigger:
  • THELPER
    • Events
    • Conditions
    • Actions
      • Set Loop = 0.00
        • Do Multiple ActionsFor each (Integer A) from 1 to 10, do (Actions)
          • Loop - Actions
            • Set Loop = (Loop + 150.00)
            • Set Point = ((Position of (Triggering unit)) offset by Loop towards (Degrees(180.00)) degrees)
            • Set Group1 = (Units within 150.00 of Point)
            • Unit Group - Add all units of Group1 to Group2

Group 2 has the units in front of u
 

Faust

You can change this now in User CP.
Reaction score
123
Oh I just see I terribly misunderstood your question. I thought you needed the units in a cone, not a line. Line is different, and easier perhaps. There are several snippets for that too around the resource section I believe, try to browse.

Shark's idea is rather crude, but basically is what you are looking for.
But in GUI, it seems to me a little horrible (almost all GUI stuff does if you experience vJASS ^^).
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
@wolfienoct u can change to What u want it to be if for ability use target point of cast @Faust he wanted GUI not vJass
 

Ticer

New Member
Reaction score
2
Trigger:
  • Trample Copy
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Shockwave
    • Actions
      • Set TempUnit = (Casting unit)
      • Set TempLoc = (Position of TempUnit)
      • Set TempGroup = (Units within 300.00 of TempLoc 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 TempUnit)) Equal to True))))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Set TempLoc2 = (Position of (Picked unit))
          • Set KnockbackCall_Unit = (Picked unit)
          • Set KnockbackCall_Dur = 0.80
          • Set KnockbackCall_Dist = (400.00 - (Distance between TempLoc and TempLoc2))
          • Set KnockbackCall_Angle = (Angle from TempLoc to TempLoc2)
          • Set KnockbackCall_SFX = Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
          • Trigger - Run Knocback Call <gen> (ignoring conditions)
          • Custom script: call RemoveLocation( udg_TempLoc2 )
      • Custom script: call DestroyGroup( udg_TempGroup )
      • Custom script: call RemoveLocation( udg_TempLoc )


This is the trigger I've been trying to work out, I want shockwave, or rather a spell like it, to push back the enemies it hits, so I'm looking for a way to find the units in a line in front of the caster. The trigger as is picks the units in an aoe range around the caster. Any help would be great!
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Create dumy unit then make a triger that event is every .05 sec make variable where the dumy pos is make group of units around dumy move picked unit instantly to dumy. Il show trigs tomrow when i have my we near.
 

Ticer

New Member
Reaction score
2
Figured it out, might need a little fine tuning, but the jist of it is here.

Trigger:
  • Ground Slam
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Ground Slam
    • Actions
      • Set TempUnit = (Casting unit)
      • Set TempLoc = (Position of TempUnit)
      • Set GroundSlam_Loc = (Target point of ability being cast)
      • Set GroundSlam_Angle = (Angle from TempLoc to GroundSlam_Loc)
      • Set GroudSlam_G1 = (Units within 200.00 of (TempLoc offset by 200.00 towards GroundSlam_Angle degrees) matching (((((Matching unit) is A structure) Equal to False) and (((Matching unit) is A ground unit) Equal to True)) and ((((Matching unit) is alive) Equal to True) and (((Mat
      • Set GroudSlam_G2 = (Units within 200.00 of (TempLoc offset by 600.00 towards GroundSlam_Angle degrees) matching (((((Matching unit) is A structure) Equal to False) and (((Matching unit) is A ground unit) Equal to True)) and ((((Matching unit) is alive) Equal to True) and (((Mat
      • Set TempGroup = (Units in (Playable map area) matching ((((Matching unit) is in GroudSlam_G1) Equal to True) or (((Matching unit) is in GroudSlam_G2) Equal to True)))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Set TempLoc2 = (Position of (Picked unit))
          • Set KnockbackCall_Unit = (Picked unit)
          • Set KnockbackCall_Dur = 0.80
          • Set KnockbackCall_Dist = 350.00
          • Set KnockbackCall_Angle = (Angle from TempLoc to TempLoc2)
          • Set KnockbackCall_SFX = Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
          • Trigger - Run Knocback Call <gen> (ignoring conditions)
          • Custom script: call RemoveLocation( udg_TempLoc2 )
      • Custom script: call DestroyGroup( udg_TempGroup )
      • Custom script: call DestroyGroup( udg_GroudSlam_G1 )
      • Custom script: call DestroyGroup( udg_GroudSlam_G2 )
      • Custom script: call RemoveLocation( udg_TempLoc )

Edit: This trigger is also in use with a knockback sys, http://www.thehelper.net/forums/showthread.php?t=123098&highlight=GUI+knockback+sys, Thx Tom Kazansky
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top