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 / Problem With ScanCode!

Author
Message
Duplex
User Banned
Posted: 19th May 2007 22:38
Ok, I'm a big noob when It comes to DBP, I'm just starting to learn it, any way...

I'm makin a simple music player and I want the music to start when I hit 'P' (scancode: 25). I can Get it so you hit any key to play but thats not what I want.

I get an error when I type this in:



What Am I doing wrong?

See The Duplex Creations Website at:
http://www.duplexcreations.mdhost.info
Roxas
19
Years of Service
User Offline
Joined: 11th Nov 2005
Location: http://forum.thegamecreators.com
Posted: 19th May 2007 23:19
if Keystate(25) then play music 1


[B] - LINKIN PARK - [/B]
Duplex
User Banned
Posted: 20th May 2007 08:14
Still Wont work, It wont play the music.

See The Duplex Creations Website at:
http://www.duplexcreations.mdhost.info
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 20th May 2007 09:06
its rapidly firing many times, you need to trap the key press once in a flagging method.
key tamers are found on the code snippets board.

Duplex
User Banned
Posted: 20th May 2007 13:18
Sorry For being a noob, but I cant find any of these 'Key tamers'.

Can you give an example?

See The Duplex Creations Website at:
http://www.duplexcreations.mdhost.info
vorconan
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Wales
Posted: 20th May 2007 15:39


That should work, I don't use the keystate command.
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 20th May 2007 19:11
This should do it .



TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 20th May 2007 19:43 Edited at: 20th May 2007 19:52
Lol!

Had to edit this message because last night I simply couldn't get Play Music to work - however hard I tried. I thought the command was broken.

I've just gone back to the snippet I wrote and the damn thing works perfectly today. Doh!

Here's the snippet I wrote...



TDK_Man

indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 1st Jun 2007 16:28
I wrote one for this example a few days ago
http://forum.thegamecreators.com/?m=forum_view&t=106979&b=7

RapidZ
17
Years of Service
User Offline
Joined: 2nd Apr 2007
Location: Corby, Northants
Posted: 1st Jun 2007 18:17
I dont no if i am correct so could someone tell me. Does scancode only allow one button to be press at a time, while keystate allows more than 1 to be pressed at the same time?

RapidZ - http://thecomputerhideout.com
vorconan
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Wales
Posted: 2nd Jun 2007 01:30
No
RapidZ
17
Years of Service
User Offline
Joined: 2nd Apr 2007
Location: Corby, Northants
Posted: 2nd Jun 2007 02:50
So what is difference?

RapidZ - http://thecomputerhideout.com
Slayer93
20
Years of Service
User Offline
Joined: 5th Aug 2004
Location: I wish I knew
Posted: 3rd Jun 2007 05:15
The difference is scancode tells what key is being pressed so you can only tell if one key is active and keystate tells you if a key is being pressed so you can see if multiple keys are being pressed. So yeah keystate can tell if multiple keys are being pressed.

Current Projects - Zio Engine: RPG Engine and OMMO

RapidZ
17
Years of Service
User Offline
Joined: 2nd Apr 2007
Location: Corby, Northants
Posted: 3rd Jun 2007 18:23
Ok, ty Slayer93 for clearing that up.

RapidZ - http://thecomputerhideout.com

Login to post a reply

Server time is: 2024-11-25 17:33:57
Your offset time is: 2024-11-25 17:33:57