• 🏆 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 Doesn't Do Damage

Status
Not open for further replies.
Level 37
Joined
Aug 14, 2006
Messages
7,601
Hey.

I have a little problem. I have done thousands of this type of triggers but I don't understand what's wrong with this one. The trigger doesn't do any damage to player 1's units.

  • Elite Boss TORNADO DMG
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Set TempGroup = (Units in Elite Boss Fightning Area WHOLE <gen> matching (((Unit-type of (Matching unit)) Equal to Tornado (ELITE BOSS)) and (((Matching unit) is alive) Equal to True)))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Set TempLoc = (Position of (Picked unit))
          • Set TempGroup2 = (Units owned by Player 1 (Red))
          • Set TempGroup3 = (Units within 350.00 of TempLoc matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is in TempGroup2) Equal to True) and (((Matching unit) has buff Invulnerable) Equal to False))))
          • Set TempGroup4 = (Units within 250.00 of TempLoc matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is in TempGroup2) Equal to True) and (((Matching unit) has buff Invulnerable) Equal to False))))
          • Set TempGroup5 = (Units within 150.00 of TempLoc matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is in TempGroup2) Equal to True) and (((Matching unit) has buff Invulnerable) Equal to False))))
          • Unit Group - Pick every unit in TempGroup3 and do (Actions)
            • Loop - Actions
              • Unit - Cause ELITE_BOSS to damage (Picked unit), dealing Tornado_Damage_1 damage of attack type Spells and damage type Normal
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
              • Special Effect - Destroy (Last created special effect)
          • Unit Group - Pick every unit in TempGroup4 and do (Actions)
            • Loop - Actions
              • Unit - Cause ELITE_BOSS to damage (Picked unit), dealing Tornado_Damage_2 damage of attack type Spells and damage type Normal
          • Unit Group - Pick every unit in TempGroup5 and do (Actions)
            • Loop - Actions
              • Unit - Cause ELITE_BOSS to damage (Picked unit), dealing Tornado_Damage_3 damage of attack type Spells and damage type Normal
          • Custom script: call RemoveLocation(udg_TempLoc)
          • Custom script: call DestroyGroup(udg_TempGroup2)
          • Custom script: call DestroyGroup(udg_TempGroup3)
          • Custom script: call DestroyGroup(udg_TempGroup4)
          • Custom script: call DestroyGroup(udg_TempGroup5)
      • Custom script: call DestroyGroup(udg_TempGroup)
The one who helps will get some rep.
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
You can make it shorter:
  • Elite Boss TORNADO DMG
  • Events
    • Time - Every 0.50 seconds of game time
  • Conditions
  • Actions
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit (Units in Elite Boss Fightning Area WHOLE <gen> matching (((Unit-type of (Matching unit)) Equal to Tornado (ELITE BOSS)) and (((Matching unit) is alive) Equal to True))) and do (Actions)
    • Loop - Actions
      • Set TempLoc = (Position of (Picked unit))
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 350.00 of TempLoc matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) has buff Invulnerable) Equal to False))) and (Owner of (Matching)) Equal to Player 1 (Red)) and do (Actions)
      • Loop - Actions
        • Unit - Cause ELITE_BOSS to damage (Picked unit), dealing (Tornado_Damage_1 + Tornado_Damage_2 + Tornado_Damage_3) damage of attack type Spells and damage type Normal
        • Custom script: call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\FlakCannons\\FlakTarget.mdl", GetTriggerUnit(),"origin"))
      • Custom script: call RemoveLocation(udg_TempLoc)
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Could you paste the trigger into an empty test map? You don't have to add units, regions etc. Just the trigger. Make sure the variables are copied.

I don't see any action where you pick "TempGroup2".
You pick all groups except "TempGroup2"

Units in group 2 need not to be picked. The group works as a filter for groups 3, 4 and 5.

You can make it shorter

That way the damage won't be applied correctly.

coz you destroyed tempgroups outside the cause damage loop...

The groups are destroyed correctly.
 
Level 37
Joined
Aug 14, 2006
Messages
7,601
Yea, there are 3 different damages, Maker is right. The nearer you are a tornado more damage you'll take. I think that's more realistic but I fear of lag...

Okay, I made a test map.

EDIT: I copied the triggers in hurry I forgot to copy the damages from the campaign.

EDIT 2: I added to that second map the damages.

EDIT 3: No more edits!
 

Attachments

  • Chapter 5 Elite Boss New Event.w3x
    23.1 KB · Views: 34
  • Chapter 5 Elite Boss New Event 2.w3x
    23.4 KB · Views: 39
Level 20
Joined
Jul 6, 2009
Messages
1,885
Oh lol
Didn't notice it deals more damage the closer the unit is.
In that case,this should work:
  • Elite Boss TORNADO DMG
  • Events
    • Time - Every 0.50 seconds of game time
  • Conditions
  • Actions
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit (Units in Elite Boss Fightning Area WHOLE <gen> matching (((Unit-type of (Matching unit)) Equal to Tornado (ELITE BOSS)) and (((Matching unit) is alive) Equal to True))) and do (Actions)
    • Loop - Actions
      • Set TempLoc1 = (Position of (Picked unit))
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 350.00 of TempLoc matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) has buff Invulnerable) Equal to False))) and (Owner of (Matching)) Equal to Player 1 (Red)) and do (Actions)
      • Loop - Actions
        • Set TempLoc2 = (Position of (Picked unit))
        • Unit - Cause ELITE_BOSS to damage (Picked unit), dealing (Real(Integer(Distance between TempLoc1 and Temploc2) / 100) * Tornado_Damage) damage of attack type Spells and damage type Normal
        • Custom script: call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\FlakCannons\\FlakTarget.mdl", GetEnumUnit(),"origin"))
      • Custom script: call RemoveLocation(udg_TempLoc)
 
Status
Not open for further replies.
Top