• All, Gmail is currently rejecting messages from my host. I have a ticket in process, but it may take some time to resolve. Until further notice, do NOT use Gmail for your accounts. You will be unable to receive confirmations and two factor messages to login.

BGM Select Menu Inside New Extra Options Menu in Menu/Title Screen

maxman

Well-known member
By not derailing this musicoverlap topic, I decided to create a new thread asking how I could get started with adding a new menu as extra option like SOR2X. A music switch according to the playlist version being chosen. For example, in Tekken 2 and 3, you go to options menu > game option and then you go to BGM select and switch from arrange to original/arcade. That's because I want to switch music in that menu so that I could play with red, blue, and green versions in certain music playlists. A step-by-step process is welcome.

EDIT: For instance, I want to use the songs from both the main music folder and its subfolders. I would like to have 3 options of red, green, and blue for selecting music you go to arcade mode with. When you choose "Red" in the extra options mode, the playlist will play all the songs from the red version in game mode.
 
Last edited:
Solution
By not derailing this musicoverlap topic, I decided to create a new thread asking how I could get started with adding a new menu as extra option like SOR2X. A music switch according to the playlist version being chosen. For example, in Tekken 2 and 3, you go to options menu > game option and then you go to BGM select and switch from arrange to original/arcade. That's because I want to switch music in that menu so that I could play with red, blue, and green versions in certain music playlists. A step-by-step process is welcome.

EDIT: For instance, I want to use the songs from both the main music folder and its subfolders. I would like to have 3 options of red, green, and blue for selecting music you go to arcade mode with...
@maxman Ok, I found where the problem was, it's a small variable name confusion. The "mStyle" was now renamed "musicStyle" for all scripts and now the music is playing normally. You can get the BOR mod used as a test here, I didn't post the changed codes because they became too long and by downloading the complete file everyone can see how it works.

Here's a test:
 
Thank you very much, @Kratus! I love it!!! It works perfect!!!! I was able to replace/change all the global value names from "mStyle" to "musicStyle" (getglobalvar/setglobalvar) including keyall.c, and that solved the problem for me to switch music. I have some questions though, does this mean I cannot revert those changed music names (e.g. title.bor/ogg) to native music names anymore since the engine automatically detects native music names? And what about the intro that has one with 2 scenes (an animated logo and a main intro) in one .txt file because there are two songs? While I have logo.bor playing as the first intro, I would like to have the music (depending on which music style you choose) to play as a main intro.

intro.txt
Code:
#    music        [path] [loop]        # BOR file to play
#    animation    [path] [x] [y]        # GIF animation to play
#    silence                    # Stop music


silence
animation    data/scenes/in01.gif 0 0
music           data/music/logo.bor
animation    data/scenes/in03.gif 0 0
animation    data/scenes/in04.gif 0 0
animation    data/scenes/in05.gif 0 0
animation    data/scenes/in06.gif 0 0
animation    data/scenes/in07.gif 0 0
animation    data/scenes/in08.gif 0 0
animation    data/scenes/in09.gif 0 0
animation    data/scenes/in10.gif 0 0
animation    data/scenes/in11.gif 0 0
animation    data/scenes/expl.gif 0 0
animation    data/scenes/in12.gif 0 0
animation    data/scenes/in02.gif 0 0
music           data/music/remix.bor
animation    data/scenes/intro1.gif 0 0
animation    data/scenes/intro2.gif 0 0
animation    data/scenes/intro3.gif 0 0
animation    data/scenes/intro4r.gif 0 0
animation    data/scenes/intro5.gif 0 0
animation    data/scenes/01.gif 0 0
animation    data/scenes/02.gif 0 0
animation    data/scenes/03.gif 0 0
animation    data/scenes/04.gif 0 0
animation    data/scenes/05.gif 0 0
animation    data/scenes/06.gif 0 0
animation    data/scenes/07.gif 0 0
animation    data/scenes/08.gif 0 0
animation    data/scenes/09.gif 0 0
 
does this mean I cannot revert those changed music names (e.g. title.bor/ogg) to native music names anymore since the engine automatically detects native music names?
Yes, exactly. Otherwise the engine will play the native musics automatically with no proper style detection.

