• 🏆 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] Tiny problem with a trigger

Status
Not open for further replies.
Level 6
Joined
Feb 21, 2008
Messages
205
Am back yet again, and yet again, I started on my map. God, I've quitted this map like 3 times now, but its too awesome to drop out of. But I keep forgetting the simplest of things when I take a year off.

Aaaanyways, this should be simple. (I guess).

  • Spell Fury of the depths
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Tidelord
    • Actions
      • Set Furyofthedepths_point = (Position of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Fury of the depths for (Triggering unit)) Equal to 1
        • Then - Actions
          • Special Effect - Create a special effect at Furyofthedepths_point using Abilities\Spells\NightElf\BattleRoar\RoarCaster.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit Group - Pick every unit in (Units within 400.00 of Furyofthedepths_point matching (((Picked unit) belongs to an enemy of Player 4 (Purple)) Equal to True)) and do (Unit - Cause (Triggering unit) to damage (Picked unit), dealing 15.00 damage of attack type Chaos and damage type Normal)
          • Unit Group - Pick every unit in (Units within 400.00 of Furyofthedepths_point matching (((Picked unit) belongs to an ally of Player 4 (Purple)) Equal to True)) and do (Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 15.00))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Fury of the depths for (Triggering unit)) Equal to 2
            • Then - Actions
              • Special Effect - Create a special effect at Furyofthedepths_point using Abilities\Spells\NightElf\BattleRoar\RoarCaster.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit Group - Pick every unit in (Units within 400.00 of Furyofthedepths_point matching (((Picked unit) belongs to an enemy of Player 4 (Purple)) Equal to True)) and do (Unit - Cause (Triggering unit) to damage (Picked unit), dealing 25.00 damage of attack type Chaos and damage type Normal)
              • Unit Group - Pick every unit in (Units within 400.00 of Furyofthedepths_point matching (((Picked unit) belongs to an ally of Player 4 (Purple)) Equal to True)) and do (Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 25.00))
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Fury of the depths for (Triggering unit)) Equal to 3
                • Then - Actions
                  • Special Effect - Create a special effect at Furyofthedepths_point using Abilities\Spells\NightElf\BattleRoar\RoarCaster.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Unit Group - Pick every unit in (Units within 400.00 of Furyofthedepths_point matching (((Picked unit) belongs to an ally of Player 4 (Purple)) Equal to True)) and do (Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 35.00))
                  • Unit Group - Pick every unit in (Units within 400.00 of Furyofthedepths_point matching (((Picked unit) belongs to an enemy of Player 4 (Purple)) Equal to True)) and do (Unit - Cause (Triggering unit) to damage (Picked unit), dealing 35.00 damage of attack type Chaos and damage type Normal)
                • Else - Actions
Very simple trigger. Everytime the hero casts a spell, he heals every ally within 400 range, and damage every enemy in 400 range around him.

Buuuuut, the damage part is fine, except, it damages the hero and his allies, and the allies wont get healed either. I tried putting the damage at 30 and the heal at 60, so the end result for my allies would be the same. But that didnt work.

So TLDR: It should damage my enemy and heal my friends, instead, it deals damage to my allies.

THe problem is in these lines I presume:

  • Unit Group - Pick every unit in (Units within 400.00 of Furyofthedepths_point matching (((Picked unit) belongs to an enemy of Player 4 (Purple)) Equal to True)) and do (Unit - Cause (Triggering unit) to damage (Picked unit), dealing 15.00 damage of attack type Chaos and damage type Normal)
  • Unit Group - Pick every unit in (Units within 400.00 of Furyofthedepths_point matching (((Picked unit) belongs to an ally of Player 4 (Purple)) Equal to True)) and do (Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 15.00))
Would be quite grateful if any1 could help me out here! (Even though this part of the forum seems dead.):eek:
 
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

First of all you leak a lot!
Before you use "Unit Group - Pick every.... " write:
  • Custom script: set bj_wantDestroyGroup = true
and at the end of the trigger clear the location:
  • Custom script: call RemoveLocation(udg_ Furyofthedepths_point)
And now I search the mistake ^^ ( also if you post such big trigger, use the hidden tags - that's better )

Edit: Got it: In your pick every unit action after matching, it's not (picked unit) anymore it's (matching unit)

  • Spell Fury of the depth
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead
    • Actions
      • Set TempLoc = (Position of (Triggering unit))
      • Set TempInt = (5 + ((Level of (Ability being cast) for (Triggering unit)) * 10))
      • Custom script: call DestroyEffect(AddSpecialEffectLoc("Abilities\\Spells\\NightElf\\BattleRoar\\RoarCaster.mdl", udg_TempLoc))
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 400.00 of TempLoc matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True))) and do (Actions)
        • Loop - Actions
          • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (Real(TempInt)) damage of attack type Spells and damage type Normal
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 400.00 of TempLoc matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an ally of (Owner of (Triggering unit))) Equal to True))) and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (Real(TempInt)))
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Custom script: set udg_TempInt = 0
maybe you can check in the conditions, if the picked units are magic immune, of check for buildings - what ever ^^


Greetings
~ The Bomb King > Dr. Boom
 
Last edited:
Level 6
Joined
Feb 21, 2008
Messages
205
Thanks for your response, am really grateful for that.

Yeah am aware of the leak, but am not planning to publish this map on the net, just playing with friends on LAN, where leaks aren't a problem.

But, I changed my trigger as u said, and it stopped damaging my own units, but it still dont heal them, am I STILL doing something wrong?

  • Unit Group - Pick every unit in (Units within 400.00 of Furyofthedepths_point matching (((Matching unit) belongs to an enemy of Player 4 (Purple)) Equal to True)) and do (Unit - Cause (Triggering unit) to damage (Picked unit), dealing 15.00 damage of attack type Chaos and damage type Normal)
  • Unit Group - Pick every unit in (Units within 400.00 of Furyofthedepths_point matching (((Matching unit) belongs to an ally of Player 4 (Purple)) Equal to True)) and do (Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 15.00))
 
Level 6
Joined
Feb 21, 2008
Messages
205
hahahaha, you are so right. am so retarded. Player 4, is the one having the hero.

But when am testing it, am testing it with player 1, oh god am so stupid.

Ah well, thanks ALOT for your help, really grateful that you took the time to help me=)
 
Status
Not open for further replies.
Top