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 01-09-2005, 02:43 PM
Aethorpe Aethorpe is offline
Their black hands protect
Aethorpe's Avatar
Join Date: Dec 2004
Location: Beyond infinite.
Posts: 265
Aethorpe is on a distinguished road
Send a message via AIM to Aethorpe Send a message via MSN to Aethorpe
if (keypressed) { ...

Ok, I know that this works 0-10 with up, left, down, right, S, A, D, M, tab, Q, P.

NPC Code:
if (keypressed) {
if (keydown(#)) {

}
}



However, I was wondering if there was a method that would detect keys other than those stated above, such as the numberpad, insert, home, end, delete, and other letters, etc. If anyone could volunteer their knowledge and experiences with this, I would appreciate it.
__________________
Reply With Quote
  #2  
Old 01-09-2005, 03:38 PM
middo middo is offline
VHE Monkey
middo's Avatar
Join Date: Aug 2002
Location: California
Posts: 327
middo is on a distinguished road
Send a message via AIM to middo
NPC Code:

if (keypressed && strequals(#p(1),k)) {
say2 OMG U PRESS K KEY.
}



That's the lazy way, and there are many better ways of putting it together, but I forget them right now.
(Some people are obsess with the keycode function, I just say screw it))
Reply With Quote
  #3  
Old 01-09-2005, 03:54 PM
Aethorpe Aethorpe is offline
Their black hands protect
Aethorpe's Avatar
Join Date: Dec 2004
Location: Beyond infinite.
Posts: 265
Aethorpe is on a distinguished road
Send a message via AIM to Aethorpe Send a message via MSN to Aethorpe
Quote:
Originally Posted by middo
NPC Code:

if (keypressed && strequals(#p(1),k)) {
say2 OMG U PRESS K KEY.
}



That's the lazy way, and there are many better ways of putting it together, but I forget them right now.
(Some people are obsess with the keycode function, I just say screw it))
Thanks, but, uh, care to explain how that works? I'm not sure I understand '#p(1)'. Sorry, I am just starting out with this.

I also had a question about strings, what command updates a string to a new value? Maybe I am blind, but I seriously do not see one. I used setstring to create the string, this is correct, right? And to change it?

I really appreciate the help, thanks again.
__________________
Reply With Quote
  #4  
Old 01-09-2005, 05:28 PM
DarkShadows_Legend DarkShadows_Legend is offline
Cult of the Winky
DarkShadows_Legend's Avatar
Join Date: Apr 2003
Location: Florida
Posts: 614
DarkShadows_Legend is on a distinguished road
Send a message via AIM to DarkShadows_Legend
http://forums.graalonline.com/forums...essed+tutorial

This could help some.
__________________
- Criminal X

"I rather be hated for being myself, than be liked for being what you like best. I go above the influence, not under." - Me
Reply With Quote
  #5  
Old 01-09-2005, 06:13 PM
Nappa Nappa is offline
The Great Nappa
Nappa's Avatar
Join Date: Sep 2003
Location: Florida
Posts: 1,911
Nappa is on a distinguished road
Send a message via AIM to Nappa
Dark, how dare you show off the winkie gang in your signature but not use the normal yellowish one ? I DEMAND A RECOUNT.
__________________
Reply With Quote
  #6  
Old 01-09-2005, 10:02 PM
Gman4pwnu Gman4pwnu is offline
Banned
Join Date: Jan 2004
Posts: 434
Gman4pwnu is on a distinguished road
Send a message via AIM to Gman4pwnu
if (keypressed){
setplayerprop #c, #p(0) #p(1) #p(2);
}

One of them should tell which key it is.
Reply With Quote
  #7  
Old 01-09-2005, 10:08 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
#p(0) is the ascii of the key. #p(1) is the human-readable form.
__________________
Skyld
Reply With Quote
  #8  
Old 01-09-2005, 10:50 PM
EikeSiewertsen EikeSiewertsen is offline
Fry
EikeSiewertsen's Avatar
Join Date: Apr 2001
Location: Germany
Posts: 64
EikeSiewertsen is on a distinguished road
Send a message via ICQ to EikeSiewertsen
Its all in the newfeatures*.txt
__________________
Graal Wiki - Graal Forum
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 05:30 AM.


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