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

[Trigger] Damaging units in area not working

Status
Not open for further replies.
Level 5
Joined
Aug 18, 2013
Messages
85
  • Unit Group - Pick every unit in (Units within 100.00 of (Position of Paladin 0000 <gen>) and do (Unit - Cause (Triggering unit) to damage (Triggering unit), dealing 500.00 damage of attack type Hero and damage type Normal)
What am I doing wrong?
 
  • Unit Group - Pick every unit in (Units within 100.00 of (Position of Paladin 0000 <gen>) and do (Unit - Cause (Triggering unit) to damage (Triggering unit), dealing 500.00 damage of attack type Hero and damage type Normal)
What am I doing wrong?

What's going on: You're picking every unit within melee range of the Paladin, and ordering the triggering unit to damage themselves. Picking the unit is redundant.

What you want to do: Pick every unit within XX range of the Paladin, and order the a unit to damage the picked unit.
  • Unit Group - Pick every unit in (Units within XX of (Position of Paladin 0000 <gen>) and do (Unit - Cause (Some unit) to damage (Picked unit), dealing 500.00 damage of attack type Hero and damage type Normal)
Remeber: Ordering a unit to damage another unit does not interrupt whatever they are currently doing.
 
And also you should match the condition. Without putting the conditions there, your paladin will damage everyone around him including himself.

Good point! Did not think about that :) it should be something like this then (brownie points for making it leakless (;):
  • Actions
    • Set TempAoE = 100
    • Set TempLoc = (Position of Paladin 0000 <gen>))
    • Set TempGroup = (Units within TempAoE of TempLoc matching (((Matching Unit) belongs to an enemy of (Owner of Paladin 0000 <gen>))) Equal to True))
    • Unit Group - Pick every unit in TempGroup and do (Actions)
      • Loop - Actions
        • Unit - Cause (Some unit) to damage (Picked unit), dealing 500.00 damage of attack type Hero and damage type Normal
    • Custom script: call RemoveLocation (udg_TempLoc)
    • Custom script: call DestroyGroup (udg_TempGroup)
All you have to do is change the conditions to your needs.
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
These are the usual filters:
Unit is not dead. (Yet :DDD)
Unit is not a structure.
Unit is an enemy.

  • Actions
    • Set TempUnit[0] = (Triggering unit)
    • Set TempPlayer[0] = (Owner of TempUnit[0])
    • Set TempLocation[0] = (Position of TempUnit[0])
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units within 512.00 of TempLocation[0]) and do (Actions)
      • Loop - Actions
        • Set TempUnit[1] = (Picked unit)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (TempUnit[1] is A structure) Equal to False
            • (TempUnit[1] is dead) Equal to False
            • (TempUnit[1] belongs to an enemy of TempPlayer[0]) Equal to True
          • Then - Actions
            • Unit - Cause TempUnit[0] to damage TempUnit[1], dealing 500.00 damage of attack type Hero and damage type Normal
          • Else - Actions
    • Custom script: call RemoveLocation(udg_TempLocation[0])
 
Status
Not open for further replies.
Top