And what about the intro that has one with 2 scenes (an animated logo and a main intro) in one .txt file because there are two songs?
You can use the musicEvents() script I placed inside the updated.c to add more events including cutscenes. Remember that the cutscene's name must have the same name/path as the original file.
PS: I already made it in the game over cutscene/event on the latest file posted because it can be triggered by two ways, the current_scene and the in_gameoverscreen

Another suggestion is to split your cutscenes in smaller parts in case you need to play two or more musics in sequence.

Here's an example:
C:
void musicEvents()
{
    if(openborvariant("in_titlescreen")){
        
        //CHECK THE CURRENT MUSIC TO PLAY IT ONCE
        if(getglobalvar("musicPlaying") != "title.ogg"){
            musicTitle();
        }
    }
    if(openborvariant("in_selectscreen")){
        
        //CHECK THE CURRENT MUSIC TO PLAY IT ONCE
        if(getglobalvar("musicPlaying") != "select.ogg"){
            musicSelect();
        }
    }
    if(openborvariant("in_showcomplete")){
        
        //CHECK THE CURRENT MUSIC TO PLAY IT ONCE
        if(getglobalvar("musicPlaying") != "finish.ogg"){
            musicFinish();
        }
    }
    if(openborvariant("in_gameoverscreen") || openborvariant("current_scene") == "data/scenes/gameover.txt"){
        
        //CHECK THE CURRENT MUSIC TO PLAY IT ONCE
        if(getglobalvar("musicPlaying") != "gameova.ogg"){
            musicGameova();
        }
    }
    if(openborvariant("current_scene") == "data/scenes/story1.txt"){
        
        //CHECK THE CURRENT MUSIC TO PLAY IT ONCE
        if(getglobalvar("musicPlaying") != "story1.ogg"){
            musicStory1();
        }
    }
    if(openborvariant("current_scene") == "data/scenes/story2.txt"){
        
        //CHECK THE CURRENT MUSIC TO PLAY IT ONCE
        if(getglobalvar("musicPlaying") != "story2.ogg"){
            musicStory2();
        }
    }
}
 
Good to know. What about the ordering of the .txt files (cutscenes) for the intro and logo with my last question?

Another suggestion is to split your cutscenes in smaller parts in case you need to play two or more musics in sequence.
Does this mean I am going to extract the gif files into all separate frames?

Could I split the cutscenes like this?

story1.txt:
Code:
silence
animation    data/scenes/in01.gif 0 0
#music           data/music/logo.bor
animation    data/scenes/in03.gif 0 0
animation    data/scenes/in04.gif 0 0
animation    data/scenes/in05.gif 0 0
animation    data/scenes/in06.gif 0 0
animation    data/scenes/in07.gif 0 0
animation    data/scenes/in08.gif 0 0
animation    data/scenes/in09.gif 0 0
animation    data/scenes/in10.gif 0 0
animation    data/scenes/in11.gif 0 0
animation    data/scenes/expl.gif 0 0
animation    data/scenes/in12.gif 0 0
animation    data/scenes/in02.gif 0 0

story2.txt:
Code:
animation    data/scenes/intro1.gif 0 0
animation    data/scenes/intro2.gif 0 0
animation    data/scenes/intro3.gif 0 0
animation    data/scenes/intro4r.gif 0 0
animation    data/scenes/intro5.gif 0 0
animation    data/scenes/01.gif 0 0
animation    data/scenes/02.gif 0 0
animation    data/scenes/03.gif 0 0
animation    data/scenes/04.gif 0 0
animation    data/scenes/05.gif 0 0
animation    data/scenes/06.gif 0 0
animation    data/scenes/07.gif 0 0
animation    data/scenes/08.gif 0 0
animation    data/scenes/09.gif 0 0
 
Does this mean I am going to extract the gif files into all separate frames?

Could I split the cutscenes like this?

story1.txt:
Code:
silence
animation    data/scenes/in01.gif 0 0
#music           data/music/logo.bor
animation    data/scenes/in03.gif 0 0
animation    data/scenes/in04.gif 0 0
animation    data/scenes/in05.gif 0 0
animation    data/scenes/in06.gif 0 0
animation    data/scenes/in07.gif 0 0
animation    data/scenes/in08.gif 0 0
animation    data/scenes/in09.gif 0 0
animation    data/scenes/in10.gif 0 0
animation    data/scenes/in11.gif 0 0
animation    data/scenes/expl.gif 0 0
animation    data/scenes/in12.gif 0 0
animation    data/scenes/in02.gif 0 0

