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.
Shylia Offline
Junior Member

Posts: 14
Threads: 3
Joined: Jan 2015
Reputation: 0
#5
RE: Stopping music, spawning objects. Help.

(01-08-2015, 11:25 AM)Romulator Wrote:
(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?

Alright I will show you the SNT.

Spoiler below!
<SOUNDENTITY>
<SOUNDS>
<Main>
<Sound File="OldMusic1" />
</Main>
</SOUNDS>
<PROPERTIES Volume="0.1" MinDistance="1" MaxDistance="10" Random="0" Interval="0" FadeEnd="False" FadeStart="False" Stream="False" Loop="False" Use3D="false" Blockable="False" BlockVolumeMul="0.7" Priority="0" />
</SOUNDENTITY>

Also let's say I wanted to play the sound from the amnesia game called: ambience_haunting.snt when I enter the script area, how would I do that?

I've tried
Spoiler below!
PlaySoundAtEntity("", "ambience_haunting.snt", "Player", 0, false);

But it didn't work, so there must be some magic performed before it allows itself to.
(This post was last modified: 01-08-2015, 12:21 PM by Shylia.)
01-08-2015, 12:00 PM
Find


Messages In This Thread
RE: Stopping music, spawning objects. Help. - by Shylia - 01-08-2015, 12:00 PM



Users browsing this thread: 4 Guest(s)