• 🏆 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] Help this trigger doesn't work

Status
Not open for further replies.
Level 14
Joined
Jun 13, 2007
Messages
1,432
  • Attack
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Attack
    • Actions
      • Unit - Create 1 Dummy for Neutral Extra at ((Position of Hero 0001 <gen>) offset by 100.00 towards (Facing of Hero 0001 <gen>) degrees) facing Default building facing degrees
      • Set Dummy_Unit = (Last created unit)
      • Unit Group - Pick every unit in (Units within 99.00 of (Position of Dummy_Unit) matching (((Picked unit) is in (Units owned by Player 12 (Brown))) Equal to True)) and do (Unit - Cause Hero 0001 <gen> to damage (Picked unit), dealing 100.00 damage of attack type Hero and damage type Normal)
      • Unit - Remove Dummy_Unit from the game
What I wanted to create was a trigger that targets all units within range owned by player 12 to be damaged for X damage whenever this ability is casted
 
Level 5
Joined
Dec 18, 2007
Messages
205
this line is wrong:

  • Unit Group - Pick every unit in (Units within 99.00 of (Position of Dummy_Unit) matching (((Picked unit) is in (Units owned by Player 12 (Brown))) Equal to True)) and do (Unit - Cause Hero 0001 <gen> to damage (Picked unit), dealing 100.00 damage of attack type Hero and damage type Normal)
after the word matching u must define the matching unit like this:

Unit Group - Pick every unit in (Units within 99.00 of (Position of Dummy_Unit) matching (((Matching unit) is in (Units owned by Player 12 (Brown))) Equal to True)) and do (Unit - Cause Hero 0001 <gen> to damage (Picked unit), dealing 100.00 damage of attack type Hero and damage type Normal)

so it is

  • Unit Group - Pick every unit in (Units within 99.00 of (Position of Dummy_Unit) matching (((Matching unit) is in (Units owned by Player 12 (Brown))) Equal to True)) and do (Unit - Cause Hero 0001 <gen> to damage (Picked unit), dealing 100.00 damage of attack type Hero and damage type Normal)
 
Level 14
Joined
Jun 13, 2007
Messages
1,432
this line is wrong:

  • Unit Group - Pick every unit in (Units within 99.00 of (Position of Dummy_Unit) matching (((Picked unit) is in (Units owned by Player 12 (Brown))) Equal to True)) and do (Unit - Cause Hero 0001 <gen> to damage (Picked unit), dealing 100.00 damage of attack type Hero and damage type Normal)
after the word matching u must define the matching unit like this:

Unit Group - Pick every unit in (Units within 99.00 of (Position of Dummy_Unit) matching (((Matching unit) is in (Units owned by Player 12 (Brown))) Equal to True)) and do (Unit - Cause Hero 0001 <gen> to damage (Picked unit), dealing 100.00 damage of attack type Hero and damage type Normal)

so it is

  • Unit Group - Pick every unit in (Units within 99.00 of (Position of Dummy_Unit) matching (((Matching unit) is in (Units owned by Player 12 (Brown))) Equal to True)) and do (Unit - Cause Hero 0001 <gen> to damage (Picked unit), dealing 100.00 damage of attack type Hero and damage type Normal)

Alright thanks man! You're the best!
 
Level 5
Joined
Dec 18, 2007
Messages
205
well he could just use a location or coordinates, but instead he used a dummy, i think it is easier to understand and to do unless you are not familiar with triggering.
 
Status
Not open for further replies.
Top