story2.txt:
Code:
animation    data/scenes/intro1.gif 0 0
animation    data/scenes/intro2.gif 0 0
animation    data/scenes/intro3.gif 0 0
animation    data/scenes/intro4r.gif 0 0
animation    data/scenes/intro5.gif 0 0
animation    data/scenes/01.gif 0 0
animation    data/scenes/02.gif 0 0
animation    data/scenes/03.gif 0 0
animation    data/scenes/04.gif 0 0
animation    data/scenes/05.gif 0 0
animation    data/scenes/06.gif 0 0
animation    data/scenes/07.gif 0 0
animation    data/scenes/08.gif 0 0
animation    data/scenes/09.gif 0 0
Yes, this is exactly the correct way to play multiple musics during the cutscene. So, each scene.txt will trigger its own music.
 
I tried using story1.txt and story2.txt as main cutscenes, but somehow, intro.txt is global to the engine. I just renamed that story1.txt to intro.txt and story2.txt to intro2.txt. Intro.txt plays its intro, but not intro2.txt. They don't play their logo music until after the main title screen goes back to the intro. But when I go back to the intro and see the logo, I hear some distortion from the logo music.

C:
    if(openborvariant("current_scene") == "data/scenes/intro.txt"){
        
        //CHECK THE CURRENT MUSIC TO PLAY IT ONCE
        if(getglobalvar("musicPlaying") != "logo.bor"){
            musicStory1();
        }
    }
    if(openborvariant("current_scene") == "data/scenes/intro2.txt"){
        
        //CHECK THE CURRENT MUSIC TO PLAY IT ONCE
        if(getglobalvar("musicPlaying") != "title.bor"){
            musicStory2();
        }
    }

Here I put them in music.c and musicmisc.c:
C:
void musicStory1()
{//Play Logo/Story 1
    void mStyle = getglobalvar("musicStyle");
    void music  = "logo.bor";
    void folder;

    if(mStyle == 0){folder = "root";}
    if(mStyle == 1){folder = "Red";}
    if(mStyle == 2){folder = "Blue";}

    musicPlay(music, folder, 0);
}

void musicStory2()
{//Play Intro/Story 2
    void mStyle = getglobalvar("musicStyle");
    void music  = "title.bor";
    void folder;

    if(mStyle == 0){folder = "root";}
    if(mStyle == 1){folder = "Red";}
    if(mStyle == 2){folder = "Blue";}

    musicPlay(music, folder, 0);
}

I cannot play music in the global cutscene before the title screen.
 
intro.txt is global to the engine
I thought you would use in-game cutscenes, but the engine will only read the native intro.txt because there's no intro2.txt.

In this case I suggest creating an exclusive music only for the intro in which mixes both first and second tracks into one using an audio editor, and then play one unique intro cutscene using the intro.txt.

This way you can have the entire cutscene inside the intro.txt and play only one scripted music.
 
I see you made an intro.gif with a whole black screen for intro.txt by having a longer delay time per frame (2 frames in a .gif file) from your SOR2X. But I don't know how you use the separate frames to combine into a scene. Also, this led me to realize that logo.txt goes first before intro.txt, and I just learned how to skip a scene using 1 for skipping. I decided not to use logo.txt since it's always the first to appear in order before the one from intro.txt starts.

I just made a new logo.txt this time, as well as intro.txt.

logo.txt:
Code:
silence
animation    data/scenes/senile.gif 80 16 1
silence
animation    data/scenes/in01.gif 80 16 1
music           data/music/logo.bor
animation    data/scenes/in03.gif 80 16
animation    data/scenes/in04.gif 80 16
animation    data/scenes/in05.gif 80 16
animation    data/scenes/in06.gif 80 16
animation    data/scenes/in07.gif 80 16
animation    data/scenes/in08.gif 80 16
animation    data/scenes/in09.gif 80 16
animation    data/scenes/in10.gif 80 16
animation    data/scenes/in11.gif 80 16
animation    data/scenes/expl.gif 80 16
animation    data/scenes/in12.gif 80 16
silence
animation    data/scenes/in02.gif 80 16 1
silence
animation    data/scenes/in01.gif 80 16 1

