Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Sleep... (https://forums.graalonline.com/forums/showthread.php?t=41951)

tlf288 01-13-2003 01:47 AM

Sleep...
 
Well, I am scripting a baddie for Oasis and Konidias said he doesn't want sleep in it. And I can not figure out howto do this some other way...

NPC Code:

function doSword()
{
if(abs(this.dx)<=2.3&&abs(this.dy)<=2.3){
checkDir();
setcharani sword,;
sleep.5;
}
}



I can't figure out some other method of waiting...

tlf288 01-13-2003 01:52 AM

The function is going in a timeout loop and it doesn't seem to work properly.

tlf288 01-13-2003 02:00 AM

I see. I'm pretty sure I know what you mean. I think it is the same thing I am doing with the amount of steps the baddie takes before changeing directions...

Thanks Kai :)

screen_name 01-13-2003 03:57 AM

Why do you check if the absolute value of this.dx/dy is less than 2.3?

tlf288 01-13-2003 04:29 AM

Quote:

Originally posted by screen_name
Why do you check if the absolute value of this.dx/dy is less than 2.3?
Why does it matter to what I posted?

It has something to do with the rest of the script....

HoudiniMan 01-13-2003 08:46 AM

Shizzam! lol

Wouldn't it be easier to just use sleep? Or is it not just his personal preference

screen_name 01-13-2003 03:51 PM

Quote:

Originally posted by tlf288


Why does it matter to what I posted?

It has something to do with the rest of the script....

Nevermind me, for some odd reason I thought that abs() trunicated the decimal, but that's int(). Sorry.


All times are GMT +2. The time now is 05:53 AM.

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