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 / Interactive popup screen in a 3d world question

Author
Message
Levanthus
21
Years of Service
User Offline
Joined: 17th Apr 2003
Location: Cumbria, UK
Posted: 20th Jun 2010 18:00
Ok how exactly would one make an interactive pop up screen in a 3d world, the world as follows :-

i have done the "pick object" routine on the keyboard so that it does stuff when you click it, but what i want/need it to get a screen like this :-

to pop up, so you can click the letters and "Type" the answer to the riddle on the screen.

In summary:
Click on keyboard --> brings up screen with clue and keyboard on it --> press lettered keys to type the answer on the screen

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.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 20th Jun 2010 21:40
This thread has lots of discussion about typing in games. It was part of a commercial project that included...10 typing games

luskos
17
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 20th Jun 2010 23:53 Edited at: 20th Jun 2010 23:57
It`s easy to use keyword$ = entry$(1)Something like this:



You can use the whole virtual monitor screen, without virtual keyboard and the player can type the answer with the real keyboard there.You only check if the answer is correct or not.

EDI: Btw how you make your keyboard work?You didn`t mention in the other thread how you do it.You can still post the answer there so someone can learn from reading it.Did you used plain infront of the keyboard?

Coding is My Kung Fu!
And My Kung Fu is better than Yours!
Sasuke
18
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 21st Jun 2010 00:15
Nice and simple, with that image you've got of the keyboard, you just do screen area check. So you store the coordinate for each button, then check if the mouse is within it. If it is and there's a mouse click, do what ever that button does.

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
Levanthus
21
Years of Service
User Offline
Joined: 17th Apr 2003
Location: Cumbria, UK
Posted: 21st Jun 2010 12:59
Ok for some reason this isn't working for me, i've looked all through that thread that batVink showed and alot fo them seemed to used luskos' suggestion... however, i just can't get it to work.


Now when i click the keyboard it brings up the plane that makes the "screen" but when i type, nothing shows up and even if i type the correct keyword nothing happens, i'm not sure why, i get the impression that it has something to do with the if pick object (mousex(),mousey(),300,300)>0 and mouseclick()=1 line, as when i hold the mouse button down i can see the text prompt flickering on and off

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.
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 21st Jun 2010 15:44 Edited at: 21st Jun 2010 15:47
This code works for me:



Run it by itself to show that it works for you. Then insert it into your code and see if you get the same result. If it doesn't work, you might try placing the DRAW TO SCREEN command before it.

Bear in mind that there is nothing in the code to give the user a certain number of tries to get the code and it will stay there until the user gets it right.


Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 22nd Jun 2010 00:34
You need to have a loop for the typing part. What your code is doing now is it is making the computer screen, giving you an impossibly small amount of time to type the code, and then erasing everything and going back to the game. One easy way to fix this could be by adding a loop to your ComputerScreen() function.



That would make you keep trying until you got it right. Of course, you wouldn't need to press anything if you got it right, it would just go back to the game (you would need to add "and returnkey()" to your IF to make it quit when you've got it right AND you press enter). Just something else that may be confusing-- ENTRY$() doesn't work like INPUT. It doesn't pause and wait for you to type, it just tells you what has been typed and moves on. This is why you need some sort of loop to give you time to type.

Sasuke
18
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 22nd Jun 2010 06:38
Quote: "to pop up, so you can click the letters and "Type" the answer to the riddle on the screen."


Everyone did see this line right, so why is everyone doing something else?

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 22nd Jun 2010 07:03
Quote: "Now when i click the keyboard it brings up the plane that makes the "screen" but when i type, nothing shows up and even if i type the correct keyword nothing happens"


You did see this line, right? Nothing was showing up for him. I was trying to help him figure out how to get the text to show up.


Sasuke
18
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 22nd Jun 2010 07:40
Very true, my issue is that one minute he says he wants to click on the keyboard keys using the mouse, then everyone including him starts using entry$() for key input.

What did I miss, it's like everyone read something different. Even the title is the clue 'Interactive'.

