Graal Forums  

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

 
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 11-30-2001, 05:12 AM
Andor_GP1 Andor_GP1 is offline
Registered User
Join Date: Nov 2001
Posts: 35
Andor_GP1 is on a distinguished road
sleep

i have a script of an npc character that moves around and does things. well whenever i use a sleep command in his script no strings after where i put the sleep command will set, when i take the sleep command back out they all set fine again. Can anyone help me with this?
__________________

~Pikaz
(formually used account Bravo_LAT-Admin)
~Banana Admin at Andor XD
  #2  
Old 11-30-2001, 06:56 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
Weird... Try to duplicate it in other npc's.
__________________
-Boco

FLKJH$TRFG*$(&%>FMG >REN<>F ;.kjsd
  #3  
Old 11-30-2001, 06:58 AM
Andor_NPC-Admin1 Andor_NPC-Admin1 is offline
Registered User
Join Date: Nov 2001
Posts: 69
Andor_NPC-Admin1 is on a distinguished road
what kind of string are you trying to set?
  #4  
Old 12-04-2001, 02:56 AM
Jerom Jerom is offline
Banned
Jerom's Avatar
Join Date: Mar 2001
Location: In a Trash Can
Posts: 3,708
Jerom is on a distinguished road
Send a message via AIM to Jerom
I had a problem with this too.
Say for instance your script was this.
if (created){
timeout = 0.05;}
if (timeout){
timeout = 0.05;
if (playertouchsme){
sleep 2;}

If you got stuck on the playertouchsme, and it wouldn't work anymore, try setting the timeout in the command, like this:
if (playertouchsme){
sleep 2;
timeout = 0.05;}
  #5  
Old 12-04-2001, 02:59 AM
Andor_GP1 Andor_GP1 is offline
Registered User
Join Date: Nov 2001
Posts: 35
Andor_GP1 is on a distinguished road
ok

if your wondering how this was fixedheres a nifty little trck kitie showed me to fix this. Firsst do somthing like
setstring this.owner,#a;
next yo would use get player.
you have to do this because while sleeping the npcserver can't write to the player.


Thanx Kitie XD!
__________________

~Pikaz
(formually used account Bravo_LAT-Admin)
~Banana Admin at Andor XD
  #6  
Old 12-04-2001, 07:35 AM
Andor_NPC-Admin1 Andor_NPC-Admin1 is offline
Registered User
Join Date: Nov 2001
Posts: 69
Andor_NPC-Admin1 is on a distinguished road
yea, that's me =P
When u do if(playertouchsme) on the server sided script of an NPC, it remembers your account name b/c u touched it. Then when u do something like setting a client string, then it sets it for your account. But when u have a sleep somewhere in there, then it forgets your account name b/c its doing timeouts and stuff. So when u set a client string after a sleep, then it doesn't remember the player, and therefore doesn't set the string. So u need to get the player's account name in a string, then do a with(getplayer())
 


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 11:43 AM.


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