Is it possible to share control group selections of one player with another like when viewing a replay?
More detail: I'd like to see the control group icons right above the standard game ui for Player X when playing as Player Y. Player Y's control group abilities would be disabled.
Might be tricky, but I'm guessing you could do something like this:
Each time a player presses CTRL + a digit, store his unit(s) selection in a variable ("unit group" type). You'll probably have to use an array of 2 for this variable, the first one to store which player owns the group, and the other to know which control group the units are stored into.
Then, you'll have to display the information to the other player(s). You'll need to play with UI a bit (actually, A LOT) to create buttons looking just like the usual UI for control groups, and containing:
A - the icon of the first unit in the control group
B - the total number of units in the control group
Not sure if the unit icon usually shows the strongest unit in the group, or the first, or the last selected, or whatever... Anyway, you'll have to set a "rule" of which icon is displayed and stick to it. The rest is just about storing the info into values, retrieving the info whenever you need it, and displaying tiny buttons (or hiding them whenever the group is empty). That's a pain to do it that way, but I can't think of an easier way to get it to work since it's not supposed to be trigger-based.
Yeah I was hoping to avoid all the manual dialog creation and trigger code if it was supplied for free somehow (as it seems it should be). Note that I believe you can get at player control groups by integer, so you wouldn't have to manually store the control group selections when they hit Ctrl...you'd just have to refresh the icons when Ctrl was pressed by a player I suppose.
Hopefully someone knows how to do this in an easier way...?
The player's selection and control groups is part of the data constantly sent to all clients, so there shouldn't be any extra traffic or delay from reading the information.
What about just synchronizing the control groups every 0.25 second or so? It's simple and response would be faster than detecting key hits.
Hmm...I'm not seeing any triggers that enable me to read what units Player X's control groups contain. If that data is sent to all clients, how can I get at it? Otherwise I'll have to have triggers for Cntrl-1 thru Cntrl-0 and Shift-1 thru Shift-0 that record the currently selected units for Player X and store that separately.
A separate problem is that you can't add units to control groups or even player selection group unless you have Control of those units. Anyone know how to override this?
Is it possible to share control group selections of one player with another like when viewing a replay?
More detail: I'd like to see the control group icons right above the standard game ui for Player X when playing as Player Y. Player Y's control group abilities would be disabled.
Might be tricky, but I'm guessing you could do something like this:
Each time a player presses CTRL + a digit, store his unit(s) selection in a variable ("unit group" type). You'll probably have to use an array of 2 for this variable, the first one to store which player owns the group, and the other to know which control group the units are stored into.
Then, you'll have to display the information to the other player(s). You'll need to play with UI a bit (actually, A LOT) to create buttons looking just like the usual UI for control groups, and containing:
A - the icon of the first unit in the control group
B - the total number of units in the control group
Not sure if the unit icon usually shows the strongest unit in the group, or the first, or the last selected, or whatever... Anyway, you'll have to set a "rule" of which icon is displayed and stick to it. The rest is just about storing the info into values, retrieving the info whenever you need it, and displaying tiny buttons (or hiding them whenever the group is empty). That's a pain to do it that way, but I can't think of an easier way to get it to work since it's not supposed to be trigger-based.
@ZealNaga: Go
Yeah I was hoping to avoid all the manual dialog creation and trigger code if it was supplied for free somehow (as it seems it should be). Note that I believe you can get at player control groups by integer, so you wouldn't have to manually store the control group selections when they hit Ctrl...you'd just have to refresh the icons when Ctrl was pressed by a player I suppose.
Hopefully someone knows how to do this in an easier way...?
The player's selection and control groups is part of the data constantly sent to all clients, so there shouldn't be any extra traffic or delay from reading the information.
What about just synchronizing the control groups every 0.25 second or so? It's simple and response would be faster than detecting key hits.
@StragusMapster: Go
Hmm...I'm not seeing any triggers that enable me to read what units Player X's control groups contain. If that data is sent to all clients, how can I get at it? Otherwise I'll have to have triggers for Cntrl-1 thru Cntrl-0 and Shift-1 thru Shift-0 that record the currently selected units for Player X and store that separately.
A separate problem is that you can't add units to control groups or even player selection group unless you have Control of those units. Anyone know how to override this?