Graal Forums  

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

 
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 06-29-2001, 01:44 AM
BocoC BocoC is offline
Registered User
BocoC's Avatar
Join Date: Jun 2001
Location: Washington State, USA
Posts: 980
BocoC is on a distinguished road
Send a message via AIM to BocoC Send a message via Yahoo to BocoC
Ok. I can't stand this...

Help me. Ever since Graal 2.04, I have been having trouble with npcserver. I can't even get a frickin keydown event to work!

NPC Code:

if (playertouchsme) {
setstring this.owner,#a;
message Touched;
timeout=0.1;
}
if (timeout) {
with (getplayer(#s(this.owner))) {
if (keydown(6)) {
this.continue=true;
message Works;
}
}
sleep 2;
if (this.continue==true) {
message Yay!;
} else { timeout=0.1; }
}



I can touch it, because Touched works, but it won't work when the key A is pressed! ARG! Anyone care to help?
__________________
-Boco

FLKJH$TRFG*$(&%>FMG >REN<>F ;.kjsd
  #2  
Old 06-29-2001, 01:49 AM
KJS KJS is offline
The one, The only -
KJS's Avatar
Join Date: Apr 2001
Location: USA, Minnesota
Posts: 1,012
KJS is on a distinguished road
Send a message via AIM to KJS
well keydown only works in a timer I think
__________________
Thanks,
-KJL
  #3  
Old 06-29-2001, 01:53 AM
KJS KJS is offline
The one, The only -
KJS's Avatar
Join Date: Apr 2001
Location: USA, Minnesota
Posts: 1,012
KJS is on a distinguished road
Send a message via AIM to KJS
Cool oh yea it is

lol it is in a timer I didn't look at it all hehe..

well I beleve it has to be clientside also though...

because like in my gravity script I have it in the npc server but clientside...
__________________
Thanks,
-KJL
  #4  
Old 06-29-2001, 02:53 AM
BocoC BocoC is offline
Registered User
BocoC's Avatar
Join Date: Jun 2001
Location: Washington State, USA
Posts: 980
BocoC is on a distinguished road
Send a message via AIM to BocoC Send a message via Yahoo to BocoC
But the 'with' command makes it so the script works with the player... Hmm. I don't like how that was put...
NPC Code:

with (getplayer(#s(this.owner))) {
if (keydown(6)) {


To my knowledge, the 'with' command is making the enclosed script work for that player...
__________________
-Boco

FLKJH$TRFG*$(&%>FMG >REN<>F ;.kjsd
  #5  
Old 06-30-2001, 12:11 AM
T-Squad T-Squad is offline
Banned
T-Squad's Avatar
Join Date: Mar 2001
Location: United States of America
Posts: 1,733
T-Squad is on a distinguished road
No....keydown doesn't work server side. Thats a problem with this...I made a balloon pumping event, but online it didn't work because of a few things:

1) Since keydown can only be reconized clientside, I had to set variables client side that were effected by keydown...

2) Since clientside variables can't be read serverside (according to...I forgot who...) it would be impossible for that script to work the way I want it to...

So instead, make a weapon, and make it use triggeraction....you could do basicly the same thing
  #6  
Old 06-30-2001, 12:18 AM
Er1c Er1c is offline
Registered User
Er1c's Avatar
Join Date: Mar 2001
Location: Chicago, IL
Posts: 791
Er1c is on a distinguished road
Quote:
Originally posted by T-Squad
2) Since clientside variables can't be read serverside (according to...I forgot who...) it would be impossible for that script to work the way I want it to...
It wouldn't be imposible, you could just use level.vars...
__________________
Eric Kraft
  #7  
Old 06-30-2001, 12:21 AM
T-Squad T-Squad is offline
Banned
T-Squad's Avatar
Join Date: Mar 2001
Location: United States of America
Posts: 1,733
T-Squad is on a distinguished road
Quote:
Originally posted by Er1c


It wouldn't be imposible, you could just use level.vars...
Level.vars are able to be read if set clientside, then serverside reads them?
  #8  
Old 06-30-2001, 12:21 AM
BocoC BocoC is offline
Registered User
BocoC's Avatar
Join Date: Jun 2001
Location: Washington State, USA
Posts: 980
BocoC is on a distinguished road
Send a message via AIM to BocoC Send a message via Yahoo to BocoC
Talking

=P Thanks for your help. I finally got the keydown event to work. You were right, it DOES have to be clientside. Now, the only thing that is stoping my script from working (I think) is the @#$%#$ replacegani commands. Thanks for your help!
__________________
-Boco

FLKJH$TRFG*$(&%>FMG >REN<>F ;.kjsd
  #9  
Old 06-30-2001, 03:48 AM
Guest
Posts: n/a
replaceani

not replacegani
  #10  
Old 06-30-2001, 03:20 PM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
Or you could just put the keydown thing in a system NPC which does a triggeraction when the keydown is done.
__________________

  #11  
Old 06-30-2001, 11:37 PM
BocoC BocoC is offline
Registered User
BocoC's Avatar
Join Date: Jun 2001
Location: Washington State, USA
Posts: 980
BocoC is on a distinguished road
Send a message via AIM to BocoC Send a message via Yahoo to BocoC
Thanks for your help. I fixed my problems and everything is working correctly. =P Thanks again.
__________________
-Boco

FLKJH$TRFG*$(&%>FMG >REN<>F ;.kjsd
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 03:32 PM.


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