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 07-30-2005, 12:57 AM
raiden0899 raiden0899 is offline
Registered User
raiden0899's Avatar
Join Date: Oct 2004
Posts: 192
raiden0899 is on a distinguished road
Question Script Not Working

I made a small NPC just to see what the keycodes were (like 'a' is 65). It works with all the keys except the arrow keys. Here's the script:
NPC Code:

//#CLIENTSIDE
if (created) {
this.on=0;
}
if (weaponfired) {
if (this.on==0) {
this.on=1;
disabledefmovement;
}
else {
if (this.on==1) {
this.on=0;
enabledefmovement;
}
}
}
if (keypressed&&this.on==1) {
setplayerprop #c,Code=#p(0) Key=#p(1);
}


Anyone know why it won't work?
Reply With Quote
  #2  
Old 07-30-2005, 01:13 AM
Bl0nkt Bl0nkt is offline
Era Developer
Bl0nkt's Avatar
Join Date: Mar 2005
Location: Pennsylvania
Posts: 1,589
Bl0nkt will become famous soon enough
Send a message via AIM to Bl0nkt
Change (weaponfired) to (keypressed && keydown2(keycode(d),true))
Reply With Quote
  #3  
Old 07-30-2005, 01:22 AM
raiden0899 raiden0899 is offline
Registered User
raiden0899's Avatar
Join Date: Oct 2004
Posts: 192
raiden0899 is on a distinguished road
Quote:
Originally Posted by Bl0nkt
Change (weaponfired) to (keypressed && keydown2(keycode(d),true))
If I use that it's the same thing except I won't need the weapon equipped. Even if I did use that, it wouldn't make the arrow keys work.
Reply With Quote
  #4  
Old 07-30-2005, 02:50 AM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
Arrow keys do not call keypressed.
Reply With Quote
  #5  
Old 07-31-2005, 12:31 AM
Bl0nkt Bl0nkt is offline
Era Developer
Bl0nkt's Avatar
Join Date: Mar 2005
Location: Pennsylvania
Posts: 1,589
Bl0nkt will become famous soon enough
Send a message via AIM to Bl0nkt
Quote:
Originally Posted by raiden0899
If I use that it's the same thing except I won't need the weapon equipped. Even if I did use that, it wouldn't make the arrow keys work.
Read that wrong. Sorry about that. I thought the problem was you couldn't get it to activate.
Reply With Quote
  #6  
Old 08-01-2005, 12:08 PM
hotrian hotrian is offline
Who?
Join Date: May 2003
Location: Eatonville, Washington, 98328
Posts: 56
hotrian is on a distinguished road
Send a message via AIM to hotrian Send a message via MSN to hotrian
Really, No one knows the answer..?
Keys match Player direction O.o
U = 0
L = 1
D = 2
R = 3
Or atleast last I checked they did
Reply With Quote
  #7  
Old 08-01-2005, 03:04 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
Quote:
Originally Posted by hotrian
Really, No one knows the answer..?
Keys match Player direction O.o
U = 0
L = 1
D = 2
R = 3
Or atleast last I checked they did
That is when you use keydown()
__________________
Skyld
Reply With Quote
  #8  
Old 08-01-2005, 03:56 PM
hotrian hotrian is offline
Who?
Join Date: May 2003
Location: Eatonville, Washington, 98328
Posts: 56
hotrian is on a distinguished road
Send a message via AIM to hotrian Send a message via MSN to hotrian
Doesnt it work both ways?
Why would u need to use keydown2
Sence arrow keys cant be capitolized anyway...
The whole point of the script is to see the codes isnt it?
Reply With Quote
  #9  
Old 08-01-2005, 05:05 PM
CheeToS2 CheeToS2 is offline
That Guy
CheeToS2's Avatar
Join Date: Dec 2001
Location: Seattle, WA
Posts: 2,528
CheeToS2 will become famous soon enough
Send a message via AIM to CheeToS2
Quote:
Originally Posted by Tolnaftate2004
Arrow keys do not call keypressed.
They do on Graal 4
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 08:10 PM.


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