Frictional Games Forum (read-only)

Full Version: Triggering "stopmusic"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I would like to use a script_area to trigger one song to start, AND another song to end.

I want to:

Code:
void OnEnter()
{
    PlayMusic ("Edgar.ogg", true, 0.9, 1.0, 1, true);
}

and

Code:
{
    PlaySoundAtEntity("sound", "Tunnels.snt", "Tunnels", 0.0, true);
}

then STOP "Edgar.ogg" from playing.


I am very new to this scripting stuff, so please forgive me if I completely overlooked the correct script on the wiki.
PlayMusic and StopMusic work together using a priority value. According to the script, the priority is defined at the second last argument:

PHP Code:
void PlayMusic(stringasMusicFilebool abLoopfloat afVolumefloat afFadeTimeint alPriobool abResume); 

What the priority does is tell the game which track to play (or stop). Only 1 track can play at a time, and that will be the one with the highest priority value. To stop a track, you input the exact same priority as defined in the track you want to stop.

Your "Edgar.ogg" track has priority 1.

Use StopMusic with that priority to stop it.

PHP Code:
void StopMusic(float afFadeTimeint alPrio); 
Oh man, thank you so much.
(05-25-2015, 03:21 PM)bestia455 Wrote: [ -> ]Oh man, thank you so much.

Are you from Poland? 'Cause your nick sounds like our word for "beast"
(05-25-2015, 06:33 PM)Lazzero Wrote: [ -> ]
(05-25-2015, 03:21 PM)bestia455 Wrote: [ -> ]Oh man, thank you so much.

Are you from Poland? 'Cause your nick sounds like our word for "beast"

No, years ago I played a playstation 2 game called Midnight club 2, and the game featured a car called the"1971 Bestia" which was a ripoff of a late 1960's Pontiac. An old Pontiac engine was a 455 cubic inch, around this time I owned a 1967 Pontiac, you can lookup the resemblance.
(05-25-2015, 08:12 PM)bestia455 Wrote: [ -> ]
(05-25-2015, 06:33 PM)Lazzero Wrote: [ -> ]
(05-25-2015, 03:21 PM)bestia455 Wrote: [ -> ]Oh man, thank you so much.

Are you from Poland? 'Cause your nick sounds like our word for "beast"

No, years ago I played a playstation 2 game called Midnight club 2, and the game featured a car called the"1971 Bestia" which was a ripoff of a late 1960's Pontiac. An old Pontiac engine was a 455 cubic inch, around this time I owned a 1967 Pontiac, you can lookup the resemblance.

Allrighty then.
In Spanish bestia means beast too. It comes from Latin bestia or something.
(05-25-2015, 09:42 PM)Daemian Wrote: [ -> ]In Spanish bestia means beast too. It comes from Latin bestia or something.

Probably yep.
(05-25-2015, 08:12 PM)bestia455 Wrote: [ -> ]No, years ago I played a playstation 2 game called Midnight club 2, and the game featured a car called the"1971 Bestia" which was a ripoff of a late 1960's Pontiac. An old Pontiac engine was a 455 cubic inch, around this time I owned a 1967 Pontiac, you can lookup the resemblance.

That's a pretty funny and specific origin of your username Tongue