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
Stopping music, spawning objects. Help.
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#2
RE: Stopping music, spawning objects. Help.

(01-08-2015, 11:11 AM)Shylia Wrote: Hello! I've tried for a while to make this thing work. I want to stop a song that plays when you turn the crank on the Phonograph when I enter a Script Area. But no matter what I do or try I can't seem to make the song stop.

Here is my little script.

Spoiler below!
void OnStart()
{
AddEntityCollideCallback("Player", "Act1", "Welcome1", true, 1);
}

void OldMusicPlay1(string &in asEntity, int alState)
{
if(alState == 1)
{
PlaySoundAtEntity("", "OldMusic1.snt", "OldMusic1", 0, false);
}
}

void Welcome1(string &in asParent, string &in asChild, int alState)
{
StopSound("OldMusic1" 1.0);
}


Also when the music plays, it's not playing on the Phonograph itself, it's more like all over the place no matter how far I am from the Phonograph.

The way StopSound(); works is that you reference the internal name of the sound - which in this case, is undeclared in your PlaySoundAtEntity();, as the internal name is the first string parameter, which you have left null.

Changing those two lines to these should work:

PHP Code: (Select All)
PlaySoundAtEntity("old_music""OldMusic1.snt""OldMusic1"0false);

StopSound("old_music"1.0f); 

----------
The fact that you have loud music which "surrounds" the player is probably because of the way your .snt is - as the settings for such are located in there. Smile If you may, could you post the contents of your .snt here?

Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 01-08-2015, 11:26 AM by Romulator.)
01-08-2015, 11:25 AM
Find


Messages In This Thread
RE: Stopping music, spawning objects. Help. - by Romulator - 01-08-2015, 11:25 AM



Users browsing this thread: 1 Guest(s)