intro.txt:
Code:
#music           data/music/title.bor
animation    data/scenes/intro1.gif 80 16
animation    data/scenes/intro2.gif 80 16
animation    data/scenes/intro3.gif 80 16
animation    data/scenes/intro4r.gif 80 16
animation    data/scenes/intro5.gif 80 16
animation    data/scenes/01.gif 80 16
animation    data/scenes/02.gif 80 16
animation    data/scenes/03.gif 80 16
animation    data/scenes/04.gif 80 16
animation    data/scenes/05.gif 80 16
animation    data/scenes/06.gif 80 16
animation    data/scenes/07.gif 80 16
animation    data/scenes/08.gif 80 16
animation    data/scenes/09.gif 80 16

I still have this one in the musicEvents() function in updated.c.
Code:
    if(openborvariant("current_scene") == "data/scenes/intro.txt"){

     //CHECK THE CURRENT MUSIC TO PLAY IT ONCE
        if(getglobalvar("musicPlaying") != "title.bor"){
            musicStory1();   
        }
    }

Part of music.c:
Code:
void musicStory1()
{//Play Intro (after logo)/Story 1
    void mStyle = getglobalvar("musicStyle");
    void music  = "title.bor";
    void folder;

    if(mStyle == 0){folder = "root";}
    if(mStyle == 1){folder = "Red";}
    if(mStyle == 2){folder = "Blue";}

    musicPlay(music, folder, 0);
}

Still, the scripted title music for the intro doesn't play. I wanna make it play respectively like SOR2X. How can I apply it?
 
Last edited:
I see you made a fake intro.gif with a whole black screen for intro.txt by having a longer delay time per frame (2 frames in a .gif file) from your SOR2X. But I don't know how you use the separate frames to combine into a scene. Also, this led me to realize that logo.txt goes first before intro.txt, and I just learned how to skip a scene using 1 for skipping. I decided not to use logo.txt since it's always the first to appear in order before the one from intro.txt starts.
The SOR2X intro uses a fully scripted cutscene which I don't recommend, it's very complicated because some engine tasks do not run during the intro.txt event. I even abandoned it in the new SORX and replaced it with a global webm intro that works for all styles, the music style is only changed in menus, regular cutscenes or in-game.

In addition, everything is drawn using drawsprite/drawstring and the content will only be shown on the screen during the gif duration. The music style only changes in the SOR2X intro because it reads the entire extra menu from external files, this is the only way I found to make it work.

About the logo/intro it may not work in conjunction because the logo will be shown once after the game is opened, different from the intro that will be shown every time you go to the title/menu screens and wait a little.
 
About the logo/intro it may not work in conjunction because the logo will be shown once after the game is opened, different from the intro that will be shown every time you go to the title/menu screens and wait a little.
Yes. I meant the scripts for logo.txt but I realized it's not necessary to script with. That's why I'm not going to bother using logo.txt (though I keep it used as a presentation) since it only appears once every time, I start the game. As of now, I'm not using music in intro.txt so we will work on adding it.
 
@Kratus I'm sorry. I remember that I had different music style playing after choosing one music style and quitting the game. It was great for my part before. But I forgot how I put back the different music style I chose. For example, you choose Blue in the beginning when the Green version of title screen music is playing before starting the game. You listen to the Blue music version of select screen and stage 1 after starting the game. When you quit game, you listen to the blue version of game over music. But when you go back to the title screen after that, you're reverted back to listening to the Green version of the title music. How can I retain the music style I chose?
 
@Kratus I'm sorry. I remember that I had different music style playing after choosing one music style and quitting the game. It was great for my part before. But I forgot how I put back the different music style I chose. For example, you choose Blue in the beginning when the Green version of title screen music is playing before starting the game. You listen to the Blue music version of select screen and stage 1 after starting the game. When you quit game, you listen to the blue version of game over music. But when you go back to the title screen after that, you're reverted back to listening to the Green version of the title music. How can I retain the music style I chose?
If I'm not wrong there's a code to reset all the global variables during the title screen inside the updated.c, I suggest checking it and avoid the music style variable if it's necessary.
 
Isn't this one?
C:
    if(openborvariant("in_titlescreen")){

        //FLAG USED TO INDICATE IF THE LEVEL MUSIC IS STOPPED TO THE "MUSICSTAGE.C" FUNCTIONS
        if(getglobalvar("musicStopped") != 1){setglobalvar("musicStopped", 1);}
    if(getglobalvar("musicStyle") == NULL()){setglobalvar("musicStyle", 0);}
    }

