Page 1 of 1

ValueError (solved)

Posted: Sat Nov 22, 2014 9:32 pm
by meiri
I'm trying to make a screen with a couple of buttons that simply play a sound when you press them.

Code: Select all

screen r:
    add "#FFBCD6"
    text "Rhythm Game" xalign 0.5 yalign 0.05 color "#921F4B"
    text "Level: [level]" xalign 0.3 yalign 0.05 color" #921F4B"
    
    textbutton "E3" action Play("sound", bsound1)
    textbutton "E4" action Play("sound", bsound2)
    textbutton "D4" action Play("sound", bsound3)
bsound 1, 2, and 3, are simply variables:

Code: Select all

    $ bsound1 = "E3.mp3"
    $ bsound2 = "E4.mp3"
    $ bsound3 = "D4.mp3"
I also defined music channel "sound" here:

Code: Select all

$ renpy.music.register_channel("sound")
Later, I simply try to call the screen:

Code: Select all

label game:
    
    $ renpy.call_screen("r")
With which I get the ValueError traceback above:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While processing the color property of anonymous style:
  File "game/script.rpy", line 51, in script
    $ renpy.call_screen("r")
  File "game/script.rpy", line 51, in <module>
    $ renpy.call_screen("r")
ValueError: invalid literal for int() with base 16: '#'
I've got the full traceback available here.

Thanks to anyone who can help (I don't have the slightest idea as to why this keeps coming up). Of course, let me know if there's some bit of the code I may have left out here which would help.[/s]

Nevermind, I've figured it out. Simply a badly misplaced quotation mark for a string.