Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

collision sound size limit?

Eep Quirk
Absolutely Relative
Join date: 15 Dec 2004
Posts: 1,211
12-28-2004 13:48
I am trying to get a pallet to have a collision sound but it won't play no matter what I do. Is there a minimum size a prim must be before a collision sound plays? Oddly, a larger plank of the pallet will have collision PARTICLES (i.e. dust) but still no collision SOUND. :/

Does the prim/linked object's weight have to be heavier for smaller prims/linked objects to play a collision sound? If so, how is this done?
Cross Lament
Loose-brained Vixen
Join date: 20 Mar 2004
Posts: 1,115
12-28-2004 23:55
I believe it has to do with the force with which the object hits the ground. I did some quick experimenting, and found a 0.15 x 0.15 x 0.15 sphere (0.013888kg) won't play the collision sound until it's dropped from oh... about 3 meters (I was just eyeballing this).

Huh, that's odd. I edited this and it doesn't show that I edited it. :)
_____________________
- Making everyone's day just a little more surreal -

Teeple Linden: "OK, where did the tentacled thing go while I was playing with my face?"
Hiro Pendragon
bye bye f0rums!
Join date: 22 Jan 2004
Posts: 5,905
12-29-2004 02:12
Eep,

I believe Cross is right. You're better off just detecting a collision state and playing it on collision. Keep in mind that there are seperate states for collision and collision with ground.

If you're still having trouble, IM me in game and I'll snip you some code from my bullet shell casing script ;)

Cross,

Yes, I believe now if you edit in under a minute, the forum program doesn't consider it an edit. I'm not sure if that was intentional, or if it checks the minute of the post somehow regardless.
_____________________
Hiro Pendragon
------------------
http://www.involve3d.com - Involve - Metaverse / Emerging Media Studio

Visit my SL blog: http://secondtense.blogspot.com
Eep Quirk
Absolutely Relative
Join date: 15 Dec 2004
Posts: 1,211
01-02-2005 04:43
Well, Hiro gave me some "simple bullet collision" code which I tried to hack for sounds but it's just not working:

CODE
default
{
collision(integer total_number)
{
llPassCollisions(TRUE);
if (llDetectedType(0) & ACTIVE)
{
llCollisionSound("plastic tube clunk", 10);
}
}
land_collision_start(vector pos)
{
llCollisionSound("plastic tube clunk", 10);
}
}


Any ideas?
Jillian Callahan
Rotary-winged Neko Girl
Join date: 24 Jun 2004
Posts: 3,766
01-02-2005 05:27
CODE
default
{

state_entry()
{
llCollisionSound(""); //SHUSH! The script will do the collision sounds, thankie.
llPassCollisions(TRUE); // Pass it on!
// These are prim parameters, so you can set and forget.
}

collision_start(integer total_number) // I find collision_start fires more reliably. *shrug*
{
if (llDetectedType(0) & ACTIVE)
{
llTriggerSound("plastic tube clunk", 1.0); // 1.0 = 100% - This triggers a sound at the task's location and the sound stays there even if the task moves.
}
}

land_collision_start(vector pos)
{
llTriggerSound("plastic tube clunk", 1.0);
}
}
_____________________
Eep Quirk
Absolutely Relative
Join date: 15 Dec 2004
Posts: 1,211
01-02-2005 13:35
Gives error "function call mismatches type or number of arguments for:

llCollisionSound("";);

OK, I put in the sound and volume inside the quotes and it works but is slower than just having llColisionSound. Also, putting an llTriggerSound in the "touch" event but clicking the object multiple times quickly doesn't trigger the sound fast enough as it does with just llCollisionSound and no collision detection.
Cross Lament
Loose-brained Vixen
Join date: 20 Mar 2004
Posts: 1,115
01-03-2005 09:30
I believe most sound functions will wait until the current sound finishes playing, before it will start playing the next sound. llSetSoundQueueing() is supposed to toggle this behaviour, according to the wiki at least, but it doesn't seem to. :)

Maybe stick an llStopSound() before your llTriggerSound() statements?
_____________________
- Making everyone's day just a little more surreal -

Teeple Linden: "OK, where did the tentacled thing go while I was playing with my face?"
Eep Quirk
Absolutely Relative
Join date: 15 Dec 2004
Posts: 1,211
01-03-2005 11:55
As I wrote: "putting an llTriggerSound in the 'touch' event but clicking the object multiple times quickly doesn't trigger the sound fast enough as it does with just llCollisionSound and no collision detection."

Meaning, without the collision detection stuff, triggersound overlaps multiple-touched/-bumped sounds.