Or is it under the musicEvents() function?
C:
    if(openborvariant("in_titlescreen")){
        
        //CHECK THE CURRENT MUSIC TO PLAY IT ONCE
        if(getglobalvar("musicPlaying") != "title.bor"){
            musicTitle();
        }
    }

Would I use clearglobalvar() for the former?
 
Isn't this one?
C:
if(openborvariant("in_titlescreen")){

//FLAG USED TO INDICATE IF THE LEVEL MUSIC IS STOPPED TO THE "MUSICSTAGE.C" FUNCTIONS
if(getglobalvar("musicStopped") != 1){setglobalvar("musicStopped", 1);}
if(getglobalvar("musicStyle") == NULL()){setglobalvar("musicStyle", 0);}
}
This one will only make any change if the musicStyle variable is empty, it means once at the first time you open the game. After the variable is already filled, the only thing that can change it is the clearglobavar() in somewhere, then clearing the musicStyle and then filling with zero again.

However, if you are referring to the variable resetting after closing/reopening the game it only can be maintained by using external text files through filestream functions.
 
The latter sounds advanced for me to acknowledge since I know very little of filestream functions. I want to learn that.

This one will only make any change if the musicStyle variable is empty, it means once at the first time you open the game. After the variable is already filled, the only thing that can change it is the clearglobavar() in somewhere, then clearing the musicStyle and then filling with zero again.
This sounds tricky. How and where can I do that? I tried putting clearglobalvar() around in updated.c, but the music doesn't play after starting the game with select screen and causes the pause menu to be unhighlighted. Not only that, but also the given name of music style is changed to display "Music Style" option. I get error for putting clearglobalvar() in updated.c, and I don't know where to put it.

C:
#import "data/scripts/music.c"

void main(){
    musicReturn();
}

void musicReturn()
{//Start all tasks
    
    if(openborvariant("in_titlescreen")){

        //FLAG USED TO INDICATE IF THE LEVEL MUSIC IS STOPPED TO THE "MUSICSTAGE.C" FUNCTIONS
        if(getglobalvar("musicStopped") != 1){setglobalvar("musicStopped", 1);}
    if(getglobalvar("musicStyle") == NULL()){setglobalvar("musicStyle", 0);}
    }

    //DETECT MANY DIFFERENT EVENTS AND PLAY THE PROPER MUSIC
    musicEvents();

    if(openborvariant("in_level")){
        
        //RESTART MUSICS EVERYTIME THE SOUND MENU IS ACCESSED
        //USED BECAUSE SCRIPTED MUSICS DON'T RESTARTS AUTOMATICALLY IF THE PLAYER DISABLE/ENABLE IT IN THE SOUND MENU
        if(openborvariant("pause") && openborvariant("in_sound_options")){
            if(getglobalvar("soundMenu") == NULL()){setglobalvar("soundMenu", 1);}
        }
        else
        if(!openborvariant("pause")){
            if(getglobalvar("soundMenu") != NULL()){musicReplay();setglobalvar("soundMenu", NULL());}
        }
    }

    if(openborvariant("current_scene") == "data/scenes/howto.txt"){
        musicMenu();
    }

}

void musicMenu()
{//Draw a Menu in/out game

    //DRAW MENU
    if(openborvariant("current_scene") == "data/scenes/howto.txt"){
        void str;
        float hRes    = openborvariant("hresolution");
        int mStyle    = getglobalvar("musicStyle");
        int align;
        int xDif    = 10;                //DIFFERENCE BETWEEN THE FIRST AND SECOND COLUMNS
        int xPos1    = (hRes/2)-xDif;    //BASE X POSITION, FIRST COLUMN (HIGHLIGHTED OPTIONS NAME)
        int xPos2    = (hRes/2)+xDif;    //BASE X POSITION, SECOND COLUMN (HIGHLIGHTED OPTIONS CHANGE)
        int yPos    = 60;                //BASE Y POSITION FOR ALL MENU CONTENT, USE THIS TO MOVE ALL OPTIONS TOGETHER
        int font    = 0;                //ALL FONTS BELOW CHANGES FROM 0 TO 1 IF THE OPTION IS HIGHLIGHTED
        int layer    = 1000000003;
        
        //OPTION TITLE
        str = "Music_Style:";align = xPos1-strwidth(str, font);
        drawstring(align, yPos, font, str, layer);

        //OPTION NAME
        if(mStyle == 0){str = "Green";}
        if(mStyle == 1){str = "Red";}
    if(mStyle == 2){str = "Blue";}
        drawstring(xPos2, yPos, font, str, layer);
    }
}

