A Player Number is stored as an integer. So for example, the value of "Player 1" is just "1".
What kind of variable is a Player Group and what kinds of math / and or comparisons can the SCII engine do with it? I am aware that "Player Group" is in fact it's own kind of variable like integer, string, etc. But what I need to know is what sorts of boolean, mathematical, and comparative expressions can I perform with it?
For example, if I have a Player Group that contains players 1, 2 and 3, and I ask it:
Does Player Group == Player 3?
What is the response? The two values are clearly not equivalent so I'm guessing it should say "false."
What if I ask it to subtract 1 from the Player Group? What does it do?
Also: If I have a lobby divided into two teams of four, and in the end the teams end up with 3 people on each side (filling slots 1,2,3 & 5,6,7) and the game starts, are the players numbered 1 to 6 or 1,2,3 & 5,6,7?
But what I need to know is what sorts of boolean, mathematical, and comparative expressions can I perform with it?
There are none. The only way to interact with a player group are the associated functions. Equality comparison might exist for player groups, I'm not sure.
For example, if I have a Player Group that contains players 1, 2 and 3, and I ask it: Does Player Group == Player 3? What is the response? The two values are clearly not equivalent so I'm guessing it should say "false." What if I ask it to subtract 1 from the Player Group? What does it do?
Both of those are illegal and won't compile. It's meaningless to compare a player group to a player, as well as to subtract an integer from a player group.
you can use a compairson to check whether a player belongs to a player group, that will return either true or false, I don't know any other comparitive functions
Player group are more like reference variable to objects so comparison will most likely not work the way you want. You can write your own comparison by checking if each unit in group 1 is in group 2 and each of group 2 is in group 1
If I have a lobby divided into two teams of four, and in the end the teams end up with 3 people on each side (filling slots 1,2,3 & 5,6,7) and the game starts, are the players numbered 1 to 6 or 1,2,3 & 5,6,7?
The players' numbers will be as you declared them in the editor, so it would be 1 - 3, and 5 - 7.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
A Player Number is stored as an integer. So for example, the value of "Player 1" is just "1".
What kind of variable is a Player Group and what kinds of math / and or comparisons can the SCII engine do with it? I am aware that "Player Group" is in fact it's own kind of variable like integer, string, etc. But what I need to know is what sorts of boolean, mathematical, and comparative expressions can I perform with it?
For example, if I have a Player Group that contains players 1, 2 and 3, and I ask it: Does Player Group == Player 3? What is the response? The two values are clearly not equivalent so I'm guessing it should say "false." What if I ask it to subtract 1 from the Player Group? What does it do?
Also: If I have a lobby divided into two teams of four, and in the end the teams end up with 3 people on each side (filling slots 1,2,3 & 5,6,7) and the game starts, are the players numbered 1 to 6 or 1,2,3 & 5,6,7?
There are none. The only way to interact with a player group are the associated functions. Equality comparison might exist for player groups, I'm not sure.
Both of those are illegal and won't compile. It's meaningless to compare a player group to a player, as well as to subtract an integer from a player group.
you can use a compairson to check whether a player belongs to a player group, that will return either true or false, I don't know any other comparitive functions
Player group are more like reference variable to objects so comparison will most likely not work the way you want. You can write your own comparison by checking if each unit in group 1 is in group 2 and each of group 2 is in group 1
It contains player numbers - Player 1, 2, etc.
It will equal if the Player Group has only one player in it (In this case 3), and if you put a Convert Player to Player Group (3).
The players' numbers will be as you declared them in the editor, so it would be 1 - 3, and 5 - 7.