[Solved?] Moving Audio Slider Crashes the Game

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
ninefoldrin
Newbie
Posts: 9
Joined: Thu Dec 27, 2018 12:40 am
Contact:

[Solved?] Moving Audio Slider Crashes the Game

#1 Post by ninefoldrin »

This has been an issue since I first started adding music to the game and I've been unable to figure out the problem with it. When I attempt to adjust the slider for music or sound (my game does not feature voices, so that slider is disabled), it causes the game to crash with the following error:

Code: Select all

While running game code:
  File "renpy/common/00barvalues.rpy", line 421, in set_mixer
    _preferences.set_volume(self.mixer, value)
TypeError: 'float' object is not callable
Full traceback at the bottom.

I have also been attempting to change the default volumes so that the game doesn't start at full blast, but adding define config.default_music_volume = 0.25 to options.rpy has no effect and I suspect that it is related to the same issue causing the aforementioned error. I've attempted to remove any and all code I added that affects volume in any way, but the error still persists.

On a whim, I decided to build an android package to see how the game worked on my phone and interestingly there was no issue with adjusting the volume and the default volume was set exactly where it should be when I opened the preferences. I wasn't going to bother figuring this out just yet, but after it worked fine on my phone, I'm desperately trying to find a solution and haven't found anything so far. I'm not terribly familiar with python or programing in general, so I'm really lost at this point.

(EDIT)
Maybe I should also mention that the sliders for text speed and auto-forward work fine.

Code: Select all

Full traceback:
  File "renpy/common/_layout/screen_main_menu.rpym", line 28, in script
    python hide:
  File "C:\Program Files (x86)\renpy-7.1.1-sdk\renpy\ast.py", line 881, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "C:\Program Files (x86)\renpy-7.1.1-sdk\renpy\python.py", line 1913, in py_exec_bytecode
    exec bytecode in globals, locals
  File "renpy/common/_layout/screen_main_menu.rpym", line 28, in <module>
    python hide:
  File "renpy/common/_layout/screen_main_menu.rpym", line 35, in _execute_python_hide
    ui.interact()
  File "C:\Program Files (x86)\renpy-7.1.1-sdk\renpy\ui.py", line 289, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "C:\Program Files (x86)\renpy-7.1.1-sdk\renpy\display\core.py", line 2672, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "C:\Program Files (x86)\renpy-7.1.1-sdk\renpy\display\core.py", line 3477, in interact_core
    rv = root_widget.event(ev, x, y, 0)
  File "C:\Program Files (x86)\renpy-7.1.1-sdk\renpy\display\layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "C:\Program Files (x86)\renpy-7.1.1-sdk\renpy\display\transition.py", line 47, in event
    return self.new_widget.event(ev, x, y, st)  # E1101
  File "C:\Program Files (x86)\renpy-7.1.1-sdk\renpy\display\layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "C:\Program Files (x86)\renpy-7.1.1-sdk\renpy\display\layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "C:\Program Files (x86)\renpy-7.1.1-sdk\renpy\display\screen.py", line 697, in event
    rv = self.child.event(ev, x, y, st)
  File "C:\Program Files (x86)\renpy-7.1.1-sdk\renpy\display\layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "C:\Program Files (x86)\renpy-7.1.1-sdk\renpy\display\layout.py", line 244, in event
    rv = d.event(ev, x - xo, y - yo, st)
  File "C:\Program Files (x86)\renpy-7.1.1-sdk\renpy\display\layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "C:\Program Files (x86)\renpy-7.1.1-sdk\renpy\display\layout.py", line 244, in event
    rv = d.event(ev, x - xo, y - yo, st)
  File "C:\Program Files (x86)\renpy-7.1.1-sdk\renpy\display\layout.py", line 244, in event
    rv = d.event(ev, x - xo, y - yo, st)
  File "C:\Program Files (x86)\renpy-7.1.1-sdk\renpy\display\viewport.py", line 305, in event
    rv = super(Viewport, self).event(ev, x, y, st)
  File "C:\Program Files (x86)\renpy-7.1.1-sdk\renpy\display\layout.py", line 244, in event
    rv = d.event(ev, x - xo, y - yo, st)
  File "C:\Program Files (x86)\renpy-7.1.1-sdk\renpy\display\layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "C:\Program Files (x86)\renpy-7.1.1-sdk\renpy\display\layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "C:\Program Files (x86)\renpy-7.1.1-sdk\renpy\display\layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "C:\Program Files (x86)\renpy-7.1.1-sdk\renpy\display\layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "C:\Program Files (x86)\renpy-7.1.1-sdk\renpy\display\layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "C:\Program Files (x86)\renpy-7.1.1-sdk\renpy\display\behavior.py", line 1860, in event
    rv = self.adjustment.change(value)
  File "C:\Program Files (x86)\renpy-7.1.1-sdk\renpy\display\behavior.py", line 1510, in change
    return self.changed(value)
  File "renpy/common/00barvalues.rpy", line 421, in set_mixer
    _preferences.set_volume(self.mixer, value)
