Lets say I have a global player group GP and a local player group lp which I initialize as equal to GP. I then remove a player from lp. The player will also be removed from GP. This is not the behaviour of a normal variable (Is this what would be considered a pointer in programming terms?). Is this a bug?
never happened to me. do you have several triggers affecting a unit group? as far as i know there are no pointers anymore in galaxy. setting local=global should copy the values instead of having a pointer to the other group.
Player groups are like units. When you save a unit as a variable, and set a variable to that variable, they're both going to be connected to the same unit. You're hooking up both the local and global variables to the same player group, not a new player group. Try setting the local player group variable to a copy of the global one, so you'll have two player groups, rather than one.
In other words, the player groups are independent of what they're saved as. They have "IDs" that the variables are set to. The variables themselves don't actually contain the data for the player group.
This has been bothering me for a while...
Lets say I have a global player group GP and a local player group lp which I initialize as equal to GP. I then remove a player from lp. The player will also be removed from GP. This is not the behaviour of a normal variable (Is this what would be considered a pointer in programming terms?). Is this a bug?
@Elmaex: Go
never happened to me. do you have several triggers affecting a unit group? as far as i know there are no pointers anymore in galaxy. setting local=global should copy the values instead of having a pointer to the other group.
IIRC I had this issue on multiple maps already. But I will go ahead and try it with a new map just in case...
edit: yup, see example map
@Elmaex: Go
Player groups are like units. When you save a unit as a variable, and set a variable to that variable, they're both going to be connected to the same unit. You're hooking up both the local and global variables to the same player group, not a new player group. Try setting the local player group variable to a copy of the global one, so you'll have two player groups, rather than one.
In other words, the player groups are independent of what they're saved as. They have "IDs" that the variables are set to. The variables themselves don't actually contain the data for the player group.
@Charysmatic: Go
Sweet stuff, makes sense. I assumed the worked like points, since I've seen people (ab)using them as containers for integers <15. Thanks anyways.
@Elmaex: Go
indeed, didn't know that