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 / keyboard functions

Author
Message
haribubba
20
Years of Service
User Offline
Joined: 28th Dec 2003
Location:
Posted: 31st Dec 2003 01:19
this may well be a very stupid question, but how do i check it say the 'W' button is pressed on the keyboard. I read throught the manual, but im not sure if i understand.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 31st Dec 2003 01:57
if inkey$ = "W"

or

if scancode(17) = 1

BatVink (formerly StevieVee)
http://facepaint.me.uk/catalog/default.php
Alastair Zotos
20
Years of Service
User Offline
Joined: 30th Dec 2003
Location: a bin
Posted: 31st Dec 2003 02:15
if keystate(some wierd number)=1

thats what you do
you can check the wierd numbers if you go to "help" and then "examples" and look for keyboard control, press the button you want, say its the W key, you press that and at the bit that says "scancode" it sould say 17, so you just type
"if keystate(17)=1 then "and so on!
happy?

fart like you've never farted before!!!
(five seconds later)
Dude that stinks!!! get out of my house!
haribubba
20
Years of Service
User Offline
Joined: 28th Dec 2003
Location:
Posted: 31st Dec 2003 02:57
yes. thank you.

but i also have another question.

this is the code i have so far. it compiles with no errors. but when i try to run it, the cube does not move or rotate at all.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 31st Dec 2003 04:36
haribubba, you are better off using Keystate() function IMHO. there is a scancode chart around which you will need because Keystate function accepts 1 parameter, the scancode of the key you are interested in.

-RUST-

VB.NET makes me all goose-pimply! http://www.mod2software.com
haribubba
20
Years of Service
User Offline
Joined: 28th Dec 2003
Location:
Posted: 31st Dec 2003 04:45
yes i realized that.
also, it looked like it wasn;t moving because there was nothing to refrence the cube to!

but i still cant seem to move the camera.
haribubba
20
Years of Service
User Offline
Joined: 28th Dec 2003
Location:
Posted: 1st Jan 2004 04:17
also, would it be hard to code an object that always faces the player? i.e. a cube which one side would always face the player and would rotate to face the player.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 1st Jan 2004 07:51
rotate in smaller incrememnts to test the code, then you'll see it moving regardless of other objects

-RUST-

VB.NET makes me all goose-pimply! http://www.mod2software.com
Eric T
21
Years of Service
User Offline
Joined: 7th Apr 2003
Location: My location is where I am at this time.
Posted: 1st Jan 2004 08:11
Quote: "if keystate(some wierd number)=1"


heres those weird numbers in a nice printable chart:



If i ain't here, i'm probably playing DOA2 Hardcore on the PS2
Former name : Liquidz_Snake
PiratSS
22
Years of Service
User Offline
Joined: 18th Oct 2002
Location:
Posted: 1st Jan 2004 08:35
More specific: Those "weird nubmers" are called ASCII which stands for American Standard Code for Information Interchange.

Eric T mapped it out really nicely for you(Said PiratSS while saving his image)

Dual AMD Athlon MP 2x1GHZ | IBM 15000Rpm SCSI 73.4 Gb X 2 | e-GeForce Ti4400 | Audigy 2 + 7.1 Surround sound | 17' Monitor | Ugly mouse
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 1st Jan 2004 15:05
Nope, those weird numbers are IBM keyboard scancodes and originally were all about the key positions on the keyboard - nothing to do with ASCII at all.

For free Plug-ins, source and the DBPro Interface library for Visual C++ 6 and .NET
http://www.matrix1.demon.co.uk
Eric T
21
Years of Service
User Offline
Joined: 7th Apr 2003
Location: My location is where I am at this time.
Posted: 1st Jan 2004 15:34
Quote: "IBM keyboard scancodes "


'Ding, right on the dot, and i didn't create the table, i found it about 6 years ago, and put it on a freinds site...

If i ain't here, i'm probably playing DOA2 Hardcore on the PS2
Former name : Liquidz_Snake
demons breath
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 1st Jan 2004 21:10
The codes on that table wouldn't work on a keyboard with a different layout however (e.g. from a different country). You might be better of using inkey$ or controlkey, escapekey, etc...

Am I the only one here who's really confused?
haribubba
20
Years of Service
User Offline
Joined: 28th Dec 2003
Location:
Posted: 2nd Jan 2004 09:17
thanks for your help with the keyboard question!
any ideas for my second question would be greatly appreciated
haribubba
20
Years of Service
User Offline
Joined: 28th Dec 2003
Location:
Posted: 2nd Jan 2004 09:18
*uh, i mean, third question!
Sly D
22
Years of Service
User Offline
Joined: 15th Oct 2002
Location:
Posted: 2nd Jan 2004 14:08
Please have in mind this is not tested. You could do something like this: Store the camera positions in variables, and then have this code : POINT OBJECT Object Number, CameraX, CameraY, CameraZ. Hope it works.

A cute looking koala with a WHAT!? THEY can't use Kalashnikovs, can they?

Login to post a reply

Server time is: 2024-11-25 23:28:23
Your offset time is: 2024-11-25 23:28:23