I've been trying for a while now to get this working. I'm trying to achieve the following:
If a unit from player 1 or 2 or 3 (team 1) enters a region and no units from players 4 or 5 of 6 (team 2) exist in the region (and vice versa), a variable gets incremented. However, if a unit from each team is present in the region, no variable is incremented.
For each player, you first pick each unit in the region belonging to that player.. Then you check that the unit belongs to that player (this is redundant). Then, for incrementing the variable, you rly only check that someone from team 1 is in the region (what happens if team 2 is in there aswell? the variable will still be counted up)
Also, you are using an int array for storing boolean values.. It's not rly an error, but I think it would be better to use a boolean array.
What I would do is something like this
bool team1, team2
Set team1 = (Count number of units in (units in [region] ally of player 1 with at most 1) == 1)
Set team2 = (Count number of units in (units in [region] ally of player 4 with at most 1) == 1)
if (team1 AND NOT team2)
increment team1
if (team2 AND NOT team1)
increment team2
Obviously it's not copied from galaxy - didn't want to start making the trigger, but you should be able to implement it in a trigger
Aye, by first adding the players to groups representing their respective teams would simplify this trigger immensely. (along with any other triggers you want down the road that relate to the teams rather then specific players)
I've been trying for a while now to get this working. I'm trying to achieve the following:
If a unit from player 1 or 2 or 3 (team 1) enters a region and no units from players 4 or 5 of 6 (team 2) exist in the region (and vice versa), a variable gets incremented. However, if a unit from each team is present in the region, no variable is incremented.
@Zurom: Go
I don't think exclusive OR exists in the editor, so you can try this condition:
xor is equivalent to !=, so I believe it's in the editor :)
Thanks for you replies :)
However, this was a tricky one, this is how I ended up getting it to work:
hmm. that is a somewhat confusing function..
For each player, you first pick each unit in the region belonging to that player.. Then you check that the unit belongs to that player (this is redundant). Then, for incrementing the variable, you rly only check that someone from team 1 is in the region (what happens if team 2 is in there aswell? the variable will still be counted up)
Also, you are using an int array for storing boolean values.. It's not rly an error, but I think it would be better to use a boolean array.
What I would do is something like this
bool team1, team2
Set team1 = (Count number of units in (units in [region] ally of player 1 with at most 1) == 1)
Set team2 = (Count number of units in (units in [region] ally of player 4 with at most 1) == 1)
if (team1 AND NOT team2)
increment team1
if (team2 AND NOT team1)
increment team2
Obviously it's not copied from galaxy - didn't want to start making the trigger, but you should be able to implement it in a trigger
Hmm, I definitely tried most of what you said but I never tried that. I'll certainly see if that works. Thanks :)
Aye, by first adding the players to groups representing their respective teams would simplify this trigger immensely. (along with any other triggers you want down the road that relate to the teams rather then specific players)