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

query for multiple units

Status
Not open for further replies.
Level 4
Joined
Jun 13, 2010
Messages
114
Im trying to make a village you can conquer and the trigger should activate when no other units except my own one are on the same region.
Those units respawn in that region.
I can't find any query for multiple units in events.
 
Level 9
Joined
Apr 19, 2011
Messages
447
I would use a periodic event to check the number of units of each player in the region that covers the village. When the number of units controlled by other players is 0, your village is conquered and you can run your triggers.
Maybe this helps.

Kind Regards
 
Level 4
Joined
Jun 13, 2010
Messages
114
I tried hours to figure out how to make this stupid trigger but it still doesn't work.

trigger.png
 
This trigger seems to be deactivated from default. So it will perhaps never be fired.

Put the "Turn off (This trigger) to the very top - rest will still fire.

Each time you check number of units, you leak a unit group.

You have to use a unit group variable and then clean it.

Set UnitGroup = Units by Neutralie Hostile in Region
If Number of Unit in UnitGroup == 0 then do Actions
Custom script: call DestroyGroup(udg_UnitGroup)

In my signature there is a link to a tutorial called "Things That Leak".
 
Level 4
Joined
Jun 13, 2010
Messages
114
Right now it worked without changing anything but it was very bugged and the cinematic looped the whole time.

This is the trigger which activates the conquer one:

trigger2.png
 
Last edited:
Level 4
Joined
Jun 13, 2010
Messages
114
Ok now it only works after killing all hosile enemy units & leave the region with my own character and wait a while.
Also my character remains hidden.

trigger2-2.png
 
Status
Not open for further replies.
Top