Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / show what object is "selected"

Author
Message
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 17th Jan 2004 23:43
i have it so when your mouse is over an object and you click on it, it 'selects' it. but how would i go about it showing that the object is selected...
i could "draw circle" or whatever, but dont 2d commands slow down the 3d world?
thanx for any suggestions

Slayer
21
Years of Service
User Offline
Joined: 15th Nov 2003
Location: CA
Posted: 18th Jan 2004 00:15
Just make a name like A. If something then A=1.
Then if A=1 then do something.

I dont know how to spell
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 18th Jan 2004 00:18
oh yeah...i know that, sorry i didnt explain exactly, i'll try again:
i need to show VISUALLY that the object is selected, like in a RTS it draws a box around the guys, i want something like that.

Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 18th Jan 2004 05:07
Darwin, unless you are really flying through your RTS, I don't think that you're quite up to the stage where you need to draw the selection circles around units.

What I did for my RTS was;



You can see I am using Types, and the selected flag is set to one when it is selected, and at the same time, I colour the object green.

Then, when the selected flag goe's back to 0, i colour the object white again.

This just a temporary thing, untill I get the engine sorted out, and up to the stage where I can add eye candy.

Hope I Helped...


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 20th Jan 2004 04:34
hrmm...well, i am just planning everything out and i want to know how i am going to do everything almost exactly, so i dont have to sit and stare at the computer a long time trying to figure things out :p
thanx for the idea jessT

i think what im going to do is: have a loaded 'selected' object and make it a 'ghost' and just put it at the same place as the selected object.

Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 20th Jan 2004 06:23
I wouldn't do that, you'll kill your FPS.

Think about it, if you have over 100 units on screen at once ( which will end up happening during the big battles etc ) and on top of that, you have 100 ghosted units, you're looking at doubling your already high poly count, which will just kill your computer.

What you need to do, is set up your code so that everything runs off of flags; You select a unit, it's selected flag is set to 1; You tell a unit to move, it's move flag is set to 1; You tell a unit to attack, it's attack flag is set to 1; etc.etc.

That way, when you go to add your eyecandy, and have the units that are selected have a little circle around their feet, you can just put in a new function that doesn't need to haev any of your other code changed.
ie, jsut put in
If unitselected = 1 Then Paste cirle around feet

Hope I Heleped...


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 20th Jan 2004 07:27
flags, yes thats what i was going to do thanx jt

Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 22nd Jan 2004 11:15
Well, Great minds think alike, eh?




Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 23rd Jan 2004 07:40
lol, true

Login to post a reply

Server time is: 2025-05-22 11:53:29
Your offset time is: 2025-05-22 11:53:29