I'm really happy with finally having found a good walk script, with a timer.
But it only plays one sound for the steps, and a stopping sound would be cool too.
(And ye, I suck big time with scripting, even when it comes to copying and pasting.)
Let me show what I got so far:
//Walking Sound Effects - Created by Stampy Epsilon
//name of the sound effect to play.
string soundName = "Sound";
//Volume of the sound effect (between 0 and 1)
float volume = 1;
//rate at which the sound should be played in seconds
float rate = 0.25;
//default entry point - nothing below here needs to be altered
default{
//default state entry. Is used to check for timer events
state_entry()
{
//set the timer rate to that requested
llSetTimerEvent(rate);
}
//timer event. Is called every "rate" seconds.
timer()
{
//the sound is wanting to play again. So stop the current one
llStopSound();
//check to see if the owner is walking
if((llGetAgentInfo(llGetOwner()) & AGENT_WALKING))
{
//play the sound at the colume requested
llPlaySound(soundName, volume);
}
}
}
Now if any of you script-ninjas would like to alter the sound system to be able to have
around three sounds that will be randomly played based on the timer event still.
And if one of you could also add a stopping sound feature, I'd be most pleased.
For any question or other stuff you can just IM me inworld. ( Hionimi Engawa )
Thanks!! :D
ps: The forum ate the Tabs in the script example.... ._.