|
Keumjoo Ahn
Registered User
Join date: 13 Jan 2007
Posts: 15
|
04-21-2008 08:44
Hi, I am totally new to scripting and this drives me nuts..lol and i feel dumb  I try to make a script that rezzes an object infinite times until i say a command to stop. My idea was this: default { state_entry() { llListen(0,"", NULL_KEY, ""  ; } listen(integer channel, string name, key id, string message) { if (message == "Start" { while ( 1 == 1 ) llRezObject("blabla", pos, fwd, rot, 2); llSleep(0.01); } if (message == "Stop"  { state default; } } } ----------------------------- But it doesnt stop O.o Anyone an idea how to stop the rezzing on command? Thank you very much for reading 
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
04-21-2008 09:07
You'll never get the listen event with the message "Stop" once you've started unless you return from the event handler after receiving the one for "Start". I suggest using a timer instead of llSleep(). However, with either a timer or a sleep, you're unlikely to get a 0.01 second delay, and the script delay from llRezObject() is going to be far more than that in any case. I suggest something around 0.2 seconds or more. http://www.lslwiki.net/lslwiki/wakka.php?wakka=llSetTimerEventEDIT: You'd probably run into the grey goo fence if you rez this often anyway. Think about whether you really need this for your application. Perhaps something like particles would be a better (more considerate) solution for your problem.
|
|
Keira Wells
Blender Sculptor
Join date: 16 Mar 2008
Posts: 2,371
|
04-21-2008 09:14
From: someone string messagetrue; default { state_entry() { llListen(0, "", "", ""  ; messagetrue = "keep on goin"; } listen(integer channel, string name, key id, string message) { messagetrue = message; if (llToLower(messagetrue) == "keep on goin"  { llRezObject("blabla", pos, fwd, rot, 2); llSleep(0.01); } else if (llToLower(messagetrue) != "keep on goin"  { state off; } } } off { touch_start(integer total_number) { state default; } } This is off the top of my head so I can't guarantee it'll work. To me it seems like it might not start rezzing until you say something, but for that to happen you'd have to say 'keep on goin" or it would not work anyhow. Anyway, my thoughts on it.
_____________________
Tutorials for Sculpties using Blender! Http://www.youtube.com/user/BlenderSL
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
04-21-2008 09:31
Have fun with the grey goo fence when you hit it!
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|