Text and Auto-Forward Bars Not Working

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
CheeryMoya
Miko-Class Veteran
Posts: 892
Joined: Sun Jan 01, 2012 4:09 am

Text and Auto-Forward Bars Not Working

#1 Post by CheeryMoya »

We've run into a bit of a wall with customizing screens.rpy, and no one can figure out why.

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "renpy/common/_layout/screen_main_menu.rpym", line 11, in script
  File "game/screens.rpy", line 637, in python
  File "renpy/common/00preferences.rpy", line 128, in python
  File "renpy/common/00barvalues.rpy", line 135, in python
TypeError: isinstance() arg 2 must be a class, type, or tuple of classes and types

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "C:\Users\User\Documents\VN Business\renpy-6.15.1\renpy\execution.py", line 288, in run
    node.execute()
  File "C:\Users\User\Documents\VN Business\renpy-6.15.1\renpy\ast.py", line 718, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "C:\Users\User\Documents\VN Business\renpy-6.15.1\renpy\python.py", line 1297, in py_exec_bytecode
    exec bytecode in globals, locals
  File "renpy/common/_layout/screen_main_menu.rpym", line 11, in <module>
    $ ui.interact()
  File "C:\Users\User\Documents\VN Business\renpy-6.15.1\renpy\ui.py", line 237, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "C:\Users\User\Documents\VN Business\renpy-6.15.1\renpy\display\core.py", line 1864, in interact
    scene_lists.replace_transient()
  File "C:\Users\User\Documents\VN Business\renpy-6.15.1\renpy\display\core.py", line 558, in replace_transient
    self.remove(layer, tag)
  File "C:\Users\User\Documents\VN Business\renpy-6.15.1\renpy\display\core.py", line 832, in remove
    self.hide_or_replace(layer, remove_index, "hide")
  File "C:\Users\User\Documents\VN Business\renpy-6.15.1\renpy\display\core.py", line 756, in hide_or_replace
    d = oldsle.displayable._hide(now - st, now - at, prefix)
  File "C:\Users\User\Documents\VN Business\renpy-6.15.1\renpy\display\screen.py", line 189, in _hide
    hid.update()
  File "C:\Users\User\Documents\VN Business\renpy-6.15.1\renpy\display\screen.py", line 266, in update
    self.screen.function(**self.scope)
  File "C:\Users\User\Documents\VN Business\renpy-6.15.1\renpy\screenlang.py", line 1217, in __call__
    renpy.python.py_exec_bytecode(self.code.bytecode, locals=scope)
  File "C:\Users\User\Documents\VN Business\renpy-6.15.1\renpy\python.py", line 1297, in py_exec_bytecode
    exec bytecode in globals, locals
  File "game/screens.rpy", line 637, in <module>
    bar value Preference("text speed")
  File "renpy/common/00preferences.rpy", line 128, in Preference
    return FieldValue(_preferences, "text_cps", range=200, max_is_zero=True, style="slider")
  File "renpy/common/00barvalues.rpy", line 135, in __init__
    if isinstance(range, float):
TypeError: isinstance() arg 2 must be a class, type, or tuple of classes and types

Windows-7-6.1.7601-SP1
Ren'Py 6.15.7.374
The Buried Moon 0.0
The code in question looks like this:

Code: Select all

screen preferences:
    tag menu
    use navigation
    vbox ypos .026 xmaximum 950:
        add "title_configuration" xpos .02
        # Put the navigation columns in a three-wide grid.
        grid 3 1 ypos .03 xpos 0 spacing 0:
            style_group "prefs"
            xfill True

            # The left column.
            vbox:
                frame:
                    style_group "pref"
                    has vbox
                    text _("Display")
                    null height 10
                    null
                    textbutton _("Window") action Preference("display", "window")
                    textbutton _("Fullscreen") action Preference("display", "fullscreen")

                frame:
                    style_group "pref"
                    has vbox
                    text _("Transitions")
                    null height 10
                    textbutton _("All") action Preference("transitions", "all")
                    textbutton _("None") action Preference("transitions", "none")

                frame:
                    style_group "pref"
                    has vbox
                    text _("Text Speed")
                    null height 10
                    bar value Preference("text speed")

            vbox:
                frame:
                    style_group "pref"
                    has vbox
                    text _("Skip")
                    null height 10
                    textbutton _("Seen Messages") action Preference("skip", "seen")
                    textbutton _("All Messages") action Preference("skip", "all")

                frame:
                    style_group "pref"
                    has vbox
                    text _("After Choices")
                    null height 10
                    textbutton _("Stop Skipping") action Preference("after choices", "stop")
                    textbutton _("Keep Skipping") action Preference("after choices", "skip")

                frame:
                    style_group "pref"
                    has vbox
                    text _("Auto-Forward Time")
                    null height 10
                    bar value Preference("auto-forward time")
            use sound_options
            
screen sound_options:
    vbox:
        frame:
            style_group "pref"
            has vbox
            text _("Music Volume")
            null height 10
            bar value Preference("music volume")

        frame:
            style_group "pref"
            has vbox
            text _("Sound Volume")
            null height 10
            bar value Preference("sound volume")
            if config.sample_sound:
                textbutton _("Test"):
                    action Play("sound", config.sample_sound)
                    style "soundtest_button"

        if config.has_voice:
            frame:
                style_group "pref"
                has vbox
                text _("Voice Volume")
                null height 10
                bar value Preference("voice volume")
                if config.sample_voice:
                    textbutton "Test":
                        action Play("voice", config.sample_voice)
                        style "soundtest_button"
What you should be looking at is each of the bar value options. Music and Sounds bars work just fine but Text Speed and Auto-Forward Time don't, despite looking the same. Can anyone lend us a hand?

If you need it, the screens.rpy file is here for your perusal. Thanks in advance.

User avatar
PyTom
Ren'Py Creator
Posts: 16093
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: Text and Auto-Forward Bars Not Working

#2 Post by PyTom »

Did you redefine float to be something weird? (Like a character or a transition or transform or variable?) "float" is a python built-in, and redefining it will make things fail.
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

User avatar
leon
Miko-Class Veteran
Posts: 554
Joined: Sun Oct 09, 2011 11:15 pm
Completed: Visual Novel Tycoon, Night at the Hospital, Time Labyrinth, The Buried Moon, Left of Center, Super Otome Quest
Projects: Lemon Project, Porcelain Heart, Dream's Dénouement
Organization: Team ANARKY
Contact:

Re: Text and Auto-Forward Bars Not Working

#3 Post by leon »

Y-yes we did. *hides in shame*

Removing the transform named float solved it. Thanks!

Post Reply

Who is online

Users browsing this forum: Pandar