These forums are CLOSED. Please visit the new forums HERE
llSleep |
|
|
Max Pitre
Registered User
Join date: 19 Jul 2006
Posts: 370
|
08-25-2007 19:22
Seems I can get sleep to only work for less than about 3 seconds? I need to put the script to sleep for about 20 seconds but anything over 3 seems to not work.
|
|
RJ Source
Green Sky Labs
Join date: 10 Jan 2007
Posts: 272
|
08-25-2007 19:38
This seems to work fine:
(Put in a box, touch to start 20 second sleep). default { state_entry() { llSay(0, "Hello, Avatar!" ;} touch_start(integer total_number) { llSay(0, "Starting sleep..." ;llSleep(20.0); llSay(0, "... finished." ;} } But you also might try using llSetTimerEvent for a slightly different approach: default { state_entry() { llSay(0, "Hello, Avatar!" ;} touch_start(integer total_number) { llSay(0, "Starting sleep..." ;llSetTimerEvent(20.0); } timer() { llSetTimerEvent(0.0); llSay(0, "... finished." ;} } |
|
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
|
08-25-2007 19:41
Works perfectly fine for me. What makes you believe it doesn't work?
|
|
Max Pitre
Registered User
Join date: 19 Jul 2006
Posts: 370
|
08-25-2007 21:03
Works perfectly fine for me. What makes you believe it doesn't work? LOL ummmm, because I tried it? I put the setting at 3 and it worked fine, at 4 to 20 it never did work. The number in the brackets is in whole seconds right? |
|
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
|
08-25-2007 21:29
llSleep works in whole and partial seconds. It works for much longer than just 20 seconds as well. Something is wrong with a different part of your code if the sleep is not working at more than 3 seconds.
It is a "best practice" to use a float value instead of an integer on functions that request a float...ie...llSleep(3.0) rather than llSleep(3). _____________________
--AeonVox--
Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music. |
|
RJ Source
Green Sky Labs
Join date: 10 Jan 2007
Posts: 272
|
08-26-2007 07:06
LOL ummmm, because I tried it? I put the setting at 3 and it worked fine, at 4 to 20 it never did work. The number in the brackets is in whole seconds right? What happened when you tried the code I posted for you to test? |
|
Max Pitre
Registered User
Join date: 19 Jul 2006
Posts: 370
|
08-26-2007 10:20
What happened when you tried the code I posted for you to test? For some strange reason sleep work fine now. Maybe just a bad day for me and SL when I was trying the script as I didn't really change anything except from llSleep(20) to llSleep(20.0)...or could that have made the difference. Either way, thanks for the help. ![]() |
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
08-26-2007 15:39
For some strange reason sleep work fine now. Maybe just a bad day for me and SL when I was trying the script as I didn't really change anything except from llSleep(20) to llSleep(20.0)...or could that have made the difference. Either way, thanks for the help. ![]() Maybe you just needed llSleep(28800.0) instead of staying up all night scripting??? Heehee _____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum |