Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llVolumeDetect causes lingering phantom-ness

Cherry Hainsworth
Registered User
Join date: 31 Jul 2006
Posts: 125
04-17-2007 13:18
Is this a temporary glitch and has anyone else encountered it?

Using llVolumeDetect for splashing water, the water splashes fine once ... but then it just stays phantom, so the event won't trigger any more. I thought it may because I'm working in a laggy sim, but the water was still phantom after I relogged.

Has the function stopped working? Should I start using collision-start & collision-end events instead?

Your observations will be most welcome :)

Cherry
Anti Antonelli
Deranged Toymaker
Join date: 25 Apr 2006
Posts: 1,091
04-17-2007 18:03
Forgive me if I'm misunderstanding, but it doesn't sound like you're using llVolumeDetect correctly. All llVolumeDetect does is give a prim the special characteristics of a) being phantom and b) still being able to detect collisions, something ordinary phantom prims cannot do. You still need event handlers in the form of collision_start or collision_end.

So just plop llVolumeDetect(TRUE) into state_entry or on_rez or somewhere like that, and handle collision events in the usual way with collision_start et al.
Ralph Doctorow
Registered User
Join date: 16 Oct 2005
Posts: 560
04-17-2007 18:14
llVolumeDetect only detects collisions with physical objects including avatars, not non-physical objects.
Anti Antonelli
Deranged Toymaker
Join date: 25 Apr 2006
Posts: 1,091
04-17-2007 18:28
From: Ralph Doctorow
llVolumeDetect only detects collisions with physical objects including avatars, not non-physical objects.
I somehow doubt she's editing plywood cubes into her hot tub and hoping the water will splash.
Cherry Hainsworth
Registered User
Join date: 31 Jul 2006
Posts: 125
04-17-2007 18:32
From: Anti Antonelli
You still need event handlers in the form of collision_start or collision_end.

So just plop llVolumeDetect(TRUE) into state_entry or on_rez or somewhere like that, and handle collision events in the usual way with collision_start et al.

I appreciate your tact, Anti! :)

I thought llVolumeDetect did the above all by itself .... going by this statement from the Wiki:
From: someone
llVolumeDetect

Turns the object phantom and triggers collision_start and collision_end events when an agent/object intersects it.


So I've just been doing this .... Am I wrong? Have I been getting away with half a script all this time? :D
CODE
default {
collision_start(integer num_detected)
{
llVolumeDetect(TRUE);
llPlaySound("splashsound", 1.0);
}
}

Yikes. Please advise!
... and thank you for taking the trouble

Cherry
Cherry Hainsworth
Registered User
Join date: 31 Jul 2006
Posts: 125
I thought that plywood looked a bit soggy
04-17-2007 18:34
From: Anti Antonelli
I somehow doubt she's editing plywood cubes into her hot tub and hoping the water will splash.

:D
Anti Antonelli
Deranged Toymaker
Join date: 25 Apr 2006
Posts: 1,091
04-17-2007 19:02
From: Cherry Hainsworth
I appreciate your tact, Anti! :)

I thought llVolumeDetect did the above all by itself .... going by this statement from the Wiki:

So I've just been doing this .... Am I wrong? Have I been getting away with half a script all this time? :D
CODE
default {
collision_start(integer num_detected)
{
llVolumeDetect(TRUE);
llPlaySound("splashsound", 1.0);
}
}

Yikes. Please advise!
... and thank you for taking the trouble

Cherry
You have all the right pieces, just not quite in the right order :)
CODE
default
{
state_entry()
{
llVolumeDetect(TRUE);
}

collision_start(integer num_detected)
{
llPlaySound("splashsound", 1.0);
}
}

See, you only need to call llVolumeDetect once in the very beginning, and it imparts the special VolumeDetect magic to the prim for All Time :D From that point on, avatars and other physical objects intersecting with your water will generate a collision, and then your script can have it play a sound or whatever you want to have happen.

Your script as written does something kind of interesting if you look at it closely; the water starts off normal, then someone collides with it and it becomes VolumeDetect "just in time" for you to fall into it. If you added some code to turn VolumeDetect back off at collision_end, and checked each time to see if the colliding entity was you, you'd have "security water" that stays solid for intruders :-D Seriously though, I believe there are doors made that way.

Hope that helps some, and it was no trouble at all :)
Cherry Hainsworth
Registered User
Join date: 31 Jul 2006
Posts: 125
04-18-2007 06:07
I am such a dipstick :o

I must have been looking at that line for so long that I'd stopped seeing it!!
Thanks, Anti - and, hey, what a great idea for a "members-only" pool ;)

Cherry.