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