Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Collision isn't being detected

Cherry Hainsworth
Registered User
Join date: 31 Jul 2006
Posts: 125
09-09-2006 10:26
Hello

I want a massive splash when people hit a transparent prim - it's at the bottom of some Siggy water.

My code is simply:
CODE

string impact_sound = "Bubblesplash";
float impact_volume = 0.9;

default
{
state_entry()
{
llCollisionSound(impact_sound, impact_volume);
}

}


but as it isn't working, I guess something's missing - can anyone tell me what else I should add?

Thanks :)
Cherry.
_____________________
=================
My stuff on XSt:-
http://tinyurl.com/383mgh
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
09-09-2006 11:53
Phantom objects don't trigger collisions at all. You'll have to use 'llVolumeDetect()'. My guess is you'll have to manually trigger the splash from event handlers also, but I could be wrong on that one. Just try it.
HtF Visconti
Registered User
Join date: 21 Jul 2006
Posts: 123
09-09-2006 12:32
Well - I took your script to a test prim, copied a sound and renamed it and .... it worked.

The prim must be non phantom, also the sound was strangely much quieter than it normally is - even with a higher volume I couldn't get it to its normal volume.

If you hear nothing I suggest:

(a) Check the spelling / look for script error
(b) Turn up your volume on the speaker

If both fail, remove the sound file, and walk into the prim. You should get a script error that the sound file wasn't found. This way you know that the event is being triggered and that there must be something wrong with the sound file.

According to the WIKI the material also has some influence.
Kayla Stonecutter
Scripting Oncalupen
Join date: 9 Sep 2005
Posts: 224
09-09-2006 13:16
As mentioned, the prim must either be non-phantom, or use llVolumeDetect(). Note that llVolumeDetect() automatically sets a special kind of phantom, do /not/ set phantom yourself.
_____________________
Cherry Hainsworth
Registered User
Join date: 31 Jul 2006
Posts: 125
09-10-2006 09:23
Thank you very much for all your good advice - I haven't got it working yet, but am reading up on llVolumeDetect, as that seems important!

I'll try it with a bigger prim, too. Thanks again,
Cherry

Update: It does work :D
I had to reset the volume to 9.0 or more ..... (or I'm deaf; one or the other!)

Used collision_start instead; it seemed to work more reliably:

CODE

// Cherry Hainsworth, the Cherryaid Cafe, September 2006.
// Free to copy & modify.
// You may NOT use this little script, or its associated sound, in
// items for sale.

default {
collision_start(integer num_detected)
{
llVolumeDetect(TRUE);
llPlaySound("splashsoundname", 1.0);
}
}
_____________________
=================
My stuff on XSt:-
http://tinyurl.com/383mgh