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
Music Interruption
Plazmater Offline
Member

Posts: 122
Threads: 24
Joined: Aug 2013
Reputation: 1
#1
Music Interruption

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
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#2
RE: Music Interruption

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

"Veni, vidi, vici."
"I came, I saw, I conquered."
(This post was last modified: 05-18-2014, 03:48 PM by PutraenusAlivius.)
05-18-2014, 03:39 PM
Find
Plazmater Offline
Member

Posts: 122
Threads: 24
Joined: Aug 2013
Reputation: 1
#3
RE: Music Interruption

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
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#4
RE: Music Interruption

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

"Veni, vidi, vici."
"I came, I saw, I conquered."
05-18-2014, 03:58 PM
Find
Plazmater Offline
Member

Posts: 122
Threads: 24
Joined: Aug 2013
Reputation: 1
#5
RE: Music Interruption

(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
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#6
RE: Music Interruption

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

"Veni, vidi, vici."
"I came, I saw, I conquered."
05-18-2014, 04:04 PM
Find
Plazmater Offline
Member

Posts: 122
Threads: 24
Joined: Aug 2013
Reputation: 1
#7
RE: Music Interruption

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

Thanks for help!
05-18-2014, 04:12 PM
Find
Radical Batz Offline
Posting Freak

Posts: 953
Threads: 145
Joined: Dec 2013
Reputation: 25
#8
RE: Music Interruption

(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

(This post was last modified: 05-18-2014, 04:18 PM by Radical Batz.)
05-18-2014, 04:18 PM
Find




Users browsing this thread: 1 Guest(s)