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

Picking each unit within range

Status
Not open for further replies.
Level 21
Joined
Aug 21, 2005
Messages
3,699
I've got a problem...

so I've made this trigger:
Events:
Unit - A unit Finishes casting an ability
Conditions:
(Ability being cast) Equal to Last man Standing
Actions:
Game - Display to (All players) the text: Trigger works
Unit Group - Pick every unit in (Units within 600.00 of (Position of (Casting unit)) matching ((Owner of (Picked unit)) Equal to (Owner of (Casting unit)))) and do (Unit Group - Add (Picked unit) to LMSUnits[(Player number of (Owner of (Casting unit)))])
Unit Group - Pick every unit in (Units within 600.00 of (Position of (Casting unit)) matching (((Owner of (Picked unit)) is an ally of (Owner of (Casting unit))) Equal to True)) and do (Unit Group - Add (Picked unit) to LMSUnits[(Player number of (Owner of (Casting unit)))])
Unit Group - Pick every unit in LMSUnits[(Player number of (Owner of (Casting unit)))] and do (Unit - Kill (Picked unit))

When testing, the text message shows up, so there's nothing wrong with the events/conditions.
Here's what I want: whenever the ability is cast, you must pick all units within 600 of the casting unit and check if this unit belongs to you or an ally.
then, these units must die (well that's not what should happen, but at least it's a good way to see if the trigger works).

been staring at this trigger for almost an hour now and I can't see what I'm doing wrong... maybe it's just me cause I'm not good at triggering, but whatever...
 
You are using 'Picked Unit' where you should have used 'Matching Unit'

  • Events:
    • Unit - A unit Finishes casting an ability
  • Conditions:
    • (Ability being cast) Equal to Last man Standing
  • Actions:
    • Game - Display to (All players) the text: Trigger works
    • Unit Group - Pick every unit in (Units within 600.00 of (Position of (Casting unit)) matching ((Owner of ([B][COLOR="Red"]Matching unit[/COLOR][/B])) Equal to (Owner of (Casting unit)))) and do (Unit Group - Add (Picked unit) to LMSUnits[(Player number of (Owner of (Casting unit)))])
    • Unit Group - Pick every unit in (Units within 600.00 of (Position of (Casting unit)) matching (((Owner of ([B][COLOR="red"]Matching unit[/COLOR][/B])) is an ally of (Owner of (Casting unit))) Equal to True)) and do (Unit Group - Add (Picked unit) to LMSUnits[(Player number of (Owner of (Casting unit)))])
    • Unit Group - Pick every unit in LMSUnits[(Player number of (Owner of (Casting unit)))] and do (Unit - Kill (Picked unit))
Hope this helps you..
 
Status
Not open for further replies.
Top