Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Question about looping a function within a listen

Nitelyen Templar
Registered User
Join date: 26 Aug 2004
Posts: 1
03-05-2005 06:26
I have the Listen part written, and the other functions written. But what I'm having problems with is constantly calling a function, while having it listen for the next command.

for example:

//Listen code here


if (command == "on";)
{
updateParticles; // call particle script
return;
}

So what I would like to do is constantly call particle function, so I have a particle display, and still have it listen, for the off command

Thank you in advance for any pointers and help in this.
Zuzi Martinez
goth dachshund
Join date: 4 Sep 2004
Posts: 1,860
03-05-2005 08:11
not going to write it out but the way i would do it is have the particle code with the loop in another script and use a link message in the listen to start it and stop it. then your listen is free to do its thing but the other script with the particles will take care of looping.
_____________________
Zuzi Martinez: if Jeska was Canadian would she be from Jeskatchewan? that question keeps me up at nite.
Jeska Linden: That is by far the weirdest question I've ever seen.
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
03-05-2005 12:30
http://secondlife.com/badgeo/wakka.php?wakka=listen

CODE
listen(integer chan, string str, key id, string msg)
{
if(msg == "on") updateParticles();
else if(msg == "off") llParticleSystem([]);
}


* Now HOW did I accidentally write llUpdateParticles() that first time? I think Ama's script has grown way too much on me. :rolleyes:
_____________________
---