Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

llStopSound

Daghdha Fauna
Registered User
Join date: 23 Apr 2004
Posts: 11
07-15-2004 10:59
Has llStopSound behaviour changed?

I have this looping 'fuse' sound for my cannon.
It used to STOP playing when the cannon was fired.

Fire()
{
llStopSound();
llTriggerSound("Cannon_Fire.wav", 1.0);
vector my_pos = llGetPos();
rotation my_rot = llGetRot();
vector my_fwd = llRot2Up(my_rot);
// Rez a bullet!
vector forward = llRot2Up(my_rot);
llRezObject("CannonBall",
<my_pos.x, my_pos.y, my_pos.z> + my_fwd,
my_fwd * gBulletSpeed,
my_rot,
1);
return;
}

The fuse sound is started in another object primitive.

FuseSound(integer bPlayFuseLoop)
{
if (bPlayFuseLoop==TRUE)
{
llPlaySound("Burning Fuse loop.wav", 1.0);
return;
}
else
{
llStopSound();
}
return;
}




The way my cannon works is.
You press a button.
It then sends a message to lite the fuse.
My fuse lsitens to this and starts emitting particles and looping the lit-fuse sound.

When the button is pressed again the button sends a message to fire the cannon. Is the fact llStopsound is in another primitive the problem, i think it used to work fine like this, or is it just changed behaviour?

Help? :(

Hope i make sense.. if i don't tell me what els eyou need to know and i will be more details.

Thanks for reading.
Daghdha Fauna
Registered User
Join date: 23 Apr 2004
Posts: 11
07-15-2004 11:04
Oh yeh,, what i think it does is FINISH the loop it's in.
Whichis very odd new 'feature' if it indeed is the problem.

Because sound does stop.
Just not immediately.
Daghdha Fauna
Registered User
Join date: 23 Apr 2004
Posts: 11
07-16-2004 09:07
Aw.. come one someone must know the answer :(


The cannon can be visited at the Pirate hide-out.
Press the light colored wood to Lite the fuse.
Press it again to fire.

Kind regards, Pirate Lt. Daghdha Fauna.
Francis Chung
This sentence no verb.
Join date: 22 Sep 2003
Posts: 918
07-16-2004 10:52
It has somehow, but I never bothered to isolate the problem.

I have some sound code that ceased to work as of v.1.4. In v.1.4.5, I monkeyed with the code enough to fix it. I never bothered to isolate what exactly the problem was, I just toyed with it (juggling command orders, wait states, etc) until it worked again.

So, the answer is, you're probably not crazy. Something with the sound engine has changed that breaks old scripts. Unfortunately, I can't quantify what.
_____________________
--
~If you lived here, you would be home by now~
Daghdha Fauna
Registered User
Join date: 23 Apr 2004
Posts: 11
Sigh
07-16-2004 16:37
Thank you.

I was affraid of that.
And it somewhat dampens my building spirits.

I don't want o have to go back to the drawing baord for objects i make everytime a new release is done.

The cannon is my first object and i am mixing building with messaging and scripting. I would think llStopSound stops teh sound. (It used to)

CODE
void llStopSound(void);

llStopSound() stops the currently playing sound. It only affects sounds started with:

llPlaySound()
llLoopSound()
llPlaySoundSlave()
llLoopSoundSlave()
and
llLoopSoundMaster()


I looked at it a bit closer and ot does more than just finish the current loop. It goes on even longer.

I'lmake a good sample that has a good begin and end. So i can be more sure. My current sample is designed to have a seamless join.
Daghdha Fauna
Registered User
Join date: 23 Apr 2004
Posts: 11
Fixed
07-19-2004 09:46
At some point i accidently replaced LoopSound with PlaySOund.
I changed it back and now it's working again :)