Frictional Games Forum (read-only)
[SCRIPT] Music with collide wont work - 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: [SCRIPT] Music with collide wont work (/thread-13694.html)



Music with collide wont work - jessehmusic - 03-02-2012

Hello all amnesia geeks / Fans !
I can't get my Backgrund music to work Sad here is hps


void OnStart()
////CALLBACKS START
{
AddUseItemCallback("", "Study Key", "sutdy door", "KeyOnDoor", true);
AddUseItemCallback("", "Room Key1", "Room_1", "KeyOnDoor1", true);
AddUseItemCallback("", "Room Key2", "Room_2", "KeyOnDoor2", true);
AddUseItemCallback("", "Room Key3", "Room_3", "KeyOnDoor3", true);
AddEntityCollideCallback("Player", "text_1", "Text", true, 1);
AddEntityCollideCallback("Player", "Ghost_area", "Horror1", true, 1);
AddEntityCollideCallback("Player", "MusicStart_1", "Music1", true, 1);
SetEntityPlayerInteractCallback("Note_Dead1" ,"Text_1" , true);
SetEntityPlayerInteractCallback("Note_Dead2" ,"Text_2" , true);
SetEntityPlayerInteractCallback("Note_Dead3" ,"Text_3" , true);
SetEntityPlayerInteractCallback("Note_Dead4" ,"Text_4" , true);
SetEntityPlayerInteractCallback("Note_Dead5" ,"Text_5" , true);
}
////CALLBACKS ENDS

////KEY ON DOORS
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("sutdy door", false);
PlaySoundAtEntity("", "unlock_door", "sutdy door", 0, false);
RemoveItem("Study Key");
}

void KeyOnDoor1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Room_1", false, true);
PlaySoundAtEntity("", "unlock_door", "Room_1", 0, false);
RemoveItem("Room Key1");
}

void KeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Room_2", false, true);
PlaySoundAtEntity("", "unlock_door", "Room_2", 0, false);
RemoveItem("Room Key2");
}

void KeyOnDoor3(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Room_3", false, true);
PlaySoundAtEntity("", "unlock_door", "Room_3", 0, false);
RemoveItem("Room Key3");
}
////KEY ON DOORS END
////HORROR EVENTS
void Horror1(string &in asParent, string &in asChild, int alState)
{
AddTimer("T2", 1.0f, "Timer_2");
AddTimer("T3", 1.5f, "Timer_3");
}

void Timer_2(string &in Timer)
{
SetEntityActive("alexander_2", true);
PlayGuiSound("react_pant.snt", 22.4f);
PlayGuiSound("enemy_hallucination_disappear.snt", 15.5f);
}

void Timer_3(string &in Timer)
{
SetEntityActive("alexander_2", false);
PlaySoundAtEntity("", "react_pant.snt", "Player", 0.0f, false);
AddTimer("timerReleasePlayer", 1, "timerReleasePlayer");
}
void timerReleasePlayer(string &in asTimer)
{
SetMessage("Messages", "what", 2);
}
////HORROR EVENTS END
////MUSIC EVENTS
void Music1(string &in asParent, string &in asChild, int alState)
{
PlayMusic("ambicnce_voice.snt", true, 0.8f, 1, 0, true);
}

void StopMusic(string &in asParent, string &in asChild, int alState)
{
StopMusic(1 , 0);
}
////MUSIC EVENTS END
////Text START

void Text_1(string &in asEntity)
{
AddTimer("timerReleasePlayer1", 1, "timerReleasePlayer1");
}
void timerReleasePlayer1(string &in asTimer)
{
SetMessage("Messages", "what1", 2);
}

void Text_2(string &in asEntity)
{
AddTimer("timerReleasePlayer2", 1, "timerReleasePlayer2");
}
void timerReleasePlayer2(string &in asTimer)
{
SetMessage("Messages", "what2", 2);
}

void Text_3(string &in asEntity)
{
AddTimer("timerReleasePlayer3", 1, "timerReleasePlayer3");
}
void timerReleasePlayer3(string &in asTimer)
{
SetMessage("Messages", "what3", 2);
}

void Text_4(string &in asEntity)
{
SetEntityActive("Ghost_1", true);
AddTimer("timerReleasePlayer4", 1, "timerReleasePlayer4");
}
void timerReleasePlayer4(string &in asTimer)
{
SetMessage("Messages", "what4", 2);
}

void Text_5(string &in asEntity)
{
AddTimer("timerReleasePlayer5", 1, "timerReleasePlayer5");
}
void timerReleasePlayer5(string &in asTimer)
{
SetMessage("Messages", "what5", 10);
}


////TEXT END
void OnEnter()
{
}
void OnLeave()
{
AddEntityCollideCallback("Player", "MusicStop", "StopMusic", true, 1);
}


RE: Music with collide wont work - Strembitsky - 03-02-2012

void Music1(string &in asParent, string &in asChild, int alState)
{
PlayMusic("ambicnce_voice.snt", true, 0.8f, 1, 0, true);
}


"Ambicnce_voice.snt"


Is that the correct spelling? I think not.


RE: Music with collide wont work - jessehmusic - 03-02-2012

(03-02-2012, 01:50 AM)Strembitsky Wrote: void Music1(string &in asParent, string &in asChild, int alState)
{
PlayMusic("ambicnce_voice.snt", true, 0.8f, 1, 0, true);
}


"Ambicnce_voice.snt"


Is that the correct spelling? I think not.
Oh my bad haha


RE: Music with collide wont work - Stepper321 - 03-02-2012

Why do i think this is so funny xD??

Also, you can use ambience_voice.ogg for the music