Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

question using llVolumeDetect to change Particle System parameters

Court Goodman
"Some College"
Join date: 10 May 2006
Posts: 320
12-21-2008 19:15
Hello, I'm a below-average scripter who's returning from a few months away from SL, so i forgot everything.

Im trying to make an object that emits one particle pattern when resting, and then switches to a different pattern when collided. I'm using llVolumeDetect, and have been able to make the particle system change from one to the other upon detection, but I would like it to return to the original particle pattern when its no longer "in focus".

i made two particle objects called fire_big and fire_small. I figure i need to put some kind of if/then/else/maybe clause?

Thanks for any help.
-Court

default {
state_entry() {
llVolumeDetect(TRUE);
fire_small();
}

collision_start(integer total_number) {
fire_big();
}
}
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
12-21-2008 19:23
Perhaps add

From: someone
collision_start(integer total_number) {
fire_big();
}
_____________________
-

So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.

I can be found on the web by searching for "SuezanneC Baskerville", or go to

http://www.google.com/profiles/suezanne

-

http://lindenlab.tribe.net/ created on 11/19/03.

Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard,
Robin, and Ryan

-
Court Goodman
"Some College"
Join date: 10 May 2006
Posts: 320
12-21-2008 19:29
hi, thanks-- that's already in my script. is it possible i have it in the wrong place?
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
12-21-2008 19:33
I meant

collision_end(integer total_number) {
fire_small();
}

I forgot to edit it after the cut and paste. Someone knocked on the door.
_____________________
-

So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.

I can be found on the web by searching for "SuezanneC Baskerville", or go to

http://www.google.com/profiles/suezanne

-

http://lindenlab.tribe.net/ created on 11/19/03.

Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard,
Robin, and Ryan

-
Court Goodman
"Some College"
Join date: 10 May 2006
Posts: 320
12-21-2008 19:46
thats it, it works :) thank you!

-Court
Sindy Tsure
Will script for shoes
Join date: 18 Sep 2006
Posts: 4,103
12-22-2008 09:45
A change in particles is a full object update.. You might want to enable Advanced -> Show Updates to see how often it's updating.

If it's really frequently, you might want to use a timer instead.
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
12-22-2008 10:00
Note also that if multiple avatars/objects are involved, you might get a 'collision_end' event when there are still things inside. You might consider adding a counter. Something like:

CODE

integer nCollisions = 0;

default
{
state_entry()
{
llVolumeDetect(TRUE);
fire_small();
}

collision_start(integer nDetected)
{
if (nAvatars <= 0)
{
fire_big();
nCollisions = nDetected;
} else
{
nCollisions += nDetected;
}
}

collision_end(integer nDetected)
{
if (nCollisions <= nDetected)
{
fire_small();
nCollisions = 0;
} else
{
nCollisions -= nDetected;
}
}
}


(Tests like '<= 0' might seem unnecessary, but I like to be paranoid about that kind of thing and it's best to remember the limit of 16 collision events at once, as unlikely as exceeding that limit might be.)
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
12-22-2008 14:20
llVolumeDetect, once used, remains in effect until every single script is removed from the prim. Phantom set by calling llVolumeDetect becomes a permanent fixture of the prim and can not be undone.

Try starting over with a fresh prim.
_____________________
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