TypeError: 'float' object is not callable
Last edited by ninefoldrin on Thu Jan 10, 2019 11:32 pm, edited 1 time in total.

ninefoldrin
Newbie
Posts: 9
Joined: Thu Dec 27, 2018 12:40 am
Contact:

Re: Moving Audio Slider Crashes the Game

#2 Post by ninefoldrin »

bump

ninefoldrin
Newbie
Posts: 9
Joined: Thu Dec 27, 2018 12:40 am
Contact:

Re: Moving Audio Slider Crashes the Game

#3 Post by ninefoldrin »

I could still really use some help figuring out what's wrong here.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Moving Audio Slider Crashes the Game

#4 Post by PyTom »

I don't know, offhand. The problem isn't shown here - the most likely thing I can come up with is you did something like

_preferences.set_volume = .5

or something like that.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

ninefoldrin
Newbie
Posts: 9
Joined: Thu Dec 27, 2018 12:40 am
Contact:

Re: Moving Audio Slider Crashes the Game

#5 Post by ninefoldrin »

In 00barvalues.rpy I have

Code: Select all

def set_mixer(self, value):
            _preferences.set_volume(self.mixer, value)
            renpy.restart_interaction()
I haven't touched anything there from the default, so I'm unsure. I do have "define config.default_music_volume = 0.25" in the options.rpy of my game, but that should not be causing any problems and removing that has not remedied the issue. I did at one time have code in the game to set the volume of the music channel. I'm not sure if that was before or after I discovered that it wouldn't let me set the default music volume.

I tried creating a fresh project to see what happened and there's no issues. The sound is exactly as it should be and the sliders work as they should.

ninefoldrin
Newbie
Posts: 9
Joined: Thu Dec 27, 2018 12:40 am
Contact:

Re: Moving Audio Slider Crashes the Game

#6 Post by ninefoldrin »

So it's not anything with my code. I had someone else test it on their computer and it works just fine. I attempted to re-download ren'py on the off-chance that something was wrong with it, but that didn't change anything. I'm desperately trying to figure this out so I can test the audio myself.

ninefoldrin
Newbie
Posts: 9
Joined: Thu Dec 27, 2018 12:40 am
Contact:

Re: Moving Audio Slider Crashes the Game

#7 Post by ninefoldrin »

Where are sound settings saved? Since the issue doesn't occur on any other ren'py game that I play or create, I'm curious if it has something to do with the saved settings. Idk if that's possible, but it's the only thing I can think of at this point.

ninefoldrin
Newbie
Posts: 9
Joined: Thu Dec 27, 2018 12:40 am
Contact:

Re: [Solved?] Moving Audio Slider Crashes the Game

#8 Post by ninefoldrin »

I've somehow fixed it. I still don't know what the original problem was, but I created a new project, swapped in the options.rpy and options.rpyc files from the fresh project with the audio code changes I made to test. I made backups of the original files. The sliders worked just fine, just as they were supposed to. So I swapped the original files back in and everything is fine. I have no idea what the issue was, but this has fixed it.

Post Reply

Who is online

Users browsing this forum: IrisColt, LegsWild