Un-selecting certain units from a group
by Chris Jones-Gill · in RTS Starter Kit · 11/17/2004 (7:56 am) · 1 replies
Ok this'll be a good one I think that most people may want, but I am a bit stuck, so need some pointers unless someone else is working on the same thing.
working with the default units in the demo.
When you select all the units and the unit command menu pops up with the different types of soldiers grouped - you know what I mean.
Wouldn't it be cool to say click on one of the profile images and that profileType in the selection, the total is reduced by 1 or that type of soldiers is dropped altogther from that group or selection?
What I have done is to turn the Profile images into buttons in the gui and created a basic commandaction like the commandMenu does, (currently it just fires some text to say "I clicked here")
what I cannot figure out is how to get the name of the unit (maybe not the best way) or the GhostID for that unit in the profilegui, so I can then pass it to a new function in the groupManager.cs / selection.cs to deslect that unit and if the original selection is / has been asigned a group number, to adjust that group acordingly
appriciate any pointers
working with the default units in the demo.
When you select all the units and the unit command menu pops up with the different types of soldiers grouped - you know what I mean.
Wouldn't it be cool to say click on one of the profile images and that profileType in the selection, the total is reduced by 1 or that type of soldiers is dropped altogther from that group or selection?
What I have done is to turn the Profile images into buttons in the gui and created a basic commandaction like the commandMenu does, (currently it just fires some text to say "I clicked here")
what I cannot figure out is how to get the name of the unit (maybe not the best way) or the GhostID for that unit in the profilegui, so I can then pass it to a new function in the groupManager.cs / selection.cs to deslect that unit and if the original selection is / has been asigned a group number, to adjust that group acordingly
appriciate any pointers
Associate Kyle Carter
You can do the former by clear()ing the SimSet, and the latter by iterating over it and removing everything of the wrong datablock. (getDatablock() and removeObject()).
Hope this helps!