Monday, February 7, 2011

That Stumping Sound

Written 7 February, 2011

That Stumping Sound

Don't you hate that stumping sound when steps have too much rise? Don't you just love going Bump! on every step of a 100-meter-tall Aztec Pyramid, or bump bump bump as you walk up the stairs to your bedroom?

Well, guess what? You can turn that bumping sound down, replace it with a more pleasing sound, or turn the bumping sound off altogether!

There's a scripting command called llCollisionSound. It's easy to slip it into an existing script in your prims or into the default "Hello, Avatar!" script.

Here's a simple script that will turn the sound off. Just copy it and paste it into a new script in your noisy prim:

//-----

// Simple Collision Sound stopper by Cheyenne Palisades

default
{
        state_entry()
    {
        llCollisionSound("", 0.1);
    }
    
    touch_start (integer x)
    {
        // Here you can make the script do stuff when it's touched, if that's your inclination
    }
}

//-----

By experimenting, I discovered the script must remain in the prim in a running state to suppress the sound, so keep in mind it's not like a cleaner script that rids your prim of particles and looping sounds. If you take the script out, the bumping collision sound will come back to haunt you.

To substitute another sound, simply drop it in the prim with the script and type its name (or better, the sound's UUID) inside the quotation marks. Best to copy and paste the name, as any error will make for difficulties. 

The number that follows the name sets the loudness; you can change it from 0.0 (silent) to 1.0 (maximum loudness).

The wiki notes that setting the volume to 0.0 will disable collision particles. I didn't even know there WERE collision particles! I left the volume set to 0.1, which is very low.

You can see the script in action at the Whimsy Sungate. When you step up onto the round viewing platform or from the platform down to the walkway there's no sound-- even though there's a rise of more than .5 meters.

No stump, stump, stump! Imagine that!

No comments: