Music Room Error

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
User avatar
TheOneAndOnly-K
Regular
Posts: 78
Joined: Mon Apr 07, 2014 10:33 am
Contact:

Music Room Error

#1 Post by TheOneAndOnly-K »

Code: Select all

I'm sorry, but an uncaught exception occurred.

While parsing C:\Users\Mam\Downloads\Fish\Renpy\Game List\Anime Academy/game/screens.rpy.
TypeError: 'ScreenLangScreen' object is not iterable
I did everything this forum told me too...but it's not working. Anyone know why?

http://lemmasoft.renai.us/forums/viewto ... f=8&t=7822

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: Music Room Error

#2 Post by PyTom »

Can you post the rest of the exception? It's hard for me to tell, from just that, what the problem is.
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
TheOneAndOnly-K
Regular
Posts: 78
Joined: Mon Apr 07, 2014 10:33 am
Contact:

Re: Music Room Error

#3 Post by TheOneAndOnly-K »

Code: Select all

I'm sorry, but an uncaught exception occurred.

While parsing C:\Users\Mam\Downloads\Fish\Renpy\Game List\Anime Academy/game/screens.rpy.
TypeError: 'ScreenLangScreen' object is not iterable

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

Full traceback:
  File "C:\Users\Mam\Downloads\Fish\Renpy\renpy\bootstrap.py", line 288, in bootstrap
    renpy.main.main()
  File "C:\Users\Mam\Downloads\Fish\Renpy\renpy\main.py", line 250, in main
    renpy.game.script.load_script() # sets renpy.game.script.
  File "C:\Users\Mam\Downloads\Fish\Renpy\renpy\script.py", line 177, in load_script
    self.load_appropriate_file(".rpyc", ".rpy", dir, fn, initcode)
  File "C:\Users\Mam\Downloads\Fish\Renpy\renpy\script.py", line 443, in load_appropriate_file
    if not self.load_file(dir, fn + source, initcode):
  File "C:\Users\Mam\Downloads\Fish\Renpy\renpy\script.py", line 310, in load_file
    data, stmts = self.load_file_core(dir, fn)
  File "C:\Users\Mam\Downloads\Fish\Renpy\renpy\script.py", line 250, in load_file_core
    stmts = renpy.parser.parse(fullfn)
  File "C:\Users\Mam\Downloads\Fish\Renpy\renpy\parser.py", line 2221, in parse
    rv = parse_block(l)
  File "C:\Users\Mam\Downloads\Fish\Renpy\renpy\parser.py", line 2186, in parse_block
    stmt = parse_statement(l)
  File "C:\Users\Mam\Downloads\Fish\Renpy\renpy\parser.py", line 2169, in parse_statement
    return pf(l, loc)
  File "C:\Users\Mam\Downloads\Fish\Renpy\renpy\parser.py", line 1860, in screen_statement
    screen = renpy.screenlang.parse_screen(l)
  File "C:\Users\Mam\Downloads\Fish\Renpy\renpy\screenlang.py", line 1345, in parse_screen
    screen = screen_parser.parse(l)
  File "C:\Users\Mam\Downloads\Fish\Renpy\renpy\screenlang.py", line 1309, in parse
    rv.extend(c)
TypeError: 'ScreenLangScreen' object is not iterable

Windows-7-6.1.7601-SP1
Ren'Py 6.17.4.409


The error

Code: Select all

