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
Whats wrong with my script?
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#8
RE: Whats wrong with my script?

You could do this, but put the area at where the player will enter/exit the room:

void OnStart()
{
     AddEntityCollideCallback("Player", "area_darkmusic", "PlayDarkMusic", false, 1);
}
void PlayDarkMusic(string &in asParent, string &in asChild, int alState)
{
     PlayMusic("04_amb.ogg", true, 1, 3, 0, true);
     AddTimer("", 2, "Func01");
}
void Func01(string &in asTimer)
{
     AddEntityCollideCallback("Player", "area_darkmusic", "StopDarkMusic", false, 1);
}
void StopDarkMusic(string &in asParent, string &in asChild, int alState)
{
     StopMusic(3, 0);
}

You can further modify the script to where it is impossible for the music to still play when the player leaves the area.

05-16-2011, 11:03 PM
Find


Messages In This Thread
Whats wrong with my script? - by Sennep - 05-16-2011, 02:24 PM
RE: Whats wrong with my script? - by Roenlond - 05-16-2011, 02:31 PM
RE: Whats wrong with my script? - by Sennep - 05-16-2011, 02:33 PM
RE: Whats wrong with my script? - by Roenlond - 05-16-2011, 02:34 PM
RE: Whats wrong with my script? - by Sennep - 05-16-2011, 02:43 PM
RE: Whats wrong with my script? - by Sennep - 05-16-2011, 04:28 PM
RE: Whats wrong with my script? - by MrBigzy - 05-16-2011, 08:02 PM
RE: Whats wrong with my script? - by Kyle - 05-16-2011, 11:03 PM
RE: Whats wrong with my script? - by Sennep - 05-17-2011, 12:44 PM
RE: Whats wrong with my script? - by Tanshaydar - 05-17-2011, 12:50 PM



Users browsing this thread: 1 Guest(s)