Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Numpad question (https://forums.graalonline.com/forums/showthread.php?t=59229)

cheatbobb 06-03-2005 02:20 AM

Numpad question
 
I've been away from Graal for a long time...and I've never been able to figure out the keys for the numpad on keydown2. If I could find these it'd be a great help for the tennis sim I'm working on. Thanks in advance.

Velox Cruentus 06-03-2005 02:58 AM

PHP Code:

if (keypressed)
{
  
setplayerprop #c,#p(0) -- #p(1);


Use that to find out. #p(0) should give you the key code.

cheatbobb 06-03-2005 06:08 PM

Thanks...But I think I've tried that (assuming it does the same thing as #k or #K) but I couldn't figure out what to plug in, "Num0" didn't work, just "0" gave me the number line 0 but not the number pad. But I'll try that just in case...

Kaimetsu 06-03-2005 07:58 PM

Quote:

Originally Posted by cheatbobb
Thanks...But I think I've tried that (assuming it does the same thing as #k or #K) but I couldn't figure out what to plug in

Um, you're not supposed to be 'plugging' anything in. Read Velox's script more thoroughly.

cheatbobb 06-05-2005 03:08 AM

That value didn't work with keydown2, it only sensed the number line being pressed. But if anyone was wondering, I did get it to work. You have to use strtofloat(#p(0)) == 53 for example if you want to sense 5. I suppose you can use the keydown2 to sense whether or not it's on the numpad.

Kaimetsu 06-05-2005 06:25 AM

Quote:

Originally Posted by cheatbobb
You have to use strtofloat(#p(0)) == 53 for example if you want to sense 5

Or you can use keydown2.

cheatbobb 06-07-2005 03:03 AM

No, that's my point. Keydown2 doesn't sense NumPad values. Try it yourself.
It does, however, sense that playerprop 0 is the number being pressed, same as the number keys on top. So you have to give it a check for equal values instead of a check for pressed keys.

Kaimetsu 06-07-2005 03:07 AM

Quote:

Originally Posted by cheatbobb
No, that's my point. Keydown2 doesn't sense NumPad values. Try it yourself

keydown2 works fine for numpad keys.

Dach 06-07-2005 04:08 PM

Keypressed isn't called for all the keys.

oh yeah I did put all of the keys that don't call keypressed in my commands.rtf, scroll down to the key assignments thing

cheatbobb 06-08-2005 02:45 AM

Really, is that why? So it'd work with a timeout and keydown2...but it works with a keypressed and equality check, just not keypressed and keydown2.


All times are GMT +2. The time now is 02:22 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.