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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FadeGlobalSoundSpeed not working
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#1
FadeGlobalSoundSpeed not working

I'm trying to get the sound to slow down in my game on two separate occasions, but for some reason, it's only working once, and not the second time.

Here's the first time I'm calling it:
PHP Code: (Select All)
void TimerThrown(string &in asTimer)
{
    
AddPlayerBodyForce(50000.0f0.0f0.0ffalse);
    
FadeGlobalSoundSpeed(0.75f5.0f);
    
SetPlayerJumpDisabled(true);
    
SetLanternActive(falsetrue);
    
SetLanternDisabled(true);
    
SetEntityActive("remnant_1"false);
    
SetEntityActive("remnant_2"true);
}

void TimerEffects(string &in asTimer)
{
    if(
asTimer == "barricade")
    {
        
SetPropHealth("wooden_boards_block_1"0.0f);
        
SetPropHealth("cellar_wood01_1"0.0f);
    }
    else if(
asTimer == "fall")
    {
        
SetPlayerRunSpeedMul(0.0f);
        
SetPlayerMoveSpeedMul(0.0f);
        
PlayGuiSound("player_bodyfall"0.6f);
        
FadePlayerRollTo(6010220);
        
MovePlayerHeadPos(0.0f, -1.5f0.0f3.0f0.5f);
        
StartPlayerLookAt("LookArea1"1.0f5.0f"");
        
SetEntityActive("block_box_1"false);
        
SetEntityActive("block_box_2"false);
    }
    else if(
asTimer == "standup")
    {
        
PlayGuiSound("player_stand"0.6f);
        
FadeGlobalSoundSpeed(1.0f1.0f);
        
SetPlayerJumpDisabled(false);
        
SetLanternDisabled(false);
        
StartPlayerLookAt("cellar_wood01_2"2.0f5.0f"");
        
FadePlayerRollTo(0.0f33.0f33.0f); 
        
MovePlayerHeadPos(0002.0f0.5f);
        
SetPlayerMoveSpeedMul(0.85f);
        
SetPlayerRunSpeedMul(0.85f);
        
FadeImageTrailTo(3.0f1.0f);
    }
    else if(
asTimer == "remnant1")
    {
        
SetEnemyDisableTriggers("remnant_2"false);
        
AddEnemyPatrolNode("remnant_2""PathNodeArea_1"0.001f"");
        
StopPlayerLookAt();
    }
    else if(
asTimer == "remnant2")
    {
        
ShowEnemyPlayerPosition("remnant_2");
    }


And here's the second time:
PHP Code: (Select All)
void TimerPassOut(string &in asTimer)
{
    if(
asTimer == "passout1")
    {
        
PlaySoundAtEntity("ring""insanity_ear_ring.snt""Player"2.0ffalse);
    }
    else if(
asTimer == "passout2")
    {
        
FadePlayerRollTo(151025);
        
FadeGlobalSoundSpeed(0.75f5.0f);
        
SetPlayerLookSpeedMul(0.4f);
        
SetLanternActive(falsetrue);
        
SetLanternDisabled(true);
        
MovePlayerHeadPos(0.0f, -0.5f0.0f0.5f0.5f);
        
SetPlayerRunSpeedMul(0.5f);
        
SetPlayerMoveSpeedMul(0.5f);
        
PlayGuiSound("react_breath_slow"0.6f);
        
SetEntityActive("remnant_2"false);
        
FadeOut(5);
        
StopMusic(50);
    }
    else if(
asTimer == "passout3")
    {
        
FadePlayerRollTo(-301025);
        
MovePlayerHeadPos(0.0f, -1.0f0.0f1.0f0.5f);
        
SetPlayerRunSpeedMul(0.25f);
        
SetPlayerMoveSpeedMul(0.25f);
        
SetPlayerLookSpeedMul(0.06f);
    }
    else if(
asTimer == "passout4")
    {
        
FadePlayerRollTo(-601025);
        
MovePlayerHeadPos(0.0f, -1.25f0.0f1.0f0.5f);
        
PlayGuiSound("player_bodyfall"0.6f);
        
SetPlayerJumpDisabled(true);
        
PlayGuiSound("react_sigh"0.6f);
        
StopSound("ring"5.0f);
        
SetPlayerRunSpeedMul(0.0f);
        
SetPlayerMoveSpeedMul(0.0f);
    }
    else if(
asTimer == "wakeup1")
    {
        
FadeIn(3);
        
FadeGlobalSoundSpeed(1.0f3.0f);
        
///PlayMusic("07_amb.ogg", true, 1, 5, 0, true);
    
}
    else if(
asTimer == "wakeup2")
    {
        
PlayGuiSound("player_stand"0.6f);
        
SetLanternDisabled(false);
        
SetPlayerJumpDisabled(false);
        
SetPlayerLookSpeedMul(1.0f);
        
FadePlayerRollTo(0.0f33.0f33.0f); 
        
MovePlayerHeadPos(0002.0f0.5f);
        
SetPlayerMoveSpeedMul(1);
        
SetPlayerRunSpeedMul(1);
        
FadeImageTrailTo(0.0f1.0f);
        
AutoSave();
    }


I'm not really sure why, but there's a very audible slowdown for the first time, but there's no such slowdown the second time (I'm mostly listening to the insanity_ring for it in the second script). Everything else in the second script is working fine. The slowdown should begin as the player collapses, and speed back up when he wakes up.

Any ideas why this might not be working?

10-28-2012, 08:39 AM
Find




Users browsing this thread: 1 Guest(s)