void musicEvents()
{
    if(openborvariant("in_titlescreen")){
        
        //CHECK THE CURRENT MUSIC TO PLAY IT ONCE
        if(getglobalvar("musicPlaying") != "title.bor"){
            musicTitle();
        }
    }
    if(openborvariant("in_selectscreen")){
        
        //CHECK THE CURRENT MUSIC TO PLAY IT ONCE
        if(getglobalvar("musicPlaying") != "select.bor"){
            musicSelect();
        }
    }
    if(openborvariant("in_showcomplete")){
        
        //CHECK THE CURRENT MUSIC TO PLAY IT ONCE
        if(getglobalvar("musicPlaying") != "finish.bor"){
            musicFinish();
        }
    }
    if(openborvariant("in_gameoverscreen") || openborvariant("current_scene") == "data/scenes/gameover.txt"){
        
        //CHECK THE CURRENT MUSIC TO PLAY IT ONCE
        if(getglobalvar("musicPlaying") != "gameova.bor"){
            musicGameova();
        }
    }

    
}
 
The latter sounds advanced for me to acknowledge since I know very little of filestream functions. I want to learn that.


This sounds tricky. How and where can I do that? I tried putting clearglobalvar() around in updated.c, but the music doesn't play after starting the game with select screen and causes the pause menu to be unhighlighted. Not only that, but also the given name of music style is changed to display "Music Style" option. I get error for putting clearglobalvar() in updated.c, and I don't know where to put it.

C:
#import "data/scripts/music.c"

void main(){
    musicReturn();
}

void musicReturn()
{//Start all tasks
   
    if(openborvariant("in_titlescreen")){

        //FLAG USED TO INDICATE IF THE LEVEL MUSIC IS STOPPED TO THE "MUSICSTAGE.C" FUNCTIONS
        if(getglobalvar("musicStopped") != 1){setglobalvar("musicStopped", 1);}
    if(getglobalvar("musicStyle") == NULL()){setglobalvar("musicStyle", 0);}
    }

    //DETECT MANY DIFFERENT EVENTS AND PLAY THE PROPER MUSIC
    musicEvents();

    if(openborvariant("in_level")){
       
        //RESTART MUSICS EVERYTIME THE SOUND MENU IS ACCESSED
        //USED BECAUSE SCRIPTED MUSICS DON'T RESTARTS AUTOMATICALLY IF THE PLAYER DISABLE/ENABLE IT IN THE SOUND MENU
        if(openborvariant("pause") && openborvariant("in_sound_options")){
            if(getglobalvar("soundMenu") == NULL()){setglobalvar("soundMenu", 1);}
        }
        else
        if(!openborvariant("pause")){
            if(getglobalvar("soundMenu") != NULL()){musicReplay();setglobalvar("soundMenu", NULL());}
        }
    }

    if(openborvariant("current_scene") == "data/scenes/howto.txt"){
        musicMenu();
    }

}

void musicMenu()
{//Draw a Menu in/out game

    //DRAW MENU
    if(openborvariant("current_scene") == "data/scenes/howto.txt"){
        void str;
        float hRes    = openborvariant("hresolution");
        int mStyle    = getglobalvar("musicStyle");
        int align;
        int xDif    = 10;                //DIFFERENCE BETWEEN THE FIRST AND SECOND COLUMNS
        int xPos1    = (hRes/2)-xDif;    //BASE X POSITION, FIRST COLUMN (HIGHLIGHTED OPTIONS NAME)
        int xPos2    = (hRes/2)+xDif;    //BASE X POSITION, SECOND COLUMN (HIGHLIGHTED OPTIONS CHANGE)
        int yPos    = 60;                //BASE Y POSITION FOR ALL MENU CONTENT, USE THIS TO MOVE ALL OPTIONS TOGETHER
        int font    = 0;                //ALL FONTS BELOW CHANGES FROM 0 TO 1 IF THE OPTION IS HIGHLIGHTED
        int layer    = 1000000003;
       
        //OPTION TITLE
        str = "Music_Style:";align = xPos1-strwidth(str, font);
        drawstring(align, yPos, font, str, layer);

        //OPTION NAME
        if(mStyle == 0){str = "Green";}
        if(mStyle == 1){str = "Red";}
    if(mStyle == 2){str = "Blue";}
        drawstring(xPos2, yPos, font, str, layer);
    }
}

