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 / how do you set the range you can click?

Author
Message
Graysire
11
Years of Service
User Offline
Joined: 18th Oct 2013
Location:
Posted: 22nd Jan 2014 18:18
is there a way to set the range I can click my objects at?
Derek Darkly
13
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 23rd Jan 2014 00:40
Hi there Graysire,
I think the commands you want are:

PICK SCREEN
PICK OBJECT
GET PICK DISTANCE()


If you can describe more in detail what you want to do, or provide a small sample code then I/we can provide more help.

Graysire
11
Years of Service
User Offline
Joined: 18th Oct 2013
Location:
Posted: 23rd Jan 2014 18:50
Well currently I can click my objects from any distance to activate there code. how do I make it so that when I am within a certain distance of them and I click they use the code?
ShellfishGames
12
Years of Service
User Offline
Joined: 6th Feb 2013
Location:
Posted: 23rd Jan 2014 19:00
Isn't get pick distance() just what you need then?

Have you used pick screen and pick object in your code so far? If that's how you did it, wouldn't you just do something like this:



...?

Graysire
11
Years of Service
User Offline
Joined: 18th Oct 2013
Location:
Posted: 28th Jan 2014 19:27
pick screen?
ShellfishGames
12
Years of Service
User Offline
Joined: 6th Feb 2013
Location:
Posted: 28th Jan 2014 21:44
Well, we don't have enough- actually we don't really have any information on how you implemented the clicking thing, so we ca just assume you used pick object or pick screen for that (if you don't know any of these commands, type them into the DBP editor and press F1).

I haven't used them so far, but as it seems they work together with the get pick distance() command which should be just what you need.

Something like this in your mainloop would maybe do the job:



Login to post a reply

Server time is: 2025-05-17 03:57:36
Your offset time is: 2025-05-17 03:57:36