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

[Solved] Removing unit group

Status
Not open for further replies.
Level 2
Joined
Aug 3, 2020
Messages
7
Just wanna ask what's wrong with my trigger. I can't seem to figure it out, I scoured the forums point out to do it like this.
 

Attachments

  • Untitled.png
    Untitled.png
    22.9 KB · Views: 16
Level 45
Joined
Feb 27, 2007
Messages
5,578
You did not clean the unit group leak correctly. What is the line at the end suppose to accomplish? You are also leaking a location at the start.

Your trigger will create a unit and then sequentially order that unit to attack every hero on the map, regardless of player force settings. Because the unit cannot attack instantly, only the last hero unit found in the group will actually be targeted and attacked (though the message will display for all heroes found). What are you trying to do?
 
Level 2
Joined
Aug 3, 2020
Messages
7
You did not clean the unit group leak correctly. What is the line at the end suppose to accomplish? You are also leaking a location at the start.

Your trigger will create a unit and then sequentially order that unit to attack every hero on the map, regardless of player force settings. Because the unit cannot attack instantly, only the last hero unit found in the group will actually be targeted and attacked (though the message will display for all heroes found). What are you trying to do?
I'm trying to make it attack or locate a random player when it arrives
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
There is a "Random unit from <group>" function.
  • Set EmpressGroup = (Units in (Playable map area) matching (((Matching Unit) is a Hero) equal to True)) //If there are heroes on the map not owned by players this line will need an additional matching filter to only get units hostile to neutral hostile
  • Set EmpressTarget = (Random Unit from EmpressGroup)
Do Nothing is useless and should never be used; you can leave blank Else blocks without issue. Also this for future reference: How To Post Your Trigger
 
Level 2
Joined
Aug 3, 2020
Messages
7
There is a "Random unit from <group>" function.
  • Set EmpressGroup = (Units in (Playable map area) matching (((Matching Unit) is a Hero) equal to True)) //If there are heroes on the map not owned by players this line will need an additional matching filter to only get units hostile to neutral hostile
  • Set EmpressTarget = (Random Unit from EmpressGroup)
Do Nothing is useless and should never be used; you can leave blank Else blocks without issue. Also this for future reference: How To Post Your Trigger
thank you so much. will post triggers in that format nex time
 
Status
Not open for further replies.
Top