• 🏆 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] GUI Group variable naming problem

Status
Not open for further replies.
Level 5
Joined
Oct 24, 2007
Messages
90
So, I'm creating a map where there is a boss encounter. I am having a problem with a GUI line that sets a group variable.

  • Set TempGroup[1] = (Units within 300.00 of TempPoint[4] matching ((((Picked unit) belongs to an enemy of Player 12 (Brown)) Equal to True) and ((Owner of (Picked unit)) Not equal to Player 12 (Brown))))
TempPoint[4] is the position of the boss, and Player 12 is the owner of the boss. This is followed by:

  • Unit Group - Pick every unit in TempGroup[1] and do (Actions)
    • Loop - Actions
      • Set TempPoint[5] = (Position of (Picked unit))
      • Unit - Cause Blood Elf Mage 0012 <gen> to damage (Picked unit), dealing 100.00 damage of attack type Chaos and damage type Divine
      • Special Effect - Create a special effect at TempPoint[5] using Abilities\Spells\Human\Feedback\ArcaneTowerAttack.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_TempPoint[5])
At this point, the units that get damaged are indeed enemies of Brown, but Brown itself gets damaged too, so this causes his HP to decrease, giving an unfair advantage, and it causes him to run away because he is getting damaged. Any idea why this is happening?

BTW, all this variable naming is to prevent massive leaks, since this actions are repeated like 20 times in this boss fight.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
That's weird, you clearly say it may not be brown...

Perhaps add the line "Pick all units in TempGroup[1] matching (owner picked unit equal to Brown) and remove them from TempGroup[1]" behind the action?
Well, this doesn't actually tell you why it acts like that, but it can solve it.

If that doesn't work, there is something seriously wrong...
It's a really good thing you remove the leaks, though.

(I'm sorry I didn't use trigger-tags, it seemed too much work for 1 obvious action.)
 
Level 8
Joined
Aug 4, 2008
Messages
279
  • Set TempGroup[1] = (Units within 300.00 of TempPoint[4] matching ((((Picked unit) belongs to an enemy of Player 12 (Brown)) Equal to True) and ((Owner of (Picked unit)) Not equal to Player 12 (Brown))))
Should be:
  • Set TempGroup[1] = (Units within 300.00 of TempPoint[4] matching ((((Matching unit) belongs to an enemy of Player 12 (Brown)) Equal to True) and ((Owner of (Matching unit)) Not equal to Player 12 (Brown))))
 
Status
Not open for further replies.
Top