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
Music issue
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#1
Music issue

Hello all i got a issue with my Amnesia storie when i go to next level the background sound comes but if i leave and enter again the sound is gone...what should i do if you want to see the hps here it is



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("ambience_voice.ogg", 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);
}

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
03-02-2012, 02:06 AM
Website Find
Strembitsky Offline
Senior Member

Posts: 254
Threads: 37
Joined: Feb 2012
Reputation: 3
#2
RE: Music issue

Try a simple StopMusic function on OnLeave instead of what you have.

The Nightmares v1.0 - Dreadful Fires WIP
03-02-2012, 02:27 AM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#3
RE: Music issue

If that doesn't work, just try and tick FullGameSave on the level door you exit the level from.

03-02-2012, 02:37 AM
Find
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#4
RE: Music issue

Still dosnt work :/

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
03-02-2012, 01:50 PM
Website Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#5
RE: Music issue

Move
AddEntityCollideCallback("Player", "MusicStop", "StopMusic", true, 1); from void OnLeave to void OnEnter

03-02-2012, 02:04 PM
Find
Stepper321 Offline
Senior Member

Posts: 263
Threads: 26
Joined: Nov 2011
Reputation: 8
#6
RE: Music issue




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


Here you go, what was wrong is that it would make the collide event enabled when you leave it. Just copy it and replace it from the down of the code.

Signature to awesome to be displayed.
03-02-2012, 02:13 PM
Find
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#7
RE: Music issue

(03-02-2012, 02:13 PM)Stepper321 Wrote:
void OnEnter()
{    AddEntityCollideCallback("Player", "MusicStop", "StopMusic", true, 1);
}
void OnLeave()
{
    
}


Here you go, what was wrong is that it would make the collide event enabled when you leave it. Just copy it and replace it from the down of the code.
Still dosn't work

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
03-02-2012, 02:39 PM
Website Find
Acies Offline
Posting Freak

Posts: 1,643
Threads: 60
Joined: Feb 2011
Reputation: 73
#8
RE: Music issue

huh? The questioni confuses me.

AddEntityCollideCallback("Player", "MusicStart_1", "Music1", false, 1);

[Image: mZiYnxe.png]


03-02-2012, 03:01 PM
Find




Users browsing this thread: 1 Guest(s)