The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Sound not playing at the right times
ZRPT Offline
Junior Member

Posts: 17
Threads: 3
Joined: Aug 2011
Reputation: 1
#1
Sound not playing at the right times

////////////////////////////
// Run when the map starts
void OnStart()

{
AddUseItemCallback("", "starterroomkey_1", "starterdoor", "Usekeyondoor", true);
AddEntityCollideCallback("Player", "BLAM1", "func_slam", true, 1);
SetEntityCallbackFunc("earthquakenote", "Func");
}

void Usekeyondoor(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked("starterdoor", false, true);
    PlaySoundAtEntity("", "unlock_door", "door1", 0, false);
    RemoveItem("starterroomkey_1");
}

void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("starterdoor", true, true);

SetSwingDoorLocked("starterdoor", true, true);

PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);

PlaySoundAtEntity("", "react_scare", "Player", 0, false);  PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);

GiveSanityDamage(5.0f, true);
}

void Func(string &in asEntity, string &in type)
{
if(type == "OnPickup")
    {
    StartScreenShake(0.10f, 5.0f, 1.5f, 4.0f);
    StartPlayerLookAt("lookat", 0.5, 0.5, "");
    SetPlayerActive(false);
    SetPlayerCrouching(true);
    AddTimer("", 1.0, "Timer1");
    AddTimer("", 4.0, "Timer2");
    AddTimer("", 1.0, "PlayShit");
    }
}
void Timer1(string &in asTimer)
{
        PlaySoundAtEntity("", "react_sigh", "Player", 0, false);
}
void Timer2(string &in asTimer)
{
        SetPlayerCrouching(false);
        StopPlayerLookAt();
        SetPlayerActive(true);
}
void PlayShit(string &in asParent, string &in asChild, int alState)
{
        PlaySoundAtEntity("", "general_rock_rumble", "Player", 0, false);
}

The rumble sound seems to be delayed, then it repeats. Also for some reason after the timer ends and the stopplayerlookat function is called, it still automatically looks at random objects.
(This post was last modified: 08-28-2011, 11:42 AM by ZRPT.)
08-28-2011, 11:40 AM
Find


Messages In This Thread
Sound not playing at the right times - by ZRPT - 08-28-2011, 11:40 AM



Users browsing this thread: 2 Guest(s)