Audio Levels/Sliders Problems

0 favourites
  • 7 posts
From the Asset Store
slide the tiles to fill the board.60 awesome levels.
  • Hey all!

    I've posted multiple times in the past about having troubles with audio sliders and audio levels not working, but this time I'm having a problem with them saving. Everything seems to be working correctly, but then when I load up the game, you can't hear the audio until you open the settings page. And even then, the audio sliders don't automatically load to what they were when the game closed. They start at the max volume then a couple ticks later adjust to where they last were, but the audio remains at full volume. I've attached the capx file for the game in hopes of having it get solved. Any help would be absolutely tremendous!

    dropbox.com/s/aofhsia0ismaian/UnsuranceCapx.capx

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • The order of events in your project is not right..

    Here is how I usually do this:

    In the loader layout (Titles) you need to wait for "Loader layout complete" event before doing anything else.

    When this event is triggered, I read all game settings from Local Storage. Instead of storing each value separately, I put them all in a dictionary, see this simple demo. After loading the dictionary, you can extract values to variables, if you want, see this screenshot.

    When settings are loaded (or not exist and default settings are used), only then I set audio volumes and start playing music.

    You don't need to load settings again, so don't do this on start of every layout.

  • Alright, well I started using a dictionary for the events, and I mostly got the fullscreen to work (not fully), but the sliders and audio levels still aren't functioning. Sorry if my mistakes are simple to fix and I'm missing something that is probably staring me in the face!

    Here's the updated capx: dropbox.com/s/exhi7hdvoop7l1q/UnsuranceCapx_2.capx

    Many thanks again for your help!

  • Here you go:

    dropbox.com/s/c8k4lbkpnacd18b/UnsuranceCapx_2.capx

    I fixed your loader layout and music slider, you can do the same with the effects slider.

    EDIT: I changed a few events in AudioSliders, please re-download the file.

  • Awesome, thank you so much!! That really did the trick. However, I am curious as to why when they volume is at zero, it won't save. It will just reset itself to max volume. Any other level that isn't 0 will save, but once the volume is completely silent it just won't save itself. Would you have any idea why that is? No problem if you don't, just thought I'd ask anyways. Thank you again! You've really helped a lot!

  • If you run the game in debug mode and check variables, you will see why.

    The MVarVolume becomes "-Infinity" at the lowest setting. You can change the formula to prevent this from happening:

    max(log10(unlerp(MusicSliderBack.ImagePointX("start"),MusicSliderBack.ImagePointX("end"), MusicSlider.x))*20, -100)

  • That did it. Once again, I thank you for all your help! It means so much!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)