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

[Solved] Random Unit around caster, but not caster.

Status
Not open for further replies.
Level 2
Joined
Dec 9, 2013
Messages
11
I don't know how to make a trigger in the text, my apologies.

Pick every unit in (Random 1 units from (Units within 350.00 of (position of LightningSwordThousandBlades) matching (((Picked unit) is in Heroes) Equal to False))) and do (Actions)
Loop - Actions
Unit - Kill (Picked unit)

Why does this have a chance to kill the Caster (LightningSwordThousandBlades) who is in the group Heroes?
 
Level 2
Joined
Dec 9, 2013
Messages
11
Read carefully: ...matching (((Picked unit) is in Heroes) Equal to False)))...

So I already have a condition in there that makes sure the hero isn't picked.
 
Level 8
Joined
Jul 7, 2013
Messages
141
Copy the trigger as text and paste it in the middle of trigger tags (shown below)
[TRIGGER]This is a trigger[/TRIGGER]

  • This is a trigger
Add an if then else condition or add the sort in the pick itself sorting the caster.
And btw, http://www.hiveworkshop.com/forums/general-mapping-tutorials-278/complete-list-things-leak-126761/

  • Your trigger
    • Events
      • Your Event
    • Conditions
      • Your Condition
    • Actions
      • Set pointvariable = (Position of LightningSwordThousandBlades)
      • Set unitgroupvariable = (Units within 350.00 of pointvariable matching ((((Matching unit) is A Hero) Equal to True) and ((Matching unit) Equal to (Triggering unit))))
      • Unit Group - Pick every unit in unitgroupvariable and do (Actions)
        • Loop - Actions
          • Unit - Kill (Picked unit)
      • Custom script: call RemoveLocation(udg_pointvariable)
      • Custom script: call DestroyGroup(udg_unitgroupvariable)
The caster is also killed because it is also being picked in the pick every unit action. here, I filtered the caster through this line; (Units within 350.00 of pointvariable matching ((((Matching unit) is A Hero) Equal to True) and ((Matching unit) Equal to (Triggering unit))))
 
Level 2
Joined
Dec 9, 2013
Messages
11
@Rheiko
I do not want the heroes to be killed. So the units I'm picking have to match the condition that they are NOT in heroes. So my trigger is right in that sense.

@The Prodigy
Thanks for the info! Your trigger worked <3
 
Status
Not open for further replies.
Top