Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
StopSound not working on certain .SNT
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#4
RE: StopSound not working on certain .SNT

Actually, I realized that the Timer and Variable are parts of the script that I'm no longer using. So I took those out, but the sound is still not stopping. Here is the whole script having to do with this room:

PHP Code: (Select All)
void OnStart{
    
AddEntityCollideCallback("Player""TerrorArea""CollideTerrorArea"false0);
}

void CollideTerrorArea(string &in asParentstring &in asChildint alState)
{
    if(
alState == 1)
    {
        
FadeSepiaColorTo(0.75f0.7f);
        
FadeRadialBlurTo(0.025f0.02f);
        
PlaySoundAtEntity("Prisoner""24_mb_02.snt""chained_prisoner_3"1.0ftrue);
    }
    else if(
alState == -1)
    {
        
FadeSepiaColorTo(0.0f1.0f);
        
FadeRadialBlurTo(0.0f0.02f);
        
StopSound("Prisoner"1.0f);
    }



void Transform(string &in asEntity)
{
    
SetEntityActive("chained_prisoner_3"false);
    
SetEntityActive("shackles_single_19"true);
    
SetEntityActive("shackles_single_20"true);
    
SetEntityActive("servant_brute_1"true);
    
PlayMusic("26_event_brute.ogg"false0.70.310false);
    
AddTimer("scare"1.0f"TimerGruntScare");
    
AddTimer("breath"3.0f"TimerGruntScare");
}

void TimerGruntScare(string &in asTimer)
{
    if(
asTimer == "breath")
    {
        
PlayGuiSound("react_breath"0.6f);
        
FadeImageTrailTo(0,0.2f);
        
SetPlayerRunSpeedMul(1.0f);
        
SetPlayerMoveSpeedMul(1.0f);
        return;
    }
    
    
GiveSanityDamage(10.0ftrue);
    
PlayGuiSound("react_scare6"0.7f);
    
StopSound("Prisoner"0);
    
FadeImageTrailTo(2,1);
    
SetPlayerRunSpeedMul(0.8f);
    
SetPlayerMoveSpeedMul(0.8f);
}


The strangest thing is that the muttering sound stops when I activate the brute, which at first I thought had to do with setting the shackled prisoner inactive. But when I try to do that in the first script, it still doesn't make the sound stop when the player leaves:

PHP Code: (Select All)
void CollideTerrorArea(string &in asParentstring &in asChildint alState)
{
    if(
alState == 1)
    {
        
FadeSepiaColorTo(0.75f0.7f);
        
FadeRadialBlurTo(0.025f0.02f);
    
SetEntityActive("chained_prisoner_3"true);
        
PlaySoundAtEntity("Prisoner""24_mb_02.snt""chained_prisoner_3"1.0ftrue);
    }
    else if(
alState == -1)
    {
        
FadeSepiaColorTo(0.0f1.0f);
        
FadeRadialBlurTo(0.0f0.02f);
        
StopSound("Prisoner"1.0f);
    
SetEntityActive("chained_prisoner_3"false);
    }


(12-25-2012, 08:41 PM)Adrianis Wrote: Is the rest of the else if executing?

Yes, the rest of it is working. Sepia and Radial Blur are both reset the 0 when the player leaves the room.

(This post was last modified: 12-25-2012, 08:50 PM by Damascus.)
12-25-2012, 08:49 PM
Find


Messages In This Thread
RE: StopSound not working on certain .SNT - by Damascus - 12-25-2012, 08:49 PM



Users browsing this thread: 4 Guest(s)