#Hey Renpy I got some music tracks...
init python:
    # Step 1. Create a MusicRoom instance.
    mr = MusicRoom(fadeout=1.0)
    # Step 2. Add music files.
    mr.add("music/4th String Quartet.mp3", always_unlocked=True)
    mr.add("music/Adventure Time.mp3", always_unlocked=True)
    mr.add("music/Asterisk Bleach.mp3", always_unlocked=True)
    mr.add("music/Can Do Kuroko No Basket.mp3", always_unlocked=True)
    mr.add("music/Death Note.mp3", always_unlocked=True)
    mr.add("music/Fruits Basket.mp3", always_unlocked=True)
    mr.add("music/Glaring Dream Gravitation.mp3", always_unlocked=True)
    mr.add("music/Gotta Go Fast Sonic X.mp3", always_unlocked=True)
    mr.add("music/Hatafutte Parade.mp3", always_unlocked=True)
    mr.add("music/I Will Fullmetal Alchemist.mp3", always_unlocked=True)
    mr.add("music/Let Me Be With You Chobits.mp3", always_unlocked=True)
    mr.add("music/Monochrome No Kiss Black Butler.mp3", always_unlocked=True)
    mr.add("music/Pokemon.mp3", always_unlocked=True)
    mr.add("music/Rage On Free.mp3", always_unlocked=True)
    mr.add("music/Resonance Soul Eater.mp3", always_unlocked=True)
    mr.add("music/Sakura Kiss Ouran High.mp3", always_unlocked=True)
    mr.add("music/Snow Fairy Fairy Tail.mp3", always_unlocked=True)
    mr.add("music/The Orphans.mp3", always_unlocked=True)

#Hey Renpy now I gotta make a player to play em...
screen music_room:

    tag menu
    window:
        style "gm_root"
        
    frame:
        style_group "gm_nav"
        size_group "mm"
        xpos 720
        ypos 580
        has vbox:
            xalign 0.98 
            yalign 0.98
            
    screen music_room:
        textbutton _("Return") action Return()
        
    frame: #these positioning changes depending on your layout
        xpos 10
        ypos 10
        xmargin .05
        yanchor 0
        ypadding 0

        has vbox:
            xalign .5
            yalign .5
            spacing 0
            

        # The buttons that play each track.  MUST CORRESPOND TO THE TRACK LIST ABOVE
        textbutton "4th String Quartet" action mr.Play("music/4th String Quartet.mp3")
        textbutton "Adventure T Theme" action mr.Play("music/Adventure Time.mp3")
        textbutton "Asterik" action mr.Play("music/Asterisk Bleach.mp3")
        textbutton "Can Do" action mr.Play("music/Can Do Kuroko No Basket.mp3")
        textbutton "Death Note Theme" action mr.Play("music/Death Note.mp3")
        textbutton "Fruits Basket Theme" action mr.Play("music/Fruits Basket.mp3")
        textbutton "Gotta Go Fast" action mr.Play("music/Gotta Go Fast Sonic X.mp3")
        textbutton "Hatafutte Parade" action mr.Play("music/Hatafutte Parade.mp3")
        textbutton "I Will" action mr.Play("music/I Will Fullmetal Alchemist.mp3")
        textbutton "Let Me Be With You" action mr.Play("music/Let Me Be With You Chobits.mp3")
        textbutton "Monochrome No Kiss" action mr.Play("music/Monochrome No Kiss Black Butler.mp3")
        textbutton "Pokémon Theme" action mr.Play("music/Pokemon.mp3")
        textbutton "Rage On" action mr.Play("music/Rage On Free.mp3")
        textbutton "Resonance" action mr.Play("music/Resonance Soul Eater.mp3")
        textbutton "Sakura Kiss" action mr.Play("music/Sakura Kiss Ouran High.mp3")
        textbutton "Snow Fairy" action mr.Play("music/Snow Fairy Fairy Tail.mp3")
        textbutton "Super Drive" action mr.Play("music/Glaring Dream Gravitation.mp3")
        textbutton "The Orphans" action mr.Play("music/The Orphans.mp3")

    frame:
        xpos 500
        ypos 535
        has hbox:
            xalign 0.98
            yalign 0.98
        
        # Buttons that let us advance tracks.
        textbutton "<<" action mr.Previous()
        textbutton "II" action mr.Stop()
        textbutton ">>" action mr.Next()

    # Start the music playing on entry to the music room.
    on "replace" action mr.Play()

    # Restore the main menu music upon leaving.
    on "replaced" action Play("music", "music/Bright wish.mp3")
    
    imagemap:
        ground "frame.png"
        hover "frame1.png"
        
        hotspot (480, 280, 140, 40) action [ Play("4th String Quartet", "TZB.png"), Show("music_info", info="TZB.png") ]
        hotspot (480, 320, 140, 40) action [ Play("Adventure T Theme", "title.jpg"), Show("music_info", info="title.jpg") ]
        hotspot (480, 280, 140, 40) action [ Play("Asterik", "971606931.jpg"), Show("music_info", info="971606931.jpg") ]
        hotspot (480, 320, 140, 40) action [ Play("Can Do", "KnB.jpg"), Show("music_info", info="KnB.jpg") ]
        hotspot (480, 280, 140, 40) action [ Play("Death Note Theme", "DN.png"), Show("music_info", info="DN.png") ]
        hotspot (480, 320, 140, 40) action [ Play("Fruits Basket Theme", "6865467.jpg"), Show("music_info", info="6865467.jpg") ]
        hotspot (480, 280, 140, 40) action [ Play("Gotta Go Fast", "Sonic.jpg"), Show("music_info", info="Sonic.jpg") ]
        hotspot (480, 320, 140, 40) action [ Play("Hatafutte Parade", "1.jpg"), Show("music_info", info="1.jpg") ]
        hotspot (480, 280, 140, 40) action [ Play("I Will", "cover_I.jpg"), Show("music_info", info="cover_I.jpg") ]
        hotspot (480, 320, 140, 40) action [ Play("Let Me Be With You", "chobits.jpg"), Show("music_info", info="chobits.jpg") ]
        hotspot (480, 280, 140, 40) action [ Play("Monochrome No Kiss", "BB.jpg"), Show("music_info", info="BB.jpg") ]
        hotspot (480, 320, 140, 40) action [ Play("Pokémon Theme", "P.png"), Show("music_info", info="P.png") ]
        hotspot (480, 280, 140, 40) action [ Play("Rage On", "F.jpg"), Show("music_info", info="F.jpg") ]
        hotspot (480, 320, 140, 40) action [ Play("Resonance", "17.jpg"), Show("music_info", info="17.jpg") ]
        hotspot (480, 280, 140, 40) action [ Play("Sakura Kiss", "OH.jpg"), Show("music_info", info="OH.jpg") ]
        hotspot (480, 320, 140, 40) action [ Play("Snow Fairy", "cover.jpg"), Show("music_info", info="cover.jpg") ]
        hotspot (480, 280, 140, 40) action [ Play("Super Drive", "download.jpg"), Show("music_info", info="download.jpg") ]
        hotspot (480, 320, 140, 40) action [ Play("The Orphans", "To.png"), Show("music_info", info="To.png") ]        
        hotspot (480, 360, 140, 40) action [ Stop("music"), Hide("music_info") ]
        hotspot (480, 400, 140, 40) action Return()

    screen music_info:
        zorder 1
        add info xpos 40 ypos 40

    label music_room:
        call screen music_room
        return
