Frictional Games Forum (read-only)
Music Script Help - 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Music Script Help (/thread-7476.html)



Music Script Help - KHShox - 04-18-2011

Alright here is the code
Code:
////////////////////////////////
///Run when entering map
void OnEnter()
{
AddTimer("FadeIntro", 0, "FadeIntro");
StopMusic(23,0);
}

void FadeIntro(string &in asTimer)
{
FadeOut(0);
FadeIn(6);
}

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

}

////////////////////////////
// Run first time starting map
void OnStart()
{
    PlayMusic("mozart_music", true, 0.7f, 1, 0, true);
    AddEntityCollideCallback("Player", "Doorclose", "Doorclose", true, 1);
}


    void Doorclose(string &in asParent, string &in asChild, int alState)
{
    SetSwingDoorClosed("mansion_1", true, true);
    SetSwingDoorLocked("mansion_1", true, true);
    GiveSanityDamage(2, true);
}
It just won't play.
I have the music file EVERYWHERE. Is there anything wrong with this script?


RE: Music Script Help - Dalroc - 04-18-2011

Remove the void OnStart() in the beginning Smile


RE: Music Script Help - KHShox - 04-19-2011

(04-18-2011, 11:56 PM)Dalroc Wrote: Remove the void OnStart() in the beginning Smile

Woops, that wasn't in the original script. Lol, but it still doesn't work.


RE: Music Script Help - Kurton - 04-19-2011

"mozart_music" needs the .ogg extension.

EDIT: Whoops, just tested this in my own map, and it actually doesn't... o.O (Sorry :X)