Frictional Games Forum (read-only)

Full Version: Music Interruption
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So my problem is , while making monster active i want at the same time play music.

Script:

void BruteActivated(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute_1", true);
SetEnemyDisableTriggers("servant_brute_1", true);
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_1", 0.001, "");
AddTimer("Sanity", 1, "SanityEvent");
}

void SanityEvent(string &in asTimer)
{
GiveSanityDamage(15.0f, true);
PlayMusic("11_event_tree.ogg", false, 1.0f, 0, 0, true);
}

But, it wont let play event music to the end because it interrupts with brute music.

So, how do i do that ? I want the whole music to be played and not be interrupted.

This same thing can be for example Morgue level from original game, when after injecting blood, brute spawns but it lets event music to be played first to the end.
(05-18-2014, 03:35 PM)Plazmater Wrote: [ -> ]So my problem is , while making monster active i want at the same time play music.

Script:

void BruteActivated(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute_1", true);
SetEnemyDisableTriggers("servant_brute_1", true);
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_1", 0.001, "");
AddTimer("Sanity", 1, "SanityEvent");
}

void SanityEvent(string &in asTimer)
{
GiveSanityDamage(15.0f, true);
PlayMusic("11_event_tree.ogg", false, 1.0f, 0, 0, true);
}

But, it wont let play event music to the end because it interrupts with brute music.

So, how do i do that ? I want the whole music to be played and not be interrupted.

This same thing can be for example Morgue level from original game, when after injecting blood, brute spawns but it lets event music to be played first to the end.

It's called the priority. The ones that have a higher priority will be played executed first.
In PlayMusic's fifth argument, there's an integer for alPrio. That's the priority.
Just set the alPrio to a higher priority and it should do it.

EDIT:
Okay, Layman's terms:
Just change the bolded number to higher than 1 like 2 or 3 or 4, etc.
PlayMusic("11_event_tree.ogg", false, 1.0f, 0, 0, true);
void SanityEvent(string &in asTimer)
{
GiveSanityDamage(15.0f, true);
PlayMusic("11_event_tree.ogg", false, 1.0f, 0, 2, true);
}

It still interrupts.
(05-18-2014, 03:56 PM)Plazmater Wrote: [ -> ]void SanityEvent(string &in asTimer)
{
GiveSanityDamage(15.0f, true);
PlayMusic("11_event_tree.ogg", false, 1.0f, 0, 2, true);
}

It still interrupts.

I took a look in the original Morgue hps file. Frictional apparently used a priority of 10.
(05-18-2014, 03:58 PM)SomethingRidiculous Wrote: [ -> ]
(05-18-2014, 03:56 PM)Plazmater Wrote: [ -> ]void SanityEvent(string &in asTimer)
{
GiveSanityDamage(15.0f, true);
PlayMusic("11_event_tree.ogg", false, 1.0f, 0, 2, true);
}

It still interrupts.

I took a look in the original Morgue hps file. Frictional apparently used a priority of 10.

I seems priority needs to be as long as music length.
(05-18-2014, 04:02 PM)Plazmater Wrote: [ -> ]
(05-18-2014, 03:58 PM)SomethingRidiculous Wrote: [ -> ]
(05-18-2014, 03:56 PM)Plazmater Wrote: [ -> ]void SanityEvent(string &in asTimer)
{
GiveSanityDamage(15.0f, true);
PlayMusic("11_event_tree.ogg", false, 1.0f, 0, 2, true);
}

It still interrupts.

I took a look in the original Morgue hps file. Frictional apparently used a priority of 10.

I seems priority needs to be as long as music length.

If I recall correctly, the length of the audio and it's priority have no relation.
Ok , it works with at least 15 priority, you got +rep!

Thanks for help!
(05-18-2014, 04:12 PM)Plazmater Wrote: [ -> ]Ok , it works with at least 15 priority, you got +rep!

Thanks for help!
Spoiler below!
test123