Hi there,
I'm making a map involving the control of very large numbers of units and to make things easier for players I've handily supplied them with a "Game Controls" unit that has abilities to select all the units in an area into a custom unit-group, and then other abilities will be used to command the units in this unit-group.
But to remove leaks I need to destroy the unit group every time the player uses the ability to set a new one.. But it's an array, with one for each player.
A GUI trigger doing what I need would look something like:
Event:
Unit uses selection ability
Action:
For each intiger from 1 to (number of players)
- if player (player number [loop intiger value]) = player number (owner of triggering unit) then:
- - Custom script destoy Player_Selection[player number of (owner of triggering unit)]
- - set Player_Selection[player number of (owner of triggering unit)]: the new group
So how would the script look like for that bit in bold?
I'm making a map involving the control of very large numbers of units and to make things easier for players I've handily supplied them with a "Game Controls" unit that has abilities to select all the units in an area into a custom unit-group, and then other abilities will be used to command the units in this unit-group.
But to remove leaks I need to destroy the unit group every time the player uses the ability to set a new one.. But it's an array, with one for each player.
A GUI trigger doing what I need would look something like:
Event:
Unit uses selection ability
Action:
For each intiger from 1 to (number of players)
- if player (player number [loop intiger value]) = player number (owner of triggering unit) then:
- - Custom script destoy Player_Selection[player number of (owner of triggering unit)]
- - set Player_Selection[player number of (owner of triggering unit)]: the new group
So how would the script look like for that bit in bold?