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
Script Help Music dont continue [Solved]
ShipinShen Offline
Junior Member

Posts: 23
Threads: 7
Joined: Apr 2014
Reputation: 0
#1
Music dont continue [Solved]

Hey i want to stop the Outside-Mood-music, when i'm entering a building so i decided to add 2 areas. The one area stops the music and the other start it again, when your leaving the building.. everything works except the area, which should start the music again.

The Area which starts the music again
[Image: playmusicepqbmfojuw.jpg]

The Area which stops the music
[Image: stopmusicovycsudi01.jpg]

Here is the script
Quote:void OnStart()
{
//Stops WindMood
AddEntityCollideCallback("Player" , "StopMusic" , "Stop" , true , 1);
//Starts WindMood
AddEntityCollideCallback("Player" , "PlayMusic" , "Play" , true , 1);
}

//Starts WindMood
void Play(string &in asParent, string &in asChild, int alState)
{
PlayMusic("WindMood.ogg", true, 1, 3, 1, true);
}

//Stops WindMood
void Stop(string &in asParent, string &in asChild, int alState)
{
StopMusic(1, 1);
}

//The first time, where the music starts.
void Teleport(string &in asParent, string &in asChild, int alState)
{
FadeRadialBlurTo(25, 0.0f);
FadeOut(2);
ChangeMap("01_traum.map", "TeleportSpawn", "", "");
StopMusic(2, 1);
PlayMusic("WindMood.ogg", true, 1, 3, 1, true);
}

ShipinShen - YouTube
(This post was last modified: 04-22-2014, 11:24 PM by ShipinShen.)
04-22-2014, 09:15 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#2
RE: Music dont continue

In your AddEntityCollideCallbacks you need to change "true" to "false" if you want the checks to repeat. What happened is likely that you went through one area on your way to the other, causing it to be finished so that when you returned, nothing happened.

(This post was last modified: 04-22-2014, 10:00 PM by Mudbill.)
04-22-2014, 10:00 PM
Find
ShipinShen Offline
Junior Member

Posts: 23
Threads: 7
Joined: Apr 2014
Reputation: 0
#3
RE: Music dont continue

(04-22-2014, 10:00 PM)Mudbill Wrote: In your AddEntityCollideCallbacks you need to change "true" to "false" if you want the checks to repeat. What happened is likely that you went through one area on your way to the other, causing it to be finished so that when you returned, nothing happened.

Thanks that worked fine, even the sound file resume the location where it has stopped Smile THANKS!

ShipinShen - YouTube
04-22-2014, 11:24 PM
Find




Users browsing this thread: 1 Guest(s)