sound and music issue
kajuto
Member Posts: 314
hi everyone!!!
in my game i already put the sound and music for it, and in the option scene i can turn off the music background and fine, but after i play a level and then i come back to the main menu the music start again, how it can stay turn off until i turn it on ??? help please
in my game i already put the sound and music for it, and in the option scene i can turn off the music background and fine, but after i play a level and then i come back to the main menu the music start again, how it can stay turn off until i turn it on ??? help please
Comments
Providing you set the Music volume to 0 via game.Audio.Music Volume in your option scene then going back to your main menu, the volume should still be off. If it's on, you must have set the volume back to 1 somewhere on the main menu. Hope that helps! :-)
----------------------------------------------
http://davidgriffinapps.co.uk/
iPad: End of the Earth game coming soon to the iTunes App Store....
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
It really is straightforward as I first suggested! As long as when you want to turn off the music you change the Music volume attribute to 0; and when (and wherever) you want to turn it back on again then change the music volume to 1. :-)
A suggestion: rather than having lots of these, where they could get "tangled", just have both off and on on the same screen, perhaps your option menu. You can even make it so that just the one button is used:
When touch is pressed
When game.Audio.Music Volume =1
Change attribute game.Audio.Music Volume to 0
change image to offpic.png
otherwise
Change attribute game.Audio.Music Volume to 1
change image to onpic.png
Another option you might want to try is: instead of changing the music's volume, use Pause Music behaviour and Resume music; that way the music doesn't carry on playing like when the volume is set to 0 from 1.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
=-(
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
I think you mean you can't find the attribute to turn the music on or off...
OK, in the Change Attribute Behavior - connected to the change attribute field, you'll see 3 dots; click on that. Then click on Devices > Audio > Music Volume. Then in the "To" field, put 0 or 1.
:-)
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
thanks...
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Firstly, in your first Rule, I'm not sure why you need a wait of .5 of a second before your Rule to start the music.
Then I don't understand what the purpose of your boolean attribute is - game.Music Cont... because you're playing your music, 44-Rowdy Rumble (which presumably is over 30 seconds in length) for just 1 second.
Then I don't understand why you have set the music volume to 0.3 without any conditions.
Also it seems you've made a boolean switch (game.Score Music) to change the volume of the music between 0 and 1, which you don't need to do.
If all the above is for simply for getting music to start playing, and when a button is pressed the volume goes to 0, and if pressed again, goes back to 1, etc., then I'd recommend you scrap your Rules shown in the picture and use the Rules I suggested in my 2nd post.
Here it is again, with a small addition:
Wherever you want to start the Music playing, put in the actor:
Play Music Behavior Sound: 44-Rowdy Rumble --- set to loop if you like
then what I wrote previously as a suggestion, in a button, perhaps in your option menu or on all levels:
When touch is pressed
When game.Audio.Music Volume =1
Change attribute game.Audio.Music Volume to 0
change image to offpic.png
otherwise
Change attribute game.Audio.Music Volume to 1
change image to onpic.png
The idea of the Change Image is that one would say something like Volume or Music Volume, one pic with the addition of the word "On", the other with the addition of the word "Off". So as you press to change states, so the picture shows the state of the music volume, but you don't have to use Change Image if you don't want to.
I hope that's helped out.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Second about the music 44 Rowdy Rumble i know the length of it, but if some people like me, that like to hear the whole music the loop again.
The 0.3 music volume i did it because a tutorial did that, so i just follow the rule.
what i really want is this.
have a music backgrouind in the main menu and when i enter the level menu, that music continue to it, but STOP when i start playing, (stop that song) , but start to play another song background for the gameplay and also when i slide the volume to make the music and sfx not so loud or just to turn it on or off...that the whole point for it..
help me
That's fair enough about starting your music 0.5 seconds after; but most people don't do that, I'm certain. And even if they do want a pause before playing, it'll be a time more than 0.5 of a second (that's such a short time that no one will notice and so you might as well not bother with a start timer!)
As to your music 44 Rowdy Rumble, that's fair enough what you wrote; although I still don't understand why you stop the music one second after it's started... I would ignore that piece of your Rules.
I understand now why you set the music volume to .3 - you don't need this; I'll explain how to adjust the volume further on.
Perhaps start clean, and do the following, as suggestions:
How to play music in your main menu, and different music in any other level
Solution: Make an actor in the Inspector, call it Music Playing and double-click it. Drag a Play Music Behavior into its rules. In the editor for your main menu, drag this actor onto the level screen but outside of the screen area, so it doesn't show when the game is playing. Double click the actor to go to its editor/rules window. Unlock it. Find your music in the drop down menu of the Play Music Behavior. Set the music to loop, if you want this to happen.
In all your other levels, do exactly the same, changing the music you want playing for that particular level from the drop down menu of the Play music Behavior.
THat's it; when you go to another level from the main menu, the different music will take over and start to play.
As for pausing music, use the Pause Music behaviour and when you want to start the music again, drag a Play Music behaviour to the Rules and it'll say: Resume Current Music.
For changing the volume, that's relatively straightforward but will take too long to explain here - sorry - (and there's more than 1 way to do this).
Enough to say that one way would be to make 10 buttons, marked 0 to 10 ( or ten transparent buttons over one image showing 1 to 10). In each button, put Rule: when Touch is pressed, Change Attribute game.Audio.Music Volume to 0, 0.1, 0.2, 0.3, etc; depending on which button the rules are in.
You can do the same for the Sound volume, except use Change Attribute game.Audio.Sound Volume instead.
Hope those last instructions didn't confuse you; I'd make a test for you if I had time, but I know I won't have time today.
Good luck, I hope you get it sorted now.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
(For changing the volume, that's relatively straightforward but will take too long to explain here - sorry - (and there's more than 1 way to do this).
Enough to say that one way would be to make 10 buttons, marked 0 to 10 ( or ten transparent buttons over one image showing 1 to 10). In each button, put Rule: when Touch is pressed, Change Attribute game.Audio.Music Volume to 0, 0.1, 0.2, 0.3, etc; depending on which button the rules are in.
You can do the same for the Sound volume, except use Change Attribute game.Audio.Sound Volume instead.
Hope those last instructions didn't confuse you; I'd make a test for you if I had time, but I know I won't have time today.
Good luck, I hope you get it sorted now.)
I put a Music Playing the Main menu, main menu to option menu or any other menu, when i come back, it's start playing the music again instead of continuing playing where it left off that;s the first prob, how can i resolve this??
second, in the main menu i go to world menu and then level menu, the music keep playing that's fine, but after i go playing and come back to the level menu, it doesn't resume the music (even i put the Music Playing Actor to resume the music) where it left off of the music playing actor (music background)in the world menu it's doesn't either, but when i go to main menu it's start again, how can i fix that?
I want start playing music background when it start in the main menu, no matter what menu (scene i go keep playing - that;s already works) but every time i come back Resume the music background where it left off
there is another way to make the slider button for music and sound that if i slide to the left turn the music/sound off and to the right turn music/sound on instead of making all the button for each vol like u said in the paragraph in the top???? and all the music and sound that i turn on/off apply for the whole game, not only of One Scene
Help Please
So for a slider, your best best is to check out one of templates available; there's two I can think of: @FireMapleGames and @Tshirtbooth. Find one of them and check it out and it'll be just right for you. (One of them's called Volume Slider, I think).
----------------------------------------------------------------------------
iPad app: End of the Earth –•– http://davidgriffinapps.co.uk/
----------------------------------------------------------------------------
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps