View previous topic :: View next topic |
Author |
Message |
lethal255 Don't just complain, do something about it

Joined: 11 Nov 2003 Posts: 76 Location: Right behind you
|
Posted: Sat Oct 16, 2004 5:25 am Post subject: About key press command |
|
|
While using the "on key press" command, I noticed that the scancode didn't have the standard up key downkey in it and there constants didn't work. Is there anyway I can use the up key and down key with key press or an alternative? I really don't want to use keys like H B N M _________________ "what everyone went around calling you white stormy?"
"you mean, there's...a ...black stormy?"
"No" |
|
Back to top |
|
 |
Flamer The last guy on earth...

Joined: 04 Feb 2003 Posts: 725 Location: New Zealand (newly discovered)
|
Posted: Sat Oct 16, 2004 7:08 am Post subject: |
|
|
you could improvise, like use "key is pressed" command.
Code: | while( key is pressed(Key:Up) == false ) do(
wait(1)
) |
don't necessarily need to use this way, but it does some what similar job _________________ If we were a pack of dogs, IM would be a grand Hound, CN would be a very ficious little pitball, and Giz...well, it doesn't matter breed he is, he'd still be a bitch
(no offense to anyone that was mentioned) |
|
Back to top |
|
 |
Uncommon His legend will never die

Joined: 10 Mar 2003 Posts: 2503
|
Posted: Sat Oct 16, 2004 9:12 am Post subject: |
|
|
Flamer, he is talking about the "is key pressed" command.
lethal, take another look at scancode.hsi, in the middle of the NUMPAD definitions.
Code: | 72,key:UP
75,key:LEFT
77,key:RIGHT
80,key:DOWN |
|
|
Back to top |
|
 |
Shadowiii It's been real.

Joined: 14 Feb 2003 Posts: 2460
|
Posted: Sat Oct 16, 2004 10:06 am Post subject: |
|
|
Add
" include, scancode.hsi "
at the beginning of your file and you can do it Flamer's way (Key: Up , etc.) _________________ But enough talk, have at you! |
|
Back to top |
|
 |
Flamer The last guy on earth...

Joined: 04 Feb 2003 Posts: 725 Location: New Zealand (newly discovered)
|
Posted: Sat Oct 16, 2004 8:36 pm Post subject: |
|
|
"on key pressed" "is key pressed"...
YOU GUYS NEED TO SORT OUT WHAT COMMANDS YOU ARE TALKING ABOUT!
for gods sake, look in the plotdictionary before posting  _________________ If we were a pack of dogs, IM would be a grand Hound, CN would be a very ficious little pitball, and Giz...well, it doesn't matter breed he is, he'd still be a bitch
(no offense to anyone that was mentioned) |
|
Back to top |
|
 |
Uncommon His legend will never die

Joined: 10 Mar 2003 Posts: 2503
|
Posted: Sat Oct 16, 2004 8:48 pm Post subject: |
|
|
It's rather simple, really.
"is key pressed" is a command
"on key press" is a script.
And, Shadow, he said he's been looking through scancode, so he obviosuly has it included already. Way to go not reading all of his post, you silly wombat. |
|
Back to top |
|
 |
Me HI.

Joined: 30 Mar 2003 Posts: 870 Location: MY CUSTOM TITLE CAME BACK
|
Posted: Sat Oct 16, 2004 9:18 pm Post subject: |
|
|
the command is "key is pressed(scancode)," uncy. |
|
Back to top |
|
 |
Uncommon His legend will never die

Joined: 10 Mar 2003 Posts: 2503
|
Posted: Sat Oct 16, 2004 9:44 pm Post subject: |
|
|
Sorry, I was getting confused with something else.
Too much Sphere lately. |
|
Back to top |
|
 |
MultiColoredWizard Come back, baby! The Breastmaster

Joined: 01 Feb 2003 Posts: 1232
|
Posted: Sun Oct 17, 2004 12:26 am Post subject: |
|
|
plotscr.hsd already has upkey, dowkey, leftkey, menukey, cancelkey, etc defined though. |
|
Back to top |
|
 |
Shadowiii It's been real.

Joined: 14 Feb 2003 Posts: 2460
|
Posted: Sun Oct 17, 2004 9:18 am Post subject: |
|
|
It never worked for me until I included scancode, MCW. Believe me, I tried. _________________ But enough talk, have at you! |
|
Back to top |
|
 |
Mad Cacti Guest
|
Posted: Sun Oct 17, 2004 6:37 pm Post subject: |
|
|
The command 'key is pressed' uses the constants 'key: left', 'key: L', 'key: esc' etc. scancode.hsi MUST be included to use these constants.
The command 'wait for key' uses the constants 'menukey', 'anykey', 'upkey', etc. These constants are declared in plotscr.hsd, you don't need to do anything to use them.
The two sets of constants are not interchangable.
You are all mixing up your commands. |
|
Back to top |
|
 |
lethal255 Don't just complain, do something about it

Joined: 11 Nov 2003 Posts: 76 Location: Right behind you
|
Posted: Mon Oct 18, 2004 6:00 pm Post subject: |
|
|
sorry, but shortly after the post and read the scancode more thourghly, and relized that num 8 and downkey responded to that same scacode(80 i think it was). _________________ "what everyone went around calling you white stormy?"
"you mean, there's...a ...black stormy?"
"No" |
|
Back to top |
|
 |
|