The 'screens.rpy'

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Music Room Error

#4 Post by Alex »

This part doesn't need to be indented

Code: Select all

    screen music_info:
        zorder 1
        add info xpos 40 ypos 40

    label music_room:
        call screen music_room
        return
change it to

Code: Select all

screen music_info:
    zorder 1
    add info xpos 40 ypos 40

label music_room:
    call screen music_room
    return
And you don't need additional imagemap to show images - just add this action into the list of actions for your musicroom buttons, like

Code: Select all

        # The buttons that play each track.  MUST CORRESPOND TO THE TRACK LIST ABOVE
        textbutton "4th String Quartet" action [mr.Play("music/4th String Quartet.mp3"), Show("music_info", info="TZB.png") ]

User avatar
TheOneAndOnly-K
Regular
Posts: 78
Joined: Mon Apr 07, 2014 10:33 am
Contact:

Re: Music Room Error

#5 Post by TheOneAndOnly-K »

Alex wrote:This part doesn't need to be indented

Code: Select all

    screen music_info:
        zorder 1
        add info xpos 40 ypos 40

    label music_room:
        call screen music_room
        return
change it to

Code: Select all

screen music_info:
    zorder 1
    add info xpos 40 ypos 40

label music_room:
    call screen music_room
    return
And you don't need additional imagemap to show images - just add this action into the list of actions for your musicroom buttons, like

