How do I disable the waterfall sound?

Post » Wed Oct 14, 2009 5:05 pm

I have the waterspout sound attached to the little red activator thing, and the script is:

Begin PE_Sound_Water_Spoutif ( CellChanged == 0 )	if ( GetSoundPlaying "Cave_Waterfall" == 0 )		PlayLoopSound3DVP "Cave_Waterfall", 1.0, 1.0	endifendifif ( GameHour > 6 )    If ( GameHour <= 20 )       If (Getdisabled == 1 )        Enable     endif     return   endif endif if ( GameHour > 20 )     if (getdisabled == 0)       Disable     endif    returnendif  if ( GameHour <= 6 )    if (getdisabled == 1)      Disable    endifendifEnd



So I'm wanting the sound to stop at 2000 at restart at 0600. How do I change the script to make this work correctly?
User avatar
herrade
 
Posts: 3469
Joined: Thu Apr 05, 2007 1:09 pm

Post » Wed Oct 14, 2009 10:40 pm

I believe, the script emits the sound no matter whether the activator is enabled or not. So you better do something like this:
Begin PE_Sound_Water_Spoutshort MakeSoundif ( CellChanged == 0 )	set MakeSound to 0	; Disable				; <= Uncomment in case that "little red activator thing" DOESN'T mean "invisible thing just for making sounds"	if ( GameHour > 6 ) 		If ( GameHour <= 20 )  			set MakeSound to 1			; Enable		; <= Uncomment in case that "little red activator thing" DOESN'T mean "invisible thing just for making sounds"		endif	endif endif if ( MakeSound == 1 )	if ( GetSoundPlaying "Cave_Waterfall" == 0 )		PlayLoopSound3DVP "Cave_Waterfall", 1.0, 1.0	endifendifEnd

User avatar
Rachael
 
Posts: 3412
Joined: Sat Feb 17, 2007 2:10 pm

Post » Thu Oct 15, 2009 4:07 am

No, that sound is still there. Wouldn't it be best to just disable the sound activator and then enable it just like with the water spout? If the red sound activator disappears then it certainly won't be able to emit any sound. How would I set up the script to do that?

I tried just doing this:

if ( GameHour > 6 )    If ( GameHour <= 20 )       If (Getdisabled == 1 )        Enable     endif     return   endif endif if ( GameHour > 20 )     if (getdisabled == 0)       Disable     endif    returnendif  if ( GameHour <= 6 )    if (getdisabled == 1)      Disable    endifendif


....but then the sound wasn't there anymore. So I guess I need to tell the game to play the sound continuously in the script, and then also I'll need to tell it to disable and enable at those times.
User avatar
xxLindsAffec
 
Posts: 3604
Joined: Sun Jan 14, 2007 10:39 pm

Post » Wed Oct 14, 2009 10:27 pm

No, that sound is still there. Wouldn't it be best to just disable the sound activator and then enable it just like with the water spout? If the red sound activator disappears then it certainly won't be able to emit any sound. How would I set up the script to do that?

I tried just doing this:

if ( GameHour > 6 )    If ( GameHour <= 20 )       If (Getdisabled == 1 )        Enable     endif     return   endif endif if ( GameHour > 20 )     if (getdisabled == 0)       Disable     endif    returnendif  if ( GameHour <= 6 )    if (getdisabled == 1)      Disable    endifendif


....but then the sound wasn't there anymore. So I guess I need to tell the game to play the sound continuously in the script, and then also I'll need to tell it to disable and enable at those times.


In the code that starts/stops the sound, have it use getdisabled. If it's disabled, check if the sound is started, and if so, stop it. Vice versa for enabled.

However, if you want to use a separate emitted, you can simply set the z level far from the player to accomplish the same effect (more or less)
User avatar
Hayley O'Gara
 
Posts: 3465
Joined: Wed Nov 22, 2006 2:53 am

Post » Wed Oct 14, 2009 7:44 pm

How would that be written Morovir? I don't see how to rearrange the script, seeing as how I know barely anything about scripting. You're saying to put the getdisabled stuff in with the getsoundplaying stuff? Could you write it out for me please?

Begin PE_Sound_Water_Spoutif ( CellChanged == 0 )	if ( GetSoundPlaying "Cave_Waterfall" == 0 )		PlayLoopSound3DVP "Cave_Waterfall", 1.0, 1.0	endifendifif ( GameHour > 6 )    If ( GameHour <= 20 )       If (Getdisabled == 1 )        Enable     endif     return   endif endif if ( GameHour > 20 )     if (getdisabled == 0)       Disable     endif    returnendif  if ( GameHour <= 6 )    if (getdisabled == 1)      Disable    endifendifEnd

User avatar
Siobhan Thompson
 
Posts: 3443
Joined: Sun Nov 12, 2006 10:40 am

Post » Thu Oct 15, 2009 1:43 am

If the red sound activator disappears then it certainly won't be able to emit any sound.
Are you certain? Trust the elders ;)
User avatar
Heather M
 
Posts: 3487
Joined: Mon Aug 27, 2007 5:40 am

Post » Wed Oct 14, 2009 9:07 pm

Are you certain? Trust the elders ;)


Hmm, would you know how to script the sound to start and stop?
User avatar
Jessie Rae Brouillette
 
Posts: 3469
Joined: Mon Dec 11, 2006 9:50 am

Post » Thu Oct 15, 2009 4:20 am

I'd try something like this, using PlaySound3DVP instead of PlayLoopSound3DVP. Also, verify you don't have other emitters of the same sound near by.
Begin PE_Sound_Water_Spoutif ( CellChanged )	return  ; not sure this is needed, but Bethesda always skips playing sounds on cellchanged...endifif ( GameHour < 6 )	return   ;   too early, skipendifif ( GameHour > 20 )	return    ;  too late, skipendifif ( GetSoundPlaying "Cave_Waterfall" )	return   ; already playing, skipendif; just for testing, try uncommenting this and see if disabling stops the sound, like Kir, I think it should still play even if disabled; disablePlaySound3DVP "Cave_Waterfall" 1.0 1.0; you could use something like this to test a different sound  instead; PlaySound3DVP "Sound_Boat_Hull00" 1.0 1.0End

User avatar
Shirley BEltran
 
Posts: 3450
Joined: Wed Jul 26, 2006 4:14 pm

Post » Thu Oct 15, 2009 4:06 am

Horay! It works! Thanks Abot, I'll include your name in the PE Readme for helping with the script. And yes, when I remove the semicolon from the disable command, the water spout sound still plays as normal, so I just deleted those two lines as they weren't needed.
User avatar
Katie Pollard
 
Posts: 3460
Joined: Thu Nov 09, 2006 11:23 pm


Return to III - Morrowind