Frictional Games Forum (read-only)
Music Interruption - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Music Interruption (/thread-25318.html)



Music Interruption - Plazmater - 05-18-2014

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.


RE: Music Interruption - PutraenusAlivius - 05-18-2014

(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);


RE: Music Interruption - Plazmater - 05-18-2014

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

It still interrupts.


RE: Music Interruption - PutraenusAlivius - 05-18-2014

(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.


RE: Music Interruption - Plazmater - 05-18-2014

(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.


RE: Music Interruption - PutraenusAlivius - 05-18-2014

(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.


RE: Music Interruption - Plazmater - 05-18-2014

Ok , it works with at least 15 priority, you got +rep!

Thanks for help!


RE: Music Interruption - Radical Batz - 05-18-2014

(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