Code: Select all

        # The buttons that play each track.  MUST CORRESPOND TO THE TRACK LIST ABOVE
        textbutton "4th String Quartet" action [mr.Play("music/4th String Quartet.mp3"), Show("music_info", info="TZB.png") ]
The error continues to occur. I'm unsure why. I changed everything over but it's still making the error...

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Music Room Error

#6 Post by Alex »

Here it is

Code: Select all

#Hey Renpy now I gotta make a player to play em...
screen music_room:

    tag menu
    window:
        style "gm_root"
        
    frame:
        style_group "gm_nav"
        size_group "mm"
        xpos 720
        ypos 580
        has vbox:
            xalign 0.98 
            yalign 0.98
            
    screen music_room:        <==== Delete this line !
        textbutton _("Return") action Return()

User avatar
TheOneAndOnly-K
Regular
Posts: 78
Joined: Mon Apr 07, 2014 10:33 am
Contact:

Re: Music Room Error

#7 Post by TheOneAndOnly-K »

The error has stopped! Hooray!

But now the 'return' button has the

Code: Select all

textbutton _("Return") action Return()
as a problem ;-;

User avatar
TheOneAndOnly-K
Regular
Posts: 78
Joined: Mon Apr 07, 2014 10:33 am
Contact:

Re: Music Room Error

#8 Post by TheOneAndOnly-K »

Code: Select all

I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


File "game/screens.rpy", line 809: expected statement.
    textbutton _("Return") action Return()
                ^

Ren'Py Version: Ren'Py 6.17.4.409
Error in full script

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Music Room Error

#9 Post by Alex »

Hm, check the indentation, 'cause this is the script that worked for me

Code: Select all

#Hey Renpy now I gotta make a player to play em...
screen music_room:

    tag menu
    window:
        style "gm_root"
        
    frame:
        style_group "gm_nav"
        size_group "mm"
        xpos 720
        ypos 580
        has vbox:
            xalign 0.98 
            yalign 0.98
            

        textbutton _("Return") action Return()
        
    frame: #these positioning changes depending on your layout
        xpos 10
        ypos 10
        xmargin .05
        yanchor 0
        ypadding 0

        has vbox:
            xalign .5
            yalign .5
            spacing 0
            

        # The buttons that play each track.  MUST CORRESPOND TO THE TRACK LIST ABOVE
        textbutton "4th String Quartet" action mr.Play("music/4th String Quartet.mp3")

User avatar
TheOneAndOnly-K
Regular
Posts: 78
Joined: Mon Apr 07, 2014 10:33 am
Contact:

Re: Music Room Error

#10 Post by TheOneAndOnly-K »

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "renpy/common/_layout/screen_main_menu.rpym", line 29, in script
  File "game/screens.rpy", line 785, in python
  File "renpy/common/00action_audio.rpy", line 45, in python
  File "renpy/common/00action_audio.rpy", line 52, in python
Exception: Audio channel '4th String Quartet' is unknown.

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

