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 Professional Discussion / Pick Object help please!!!

Author
Message
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 7th Oct 2004 09:29
I am trying to use Pick Object for my interface. However, my interface is inside a building. Whenever I call Pick Object, it keeps telling me I'm pointing at the building when I'm clearly pointing at the object (eg button) or AT LEAST the object behind it (Control panel).

Anyone got any gems on this one?



Thats the line that does it..

This might sound stupid.. But what does the Start and End arguements do? I have set them to 0 and 5.. Yet they still pick up objects that are MUCH more than 5 units away..

Nick (PLEEEEEASE HELP!!)

PS: I have a gut feelign its to do with collisions.. Is there any way to tell it not to bother checking collisions on the building?

JerBil
21
Years of Service
User Offline
Joined: 8th May 2004
Location: Somewhere along the Z axis...
Posted: 7th Oct 2004 10:30 Edited at: 7th Oct 2004 10:32
You're better off than you think. The key is the object start,object end part. It's just a list of object numbers you want to pick
from all objects on the screen. Say you have a cube thats object 2, and a ball thats object 8. Just use those numbers as start and end. Of course, it will return the numbers in between if your mouse pointer is over those. You need an If Then statement to check for what you want.

Now when you put your mouse pointer over an object, you check to see if you are gettin the number in question. Say you get 8, you know you're over the ball, and so on.

If you only want one object, you can use that number for the object start, and the object end too. In that case, no other objects are in you list to detect. If the pointer is not over an object in the list, you'll get a zero.

-JerBil
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 7th Oct 2004 11:16
AHHHH!!! THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU, THANK YOU!!!

The way I interpretted the manual was the start and end were distances!! I NEVER guessed they were object ID ranges!!! The manual needs SERIOUS rewording!

Oh if only there was a way to rate posts in this forum - you'd be getting a 5* there mate!!


Cheers.

Nick

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 7th Oct 2004 11:16
PS: I think this should be stickied.. Or am I the ONLY person in this forum that thought pick object's start and end arguements were distances?

JerBil
21
Years of Service
User Offline
Joined: 8th May 2004
Location: Somewhere along the Z axis...
Posted: 7th Oct 2004 13:51
Thanks Nicholas. I think most everyone here learns the same way, by reading the posts and writing programs to test stuff. It's hard work but can be rewarding, so just hang in there.

-JerBil
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 7th Oct 2004 14:38
Yeah I'm hanging in.. I really like the language. The thing i dont like (but this is programming in general, not DB) is when you hit that brick wall and you sit there staring at the screen knowing its gonne be a long night..

Login to post a reply

Server time is: 2025-05-31 00:45:51
Your offset time is: 2025-05-31 00:45:51