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
Scripting multiple levels help
Equil Offline
Member

Posts: 94
Threads: 8
Joined: Sep 2010
Reputation: 0
#1
Scripting multiple levels help

I couldn't find any other threads about this so the solution to this problem is probably painfully obvious. I already have two maps with working level doors working fine, I can move through both the levels without problems.

However, I want the music to change between the two levels, so I made a script for each map. Here is what I have:

Map 1:
////////////////////////////
// Run when entering map
void OnEnter()
{
  PlayMusic("12_amb.ogg", true, 1.0f, 0, 0, true);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{
StopMusic(5.0, 0);
}

Map 2:
////////////////////////////
// Run when entering map
void OnEnter()
{

PlayMusic("08_amb.ogg", true, 1.0f, 3, 0, true);

}

////////////////////////////
// Run when leaving map
void OnLeave()
{
StopMusic(5.0, 0);
}

Once I enter Map2, the music stops, but the new music doesn't play. It DOES play if I re-enter Map1, so I tried using different music files and double checking the code, but it seems to be correct. Any help with this is much appreciated.
01-01-2011, 04:29 AM
Find


Messages In This Thread
Scripting multiple levels help - by Equil - 01-01-2011, 04:29 AM
RE: Scripting multiple levels help - by xiphirx - 01-01-2011, 04:48 AM
RE: Scripting multiple levels help - by Equil - 01-01-2011, 04:52 AM
RE: Scripting multiple levels help - by xiphirx - 01-01-2011, 05:01 AM
RE: Scripting multiple levels help - by Equil - 01-01-2011, 05:14 AM
RE: Scripting multiple levels help - by xiphirx - 01-01-2011, 05:18 AM
RE: Scripting multiple levels help - by Equil - 01-01-2011, 07:06 AM
RE: Scripting multiple levels help - by Equil - 01-01-2011, 04:03 PM



Users browsing this thread: 1 Guest(s)