Full traceback:
  File "C:\Users\Mam\Downloads\Fish\Renpy\renpy\execution.py", line 294, in run
    node.execute()
  File "C:\Users\Mam\Downloads\Fish\Renpy\renpy\ast.py", line 732, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "C:\Users\Mam\Downloads\Fish\Renpy\renpy\python.py", line 1382, in py_exec_bytecode
    exec bytecode in globals, locals
  File "renpy/common/_layout/screen_main_menu.rpym", line 29, in <module>
    $ ui.interact()
  File "C:\Users\Mam\Downloads\Fish\Renpy\renpy\ui.py", line 237, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "C:\Users\Mam\Downloads\Fish\Renpy\renpy\display\core.py", line 2059, in interact
    scene_lists.replace_transient()
  File "C:\Users\Mam\Downloads\Fish\Renpy\renpy\display\core.py", line 577, in replace_transient
    self.remove(layer, tag)
  File "C:\Users\Mam\Downloads\Fish\Renpy\renpy\display\core.py", line 851, in remove
    self.hide_or_replace(layer, remove_index, "hide")
  File "C:\Users\Mam\Downloads\Fish\Renpy\renpy\display\core.py", line 775, in hide_or_replace
    d = oldsle.displayable._hide(now - st, now - at, prefix)
  File "C:\Users\Mam\Downloads\Fish\Renpy\renpy\display\screen.py", line 189, in _hide
    hid.update()
  File "C:\Users\Mam\Downloads\Fish\Renpy\renpy\display\screen.py", line 270, in update
    self.screen.function(**self.scope)
  File "C:\Users\Mam\Downloads\Fish\Renpy\renpy\screenlang.py", line 1236, in __call__
    renpy.python.py_exec_bytecode(self.code.bytecode, locals=scope)
  File "C:\Users\Mam\Downloads\Fish\Renpy\renpy\python.py", line 1382, in py_exec_bytecode
    exec bytecode in globals, locals
  File "game/screens.rpy", line 785, in <module>
    hotspot (480, 280, 140, 40) action [ Play("4th String Quartet", "TZB.png"), Show("music_info", info="TZB.png") ]
  File "renpy/common/00action_audio.rpy", line 45, in __init__
    self.selected = self.get_selected()
  File "renpy/common/00action_audio.rpy", line 52, in get_selected
    return renpy.music.get_playing(self.channel) == self.file
  File "C:\Users\Mam\Downloads\Fish\Renpy\renpy\audio\music.py", line 291, in get_playing
    c = renpy.audio.audio.get_channel(channel)
  File "C:\Users\Mam\Downloads\Fish\Renpy\renpy\audio\audio.py", line 758, in get_channel
    raise Exception("Audio channel %r is unknown." % name)
Exception: Audio channel '4th String Quartet' is unknown.

Windows-7-6.1.7601-SP1
Ren'Py 6.17.4.409

User avatar
chocojax
Miko-Class Veteran
Posts: 705
Joined: Sun Oct 25, 2009 11:27 am
Projects: Umbra, Familiarity, Maleficent Justice
Tumblr: chocojax
Location: California
Contact:

Re: Music Room Error

#11 Post by chocojax »

Lines like this:

Code: Select all

    hotspot (480, 280, 140, 40) action [ Play("4th String Quartet", "TZB.png"), Show("music_info", info="TZB.png") ]
Should be looking like what Alex did:

Code: Select all

        textbutton "4th String Quartet" action mr.Play("music/4th String Quartet.mp3")
## hotspot ( 1, 2, 3, 4 ) action [ Play("pathfile/name.mp3") , ... ]

User avatar
TheOneAndOnly-K
Regular
Posts: 78
Joined: Mon Apr 07, 2014 10:33 am
Contact:

Re: Music Room Error

#12 Post by TheOneAndOnly-K »

I've fixed it like you've suggested, but the error continues.

User avatar
OokamiKasumi
Eileen-Class Veteran
Posts: 1779
Joined: Thu Oct 14, 2010 3:53 am
Completed: 14 games released -- and Counting.
Organization: DarkErotica Games
Deviantart: OokamiKasumi
Location: NC, USA
Contact:

Re: Music Room Error

#13 Post by OokamiKasumi »

Why do you have hotspot links AND textbutton links?
-- You should one or the other, Not Both.
Ookami Kasumi ~ Purveyor of fine Smut.
Most recent Games Completed: For ALL my completed games visit: DarkErotica Games

"No amount of great animation will save a bad story." -- John Lasseter of Pixar

User avatar
TheOneAndOnly-K
Regular
Posts: 78
Joined: Mon Apr 07, 2014 10:33 am
Contact:

Re: Music Room Error

#14 Post by TheOneAndOnly-K »

I wanted an image of the CD cover and the song choice in text to the side.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], fufuffiero