replace a Unit but hold the Controlgroup

Status
Not open for further replies.
Level 2
Joined
Jan 25, 2017
Messages
4
Hello,
i want to know how i can replace/change a Unit/building but hold the Controlgroup (crtl +1 ) for the new unit then ?

- i add unitA to crtl + 1 then if i replace/change the Unit to unitB, then the new Unit is in crtl +1 too ?
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
Nope, there's no way to set control groups via code. ForceUIKey() only works on 1 key at a time so you cant get ctrl+1 to happen that way. Maybe with a memhack that allows you to simulate keypresses on the player's machine but that's probably pretty involved for what you need.

Best solution would be to show an error message for the player whose unit was replaced to tell them they need to remake the ctrl group.
 
Status
Not open for further replies.
Top