Huh, that's really weird. There's actions to add and remove units from control groups, but I don't see any way of finding out if a unit is in a control group, or a function to reference that control group as a whole. Pretty odd.
The only way to really do it is to add units to a unit group variable when you add them to control groups. The problem with this would be that units added manually by the player (via Cntrl+#) would not be added to the unit group. Depending on what you're trying to do, this might not be a big deal since you can periodically clear the unit group, enumerate units which meet certain conditions, then add them to the control group and unit group variable.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
How do I get the units (in a unit group) of control group 1 for player 1, using triggers?
Or is it impossible?
Huh, that's really weird. There's actions to add and remove units from control groups, but I don't see any way of finding out if a unit is in a control group, or a function to reference that control group as a whole. Pretty odd.
@Chris97Ong: Go
The only way to really do it is to add units to a unit group variable when you add them to control groups. The problem with this would be that units added manually by the player (via Cntrl+#) would not be added to the unit group. Depending on what you're trying to do, this might not be a big deal since you can periodically clear the unit group, enumerate units which meet certain conditions, then add them to the control group and unit group variable.