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.

Newcomers DBPro Corner / Pick screen question

Author
Message
Levanthus
21
Years of Service
User Offline
Joined: 17th Apr 2003
Location: Cumbria, UK
Posted: 17th Jun 2010 17:10
Ok i have a question about this pick screen command, i understand the general gist of it but if i have a 3d environment which is one solid object how would i make it work on a very specific area?

i have the following scene going on:-


now i want to be able to click on the keyboard to bring up a menu of some kind, like a point and click adventure game, now the whole scene is one solid object, is it possible to assign a pick screen command for it, like you have to be facing the "screen" and within the rough area of where the keyboard is? I know there is a pick object command also but i figure that if the whole scene itself is a solid object it probably wouldn't work right?

Windows 7 64 bit, AMD Phenom II x4 Black edition, 4 GB Ram, Radeon HD 4650, 540 GB HDD

I can see from your smile, you're not here for the sunset.
luskos
17
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 17th Jun 2010 17:29
You can use dummy object like plain textured with transparent image.Set image colorkey comand to desired color to make the texture so the object is invisible, i think hidden objects do not work with pick screen and pick object.Place the plain infront of the keyboard and then do pick screen and pick object.Then when your mouse is over the object you can change the texture of the plain with some in other color like red or blue and ghost object for better effect.The player know this object is interactive when you do that.You can also play with set object comand to exclude the plain from being affected by lights, it may look better without.

Where there is a will, there is a way.
I often edit my posts, that`s who i am
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 17th Jun 2010 18:28
Use mousex() and mousey() and check to see if the mouse is in that region on the screen, if it is, and mouseclick() = 1, then you have your event.

luskos
17
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 17th Jun 2010 21:29 Edited at: 17th Jun 2010 21:32
Using dummy plain you need to add one extra check for distance to the object so the player cant control the virtual pc from the door of the room for example.If the player is too far from the object the keyboard event is disabled, clicking just wont trigger it, but still you can show to player that this object can be interacted with changing the texture with visible one when object is hovered with the mouse.

Edit: I make some spell check, there is people in the forum that get very itchy on this.

Where there is a will, there is a way.
I often edit my posts, that`s who i am
Levanthus
21
Years of Service
User Offline
Joined: 17th Apr 2003
Location: Cumbria, UK
Posted: 21st Jun 2010 10:29
Thanks for that guys

What i ended up doing was making a duplicate of the keyboard itself, and made it ever so slightly bigger (mainly because when i made i plain i spent so much time compiling/recompiling over and over just trying to position it properly), then i textured it black to make it invisible, but made it so when the mouse passes over it, it "glows" yellow Like so :-



Windows 7 64 bit, AMD Phenom II x4 Black edition, 4 GB Ram, Radeon HD 4650, 540 GB HDD

I can see from your smile, you're not here for the sunset.

Login to post a reply

Server time is: 2024-11-23 14:25:22
Your offset time is: 2024-11-23 14:25:22