Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-03-2005, 02:20 AM
cheatbobb cheatbobb is offline
The_Danish
cheatbobb's Avatar
Join Date: Apr 2004
Location: Canada
Posts: 15
cheatbobb is on a distinguished road
Question 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.
__________________
Reply With Quote
  #2  
Old 06-03-2005, 02:58 AM
Velox Cruentus Velox Cruentus is offline
Registered User
Velox Cruentus's Avatar
Join Date: Dec 2004
Location: Quebec, Canada
Posts: 465
Velox Cruentus is on a distinguished road
Send a message via ICQ to Velox Cruentus Send a message via AIM to Velox Cruentus
PHP Code:
if (keypressed)
{
  
setplayerprop #c,#p(0) -- #p(1);

Use that to find out. #p(0) should give you the key code.
__________________
In a world of change... Who'll you believe?
Reply With Quote
  #3  
Old 06-03-2005, 06:08 PM
cheatbobb cheatbobb is offline
The_Danish
cheatbobb's Avatar
Join Date: Apr 2004
Location: Canada
Posts: 15
cheatbobb is on a distinguished road
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...
__________________
Reply With Quote
  #4  
Old 06-03-2005, 07:58 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
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.
__________________
Reply With Quote
  #5  
Old 06-05-2005, 03:08 AM
cheatbobb cheatbobb is offline
The_Danish
cheatbobb's Avatar
Join Date: Apr 2004
Location: Canada
Posts: 15
cheatbobb is on a distinguished road
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.
__________________
Reply With Quote
  #6  
Old 06-05-2005, 06:25 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
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.
__________________
Reply With Quote
  #7  
Old 06-07-2005, 03:03 AM
cheatbobb cheatbobb is offline
The_Danish
cheatbobb's Avatar
Join Date: Apr 2004
Location: Canada
Posts: 15
cheatbobb is on a distinguished road
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.
__________________
Reply With Quote
  #8  
Old 06-07-2005, 03:07 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
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.
__________________
Reply With Quote
  #9  
Old 06-07-2005, 04:08 PM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
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
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial

Last edited by Dach; 06-08-2005 at 07:54 AM..
Reply With Quote
  #10  
Old 06-08-2005, 02:45 AM
cheatbobb cheatbobb is offline
The_Danish
cheatbobb's Avatar
Join Date: Apr 2004
Location: Canada
Posts: 15
cheatbobb is on a distinguished road
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.
__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:23 PM.


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