RygtY Posted August 17, 2014 Share Posted August 17, 2014 A standard trait found in all known RTS games is the ability for the player to select a character or object. I understand that this engine has the Pick function which more or less performs the act of selecting an object, but I am not sure how one should draw a circle on the terrain on which the object resides to show that the object is selected. I booted up my copy of Warcraft III as well as some other RTS games that use a 3D engine and found that the circle conforms to the surface of the terrain. That means that the circle most likely a non-repeating texture that is only draw on the terrain when a unit is selected. I looked up the Textures section of the documentation, but I am still rather stumped. I would really appreciate it if someone could explain how one should go about implementing this feature. Quote Link to comment Share on other sites More sharing options...
gamecreator Posted August 17, 2014 Share Posted August 17, 2014 Please search the forums before posting http://www.leadwerks.com/werkspace/topic/8317-2d-player-selectioncircles/ Quote Link to comment Share on other sites More sharing options...
RygtY Posted August 17, 2014 Author Share Posted August 17, 2014 Ahh, sorry. Well it was an interesting read. Quote Link to comment Share on other sites More sharing options...
gamecreator Posted August 18, 2014 Share Posted August 18, 2014 No problem at all. A lot of things are already covered in the forums. Quote Link to comment Share on other sites More sharing options...
beo6 Posted August 20, 2014 Share Posted August 20, 2014 I have that functionality already in my RTS code. However i don't draw directly on the terrain but just draw a 2D rectangle. If you wan't to do it like that, i can help. //Edit. sorry again missunderstood the post. Sometimes rereading it helps. i currently just show the health of selected units when they are active. Mostly just as Command & conquer does it. (at least the c&c parts i know and played.) Quote Link to comment Share on other sites More sharing options...
Rick Posted August 20, 2014 Share Posted August 20, 2014 I did this once in LE 2.x where I had a plane that I put a texture on it. Then I would take every vertex of that plane and cast a ray downward until it hit something. Then I would set that planes vertex to the Y collision. If you do that with all vertices then it'll hug the terrain/whatever. The more verts the longer this process will take but the better hugging you'll get. If your terrain is very hilly then you'd want more. I don't know if Lua gives us vertex manipulation access though. Quote Link to comment Share on other sites More sharing options...
Naughty Alien Posted August 21, 2014 Share Posted August 21, 2014 ...way i have implemented this in one of my classes at uni is rather different..basically, geometry was exported with 2 UV channels, and corresponding textures representing circles around characters, were simply drawn with specific blend mode, on to 2nd UV channel, where UV coords for 'decal' (it was not decal, but lets call it that way), are taken from specific character position..works perfect, wrapping perfectly over geometry without any issues, and its extremely simple and fast, doesnt require any physics and it can work on every toaster out there.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.