big problem, need help
pjnolen
Member Posts: 152
Ok, i had a problem with background music not working properly, but i couldn't figure out how to fix it and no one else had any ideas, so i tried to just change the scene in order to solve the problem.
The original problem was having background music play on the main menu scene. When you press a button to go to another scene, such as difficulty options, or sound options the music continues just fine. But when you go BACK to the main menu scene, the music resets, and it will keep doing that every time you go back to that main menu scene. The music needs to play uninterrupted until you leave the menus and go into the game, but it won't and no one can help me fix it, assuming it can be fixed.
Soooooo, i decided if the music resets every time i load the main menu scene, i'll just not reload it. I increased it's size, and when you press one of the buttons to go to another screen, instead, it just moves the present buttons off the screen, and moves onto the screen the new buttons. So press the 'sounds' button, and all the buttons leave the screen, and all the sound buttons move onto the screen. Press the back button(that moves onto the screen along with the sound options) and the sound buttons move off, and the main menu buttons move back on. This works, only halfassed.
If i press the sounds buttons, they'll come on and go off all day long, BUT if I then press the 'difficulty' button, the difficulty options will NOT enter the screen. They just don't move.
If I reset, and press the 'difficulty' button, those options come onto the screen just fine, BUT then the sound options won't enter the screen.
I have added a game attribute called 'start screen menus'
I have it setup where, when you press the 'sound' button, it's set to 1, and when it's set to 1 the sound options move onto the screen. Which works
When you press the 'back' button it sets it to 0, and when it's set to 0, the main menu buttons come back. Which works.
When you press the difficulty button, it sets it to 2, when it's set to 2, the difficulty options move on to the screen. Which works.
BUT I can only do ONE of those. Which ever one I press FIRST will work just fine over and over. But then I can't use the other one.
I think it has something to do with changing the 'start screen menu' attribute, but i have it already set when you press the 'back' button it changes it to 0, so every time you press a main menu button it should be changing it from 0 to either 1 or 2.
Just having a menu screen with some options on it should be the last thing i need to be smashing my head against the wall with, I've got the rest of the game to do, but clearly if I can't make the menu screen, I can't expect to finish the game.
I REALLY REALLY REALLY want to finish this, but I keep getting 90% through a section and hitting a brick wall, then from scratch redesigning it to go around that brick wall, and after 90% of that, hitting another brick wall.
Can I get some advice on getting this to work? I originally had a different scene for each main menu option, but threw it all away because the sound would keep resetting. Now i have 1 scene, but the buttons WONT reset.
There's got to be something I'm missing here. Help me out guys. I want to do a good job, see my game on the app store like everyone else, feel good about what I made and how I made it. If it's finished and working exactly how i wanted, then GS can have any splash screen they want!
The original problem was having background music play on the main menu scene. When you press a button to go to another scene, such as difficulty options, or sound options the music continues just fine. But when you go BACK to the main menu scene, the music resets, and it will keep doing that every time you go back to that main menu scene. The music needs to play uninterrupted until you leave the menus and go into the game, but it won't and no one can help me fix it, assuming it can be fixed.
Soooooo, i decided if the music resets every time i load the main menu scene, i'll just not reload it. I increased it's size, and when you press one of the buttons to go to another screen, instead, it just moves the present buttons off the screen, and moves onto the screen the new buttons. So press the 'sounds' button, and all the buttons leave the screen, and all the sound buttons move onto the screen. Press the back button(that moves onto the screen along with the sound options) and the sound buttons move off, and the main menu buttons move back on. This works, only halfassed.
If i press the sounds buttons, they'll come on and go off all day long, BUT if I then press the 'difficulty' button, the difficulty options will NOT enter the screen. They just don't move.
If I reset, and press the 'difficulty' button, those options come onto the screen just fine, BUT then the sound options won't enter the screen.
I have added a game attribute called 'start screen menus'
I have it setup where, when you press the 'sound' button, it's set to 1, and when it's set to 1 the sound options move onto the screen. Which works
When you press the 'back' button it sets it to 0, and when it's set to 0, the main menu buttons come back. Which works.
When you press the difficulty button, it sets it to 2, when it's set to 2, the difficulty options move on to the screen. Which works.
BUT I can only do ONE of those. Which ever one I press FIRST will work just fine over and over. But then I can't use the other one.
I think it has something to do with changing the 'start screen menu' attribute, but i have it already set when you press the 'back' button it changes it to 0, so every time you press a main menu button it should be changing it from 0 to either 1 or 2.
Just having a menu screen with some options on it should be the last thing i need to be smashing my head against the wall with, I've got the rest of the game to do, but clearly if I can't make the menu screen, I can't expect to finish the game.
I REALLY REALLY REALLY want to finish this, but I keep getting 90% through a section and hitting a brick wall, then from scratch redesigning it to go around that brick wall, and after 90% of that, hitting another brick wall.
Can I get some advice on getting this to work? I originally had a different scene for each main menu option, but threw it all away because the sound would keep resetting. Now i have 1 scene, but the buttons WONT reset.
There's got to be something I'm missing here. Help me out guys. I want to do a good job, see my game on the app store like everyone else, feel good about what I made and how I made it. If it's finished and working exactly how i wanted, then GS can have any splash screen they want!
Comments
When the game starts, have a rule controlling the music as:
If MusicStarted = false, play musicfile, change game.MusicStarted to true.
In other words, simply check each time you go back to the main menu if the music has already started, which it will have, so there's no need for the music to play again.
Do you mean, put this rule in an actor, and place that actor in the 'main menu' screen?
If I do that, when I go 'back' to the main menu screen from the music options screen the music stops. It makes perfect sense that this rule would work, because the rule would from then on always be true, and therefore the music wouldn't be adjusted in any way.
But when I go back to the main menu, it cuts the music off.
and it works.
So now I have to figure out why mine doesn't work and this one does.
ARG.
Thanks Forklift, if I can get this to work, then I will recreate all the scenes, again, from scratch, delete all the rules and attributes i had to make, and start over, again.
I KNEW there was a way the first time I did it(similar to yours, but wrong), but I just couldn't figure it out.
but........at least, with the help you gave, it will work.
THANK YOU FORKLIFT
instead of your 'if set to false, start music, then set to true'
If reset button is pressed, change game.sound (boolean) to false.
when scene starts, if game.sound = false, play music, change game.sound to true