ValueError (solved)

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
meiri
Regular
Posts: 177
Joined: Wed Jun 25, 2014 6:21 pm
Projects: Tutor Tabitha, Movement
Organization: Blue Bottlecap Games
Location: East Coast, US
Contact:

ValueError (solved)

#1 Post by meiri » Sat Nov 22, 2014 9:32 pm

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.
What's in a loop? A loop iterated in any other way would output as sweet.
--
Have a look at my GxG kinetic novel, Movement, if you have the chance?

Post Reply

Who is online

Users browsing this forum: Gushi, Majestic-12 [Bot]