The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Script Help Music reverting upon death/map change
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#1
Music reverting upon death/map change

I'm currently working on a scene where the player enters a room that spawns a monster. At the moment he enters, suspenseful music starts playing. When he is killed by the monster, the music changes to a sad piece, and is meant to play throughout the death hint, and keep playing as he changes maps and respawns in a previous map. However, for some reason, the sad music abruptly reverts to a previous ambient as soon as the map starts changing.

Before the scene, the music playing is this one:

PlayMusic("ACD_03_amb", true, 0.5f, 5, 0, true);

When the player enters the room where the monster is activated, I set a check point, and play some event music:

PHP Code: (Select All)
void EnterMaster(string &in asParentstring &in asChildint alState)
{
    
CheckPoint ("third""PlayerStartArea_1""reset3""""");
    
PlayMusic("music_reactor_pre_kyrie.ogg"false0.7f010false);
}

void reset3(string &in asNameint alCount)
{
    
ChangeMap("chateau1.map""PlayerStartArea_1""""");


I have a timer checking the player's HP, and when it drops below 1, I use the following script:

PHP Code: (Select All)
void BellMusic(string &in asTimer)
{
    
PlayMusic("music_reactor_children_temp.ogg"false0.7f10false);


Now, when the player dies and the death hint plays, the "music_reactor_children_temp.ogg" music is still playing. But when the death hint fades away and the map starts changing, the music abruptly changes back to "ACD_03_amb." There is nothing under OnLeave for this map or OnStart/OnEnter for the map it's changing to, so I don't know what's causing the music to suddenly end. Can anyone help me with this?

(This post was last modified: 03-01-2014, 10:18 AM by Damascus.)
03-01-2014, 10:12 AM
Find


Messages In This Thread
Music reverting upon death/map change - by Damascus - 03-01-2014, 10:12 AM



Users browsing this thread: 3 Guest(s)