Frictional Games Forum (read-only)
FadeGlobalSoundSpeed not working - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: FadeGlobalSoundSpeed not working (/thread-18958.html)



FadeGlobalSoundSpeed not working - Damascus - 10-28-2012

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:
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:
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?