Unit Selection Indicator

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
coder543
Posts: 17
Joined: Sun May 31, 2009 4:40 pm

Unit Selection Indicator

Post by coder543 »

Apart from me sitting down and making a green oval shaped mesh, does anyone know of a quick and easy way to indicate which units in an RTS i have selected, hopefully using a circle/oval shape?

I think there might be a way to do this using primitives, which would be cool.

Assume ISceneMeshNode* name of the unit is "current"

If anyone can provide code to do this, that would be amazing.
coder543
Posts: 17
Joined: Sun May 31, 2009 4:40 pm

Post by coder543 »

*bump*
Sylence
Posts: 725
Joined: Sat Mar 03, 2007 9:01 pm
Location: Germany
Contact:

Re: Unit Selection Indicator

Post by Sylence »

coder543 wrote:If anyone can provide code to do this, that would be amazing.
That won't help you much.
What problem do you have using primitives to draw this ?
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
coder543
Posts: 17
Joined: Sun May 31, 2009 4:40 pm

Post by coder543 »

I am experienced enough with the engines in use that I can make a fairly large amount of progress quickly, but I've learned this knowledge in a short amount of time. Because I learned it quickly, there are holes in my knowledge. One of them is primitive manipulation. I could (theoretically) look up the code in the documentation, but I am solving other issues as the moment such as the actual functionality behind the unit selection.

It would be nice to get that code, plus I would learn how primitives work from that code.
Katsankat
Posts: 178
Joined: Sun Mar 12, 2006 4:15 am
Contact:

Post by Katsankat »

You could try to create a sphere and scale it wisely. When unit being selected, parent it to this node.
puh
Posts: 356
Joined: Tue Aug 26, 2003 3:53 pm

Post by puh »

To indicate which units is selected i'd use emitting colors - i.e. change the material of the unit to have small amount of emitting color.
Effect would be similar to: http://www.monsterup.com/upload/1218541793.jpg
coder543
Posts: 17
Joined: Sun May 31, 2009 4:40 pm

Post by coder543 »

That is an interesting way to do it... right now I am turning whether or not the unit is affected by light on and off. I was hoping that it would be possible to draw a little circle around the units using primitives. See this http://www.playrage.com/wp-content/uplo ... aft3_3.jpg
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Try some kind of volume light. A plain circle would just be a quad under the mesh with a circle texture on it, aligned to the up-vector of the mesh.
Post Reply