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
Custom Sound & Music Help Needed
Kreekakon Offline
Pick a god and pray!

Posts: 3,063
Threads: 70
Joined: Mar 2012
Reputation: 124
#1
Custom Sound & Music Help Needed

Hey there all, I'm trying to put some custom sounds, and music into my story, but some sounds work just fine, while other just plain right refuse to appear. There's no error message, they just don't play.

For example, I'm trying to play a sound called arisiren. I've tried working it as both a sound, and as music, but neither work.

Here's my code, you can see multiple attempts at making the sound work in there:

////////////////////////////
// Run first time starting map
void OnStart()
{  

    PlaySoundAtEntity("", "airsiren.snt", "Player", 0, false);
    SetPlayerActive(false);
    SetPlayerCrouching(true);
    
    FadeOut(0);
    FadeIn(3);
    AddTimer("T1", 1, "Intro");
    AddTimer("T2", 3, "Intro");
    AddTimer("T3", 5, "Intro");
    AddTimer("T4", 7, "Intro");
    AddTimer("T5", 7.8, "Intro");
}
////////////////////////////
// Run when entering map
void OnEnter()
{
PlayMusic("airsiren.ogg", true, 100, 5, 0, true);
}
    void Intro(string &in asTimer)
    {
    string x = asTimer;
    if (x == "T1")
    {
        PlaySoundAtEntity("", "react_sigh.snt", "Player", 0, false);
        FadeOut(3);
    }
    else if (x == "T2")
    {
        FadeIn(3);
        PlaySoundAtEntity("", "react_breath.snt", "Player", 0, false);
        PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false);
        StartPlayerLookAt("ScriptArea_1", 2, 2, "");
    }
    else if (x == "T3")
    {
        StopPlayerLookAt();
        StartPlayerLookAt("ScriptArea_2", 2, 2, "");
    }
    else if (x == "T4")
    {
        AddPlayerBodyForce(0, 0, 22300, false);
        StartPlayerLookAt("ScriptArea_3", 2, 2, "");
    }
    else if (x == "T5")
    {
        FadeOut(0.001);
        PlaySoundAtEntity("", "player_falldamage_max.snt", "Player", 0, false);
       
        StopMusic(2, 0);
    }
}


////////////////////////////
// Run when leaving map
void OnLeave()
{
}

My code seems fairly identical for the sounds that work, and ones that don't. Is it something with the sound files themselves, or something else?

Also, here's the tutorial I used: http://wiki.frictionalgames.com/hpl2/tut...cript/page
(This post was last modified: 04-01-2012, 09:08 AM by Kreekakon.)
04-01-2012, 09:07 AM
Find


Messages In This Thread
Custom Sound & Music Help Needed - by Kreekakon - 04-01-2012, 09:07 AM
RE: Custom Sound & Music Help Needed - by flamez3 - 04-01-2012, 09:12 AM
RE: Custom Sound & Music Help Needed - by flamez3 - 04-01-2012, 09:25 AM
RE: Custom Sound & Music Help Needed - by flamez3 - 04-01-2012, 10:15 AM
RE: Custom Sound & Music Help Needed - by Xanthos - 04-01-2012, 05:06 PM
RE: Custom Sound & Music Help Needed - by Xanthos - 04-01-2012, 05:15 PM
RE: Custom Sound & Music Help Needed - by Xanthos - 04-02-2012, 07:27 PM



Users browsing this thread: 1 Guest(s)