So here is my predicament. I am trying to set a condition as following.
Compare the number of triggering units by owner of triggering units to value 1
My trigger is a enter region type, so basically what I want is that when x units of player x go into it, it starts.
I cant find how to do this for the life of me, and if i cant, the number of triggers my map will have will be 8 times larger, one for every player, not to mention a global variable for every trigger.
If you guys got anything to help, that would be awesome.
I am trying to create unit at a point linked with a specific player. At the moment, I have 8 If then statements saying "if players 1, then location 1" "if player 2, then location 2" and so on.
Do you guys know of a more efficient way to do this. However, I have already linked start locations to each player, and have used them all with create units for player (triggering player) at start location of player (triggering player).
Since players are treated as integers in SC2, you could just keep an array of locations that you could index into using a for loop.
However, I'd definitely use a while loop that acts as a for loop instead, since as it was posted elsewhere, for loops don't get translated into Galaxy code very neatly.
@OneSoga: Go
Would you care to elaborate on that? Im not really sure what you mean.
However, more importantly, does any one see what is wrong with this code? (in the attached image)
What I am trying to do is as follows.
When a total of 4 or more units (zealots) walk into the region "battlecruisers" the trigger activates.
Then 3 battlecruisers are added to the player and stuck into a global unit group.
Then the zealots (exactly 4) that are inside the triggering area are removed from the game.
Now then, here is what happens.
When a total of 4 or more units (zealots) walk into the region "battlecruisers" the trigger activates.
Then 3 battlecruisers are added to the player and stuck into a global unit group.
Then a zealot (exactly 1) that is inside the triggering area are removed from the game. This leaves the other 3 sitting in the trigger area.
So here is my predicament. I am trying to set a condition as following.
Compare the number of triggering units by owner of triggering units to value 1
My trigger is a enter region type, so basically what I want is that when x units of player x go into it, it starts.
I cant find how to do this for the life of me, and if i cant, the number of triggers my map will have will be 8 times larger, one for every player, not to mention a global variable for every trigger.
If you guys got anything to help, that would be awesome.
You'd want to check the size of the unit group of (all units in the region) every time an unit enters the region. As such:
Awesome. Thanks so much for that.
I have another question too.
I am trying to create unit at a point linked with a specific player. At the moment, I have 8 If then statements saying "if players 1, then location 1" "if player 2, then location 2" and so on.
Do you guys know of a more efficient way to do this. However, I have already linked start locations to each player, and have used them all with create units for player (triggering player) at start location of player (triggering player).
Thanks, Bob
@PBobbert: Go
Since players are treated as integers in SC2, you could just keep an array of locations that you could index into using a for loop.
However, I'd definitely use a while loop that acts as a for loop instead, since as it was posted elsewhere, for loops don't get translated into Galaxy code very neatly.
@OneSoga: Go Would you care to elaborate on that? Im not really sure what you mean.
However, more importantly, does any one see what is wrong with this code? (in the attached image)
What I am trying to do is as follows.
When a total of 4 or more units (zealots) walk into the region "battlecruisers" the trigger activates. Then 3 battlecruisers are added to the player and stuck into a global unit group. Then the zealots (exactly 4) that are inside the triggering area are removed from the game.
Now then, here is what happens.
When a total of 4 or more units (zealots) walk into the region "battlecruisers" the trigger activates. Then 3 battlecruisers are added to the player and stuck into a global unit group. Then a zealot (exactly 1) that is inside the triggering area are removed from the game. This leaves the other 3 sitting in the trigger area.