query for multiple units

Status
Not open for further replies.
Level 5
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.
 
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
 
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".
 
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:
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.
Back
Top