I would like to help out, but on what, should I do what was originally intended, or the non interactive version?

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
luskos
17
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 22nd Jun 2010 16:31
Just everyone picked on entry way because it`s easy to do.I think Levanthus originaly wanted interactive keyboard, only because this was the way he imagined how it can be done.Now knowing the entry way is faster and easy to do he stick to it.That`s why i sugested it.

Coding is My Kung Fu!
And My Kung Fu is better than Yours!
Levanthus
21
Years of Service
User Offline
Joined: 17th Apr 2003
Location: Cumbria, UK
Posted: 22nd Jun 2010 17:51
Actually my main reason for wanting the Keyboard image was purely because i know that not all keyboards are the same, for example the clue being

Within the longest lettered line you will see
the longest word there holds the key.

Basically it's asking for the longest word you can write using only the top row of keys on a keyboard.
On a QWERTY the longest word you can write is "Typewriter" however that doesn't apply if you have an AZERTY keyboard, hence i wanted the image of the QWERTY for people to work from, does that make sense? So yes i'd like it so you can click the letters but currently just typing it is easier.

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.
Sasuke
18
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 22nd Jun 2010 19:20
Oh, I see guys. Though never lose sight of what was originally intended. Try to the very best of your ability to achieve it, only then you should ask for help. Obviously, if you don't have a clue how to do it, search first then ask for help.

As for interactivity with that keyboard, since you just put it on a plain facing the camera, you might as well get rid of the plain and paste the image to the screen, then do something like this:



All you need to do is store the image coordinates and ascii key code for each key in the array...



I wouldn't exactly code it like this, but just an example.

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
Levanthus
21
Years of Service
User Offline
Joined: 17th Apr 2003
Location: Cumbria, UK
Posted: 23rd Jun 2010 14:25 Edited at: 24th Jun 2010 14:32
That's awesome, and pretty much exactly what i needed, my only problem is i don't understand how it works, I'm not particularly adept at arrays, i keep looking at them but i can't seem to get my head around them. I mean i understand some of it, like i can understand and see where you create the keys but if you had like a bitmap image of the keyboard on the screen, could you use co-ordinates from the image rather than making new bitmaps for each key?

I don't mean to sound ungreatful but without REM statements or comments in the code i don't understand what it does

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.
Levanthus
21
Years of Service
User Offline
Joined: 17th Apr 2003
Location: Cumbria, UK
Posted: 24th Jun 2010 15:08 Edited at: 24th Jun 2010 17:03
Holy crap... wait i think i got it!
Sat just staring at the code for like a day and i think i finally figured it out using my alrady breated bitmap and everything, my only problem now is putting the keys in the correct place but i'm slowly working on it.

But yes thank you so much for your help!!

Oh quick edit

how would you do backspace/delete?

Also when i try to incorporate it into my main code, it doesn't work, when i compile it, i click on the keyboard and the whole thing just freezes up and nothing happens.

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.
Sasuke
18
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 24th Jun 2010 19:22 Edited at: 24th Jun 2010 19:23
Here's an update snippet including space, delete and comments:



Quote: "Also when i try to incorporate it into my main code, it doesn't work, when i compile it, i click on the keyboard and the whole thing just freezes up and nothing happens."


How are you implementing into your code, though I wouldn't implement it as it is, maybe a few alterations, but this depends on how/where your using it.

A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.
Levanthus
21
Years of Service
User Offline
Joined: 17th Apr 2003
Location: Cumbria, UK
Posted: 27th Jun 2010 13:09 Edited at: 27th Jun 2010 14:44
AH Solved, it, just needed a Sync in there, all is good.

Thank you for the Space and backspace bit too thats awesome, i really appreciate all your help thank you

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.
Levanthus
21
Years of Service
User Offline
Joined: 17th Apr 2003
Location: Cumbria, UK
Posted: 22nd Jul 2010 16:01
what about the escape key to exit the puzzle if the player can't solve the puzzle?

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

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

Login to post a reply

Server time is: 2024-11-24 13:54:11
Your offset time is: 2024-11-24 13:54:11