void musicEvents()
{
    if(openborvariant("in_titlescreen")){
       
        //CHECK THE CURRENT MUSIC TO PLAY IT ONCE
        if(getglobalvar("musicPlaying") != "title.bor"){
            musicTitle();
        }
    }
    if(openborvariant("in_selectscreen")){
       
        //CHECK THE CURRENT MUSIC TO PLAY IT ONCE
        if(getglobalvar("musicPlaying") != "select.bor"){
            musicSelect();
        }
    }
    if(openborvariant("in_showcomplete")){
       
        //CHECK THE CURRENT MUSIC TO PLAY IT ONCE
        if(getglobalvar("musicPlaying") != "finish.bor"){
            musicFinish();
        }
    }
    if(openborvariant("in_gameoverscreen") || openborvariant("current_scene") == "data/scenes/gameover.txt"){
       
        //CHECK THE CURRENT MUSIC TO PLAY IT ONCE
        if(getglobalvar("musicPlaying") != "gameova.bor"){
            musicGameova();
        }
    }

   
}
I don't know what's happening in your game but it seems that you missed some step in the BOR example I coded for you. Here's a video showing that the music style is always maintained, I suggest to check everything again to see if there's some script clearing your music style variable.

 
I don't know what's happening in your game but it seems that you missed some step in the BOR example I coded for you. Here's a video showing that the music style is always maintained, I suggest to check everything again to see if there's some script clearing your music style variable.

Thank you very much, Kratus! I will look through it.
 
Despite looking through everything that looks the same on mine as the base, the problem still remains, and I have a hard time finding it.

OK. When I try to disable the music and then enable it back, the music doesn't play at all eventually. How can I enable the scripted music in the menu screen like I do with the regular remix.bor file? I can enable it only in levels.

ROD MAXED OUT! - 0010.png
 
Despite looking through everything that looks the same on mine as the base, the problem still remains, and I have a hard time finding it.

OK. When I try to disable the music and then enable it back, the music doesn't play at all eventually. How can I enable the scripted music in the menu screen like I do with the regular remix.bor file? I can enable it only in levels.

View attachment 5264
In the BOR mod I sent to you the music enable/disable is working fine, maybe you missed some step in your game.


In addition, you can add many events as you want in order to play music in different moments, like the example below (the same goes to the in_menuscreen variant too).
C:
void musicEvents()
{
    if(openborvariant("in_titlescreen")){
        
        //CHECK THE CURRENT MUSIC TO PLAY IT ONCE
        if(getglobalvar("musicPlaying") != "title.ogg"){
            musicTitle();
        }
    }
    if(openborvariant("in_menuscreen")){
        
        //CHECK THE CURRENT MUSIC TO PLAY IT ONCE
        if(getglobalvar("musicPlaying") != "menu.ogg"){
            musicMenu();
        }
    }
    if(openborvariant("in_selectscreen")){
        
        //CHECK THE CURRENT MUSIC TO PLAY IT ONCE
        if(getglobalvar("musicPlaying") != "select.ogg"){
            musicSelect();
        }
    }
    if(openborvariant("in_showcomplete")){
        
        //CHECK THE CURRENT MUSIC TO PLAY IT ONCE
        if(getglobalvar("musicPlaying") != "finish.ogg"){
            musicFinish();
        }
    }
    if(openborvariant("in_gameoverscreen") || openborvariant("current_scene") == "data/scenes/gameover.txt"){
        
        //CHECK THE CURRENT MUSIC TO PLAY IT ONCE
        if(getglobalvar("musicPlaying") != "gameova.ogg"){
            musicGameova();
        }
    }
    if(openborvariant("current_scene") == "data/scenes/story1.txt"){
        
        //CHECK THE CURRENT MUSIC TO PLAY IT ONCE
        if(getglobalvar("musicPlaying") != "story1.ogg"){
            musicStory1();
        }
    }
    if(openborvariant("current_scene") == "data/scenes/story2.txt"){
        
        //CHECK THE CURRENT MUSIC TO PLAY IT ONCE
        if(getglobalvar("musicPlaying") != "story2.ogg"){
            musicStory2();
        }
    }
}
 
Back
Top Bottom