[Coding help] Issue with screens.rpy?

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
riribelle
Newbie
Posts: 9
Joined: Wed May 27, 2015 5:32 pm
Completed: The Summer Princess and The Winter Princess
Projects: Dreamchasers: Aphelion, Blossoming ❀ Love
Organization: Krispy Cat, Tiara Change Me Games
Tumblr: starryflan
Deviantart: riribelle
Skype: riynashay
Location: Not here, there
Contact:

[Coding help] Issue with screens.rpy?

#1 Post by riribelle »

So I was trying to launch my game and all of a sudden I got a weird traceback file:

Code: Select all

Full traceback:
  File "C:\Users\Cathy\Documents\renpy-6.99.1-sdk\renpy\bootstrap.py", line 281, in bootstrap
    renpy.main.main()
  File "C:\Users\Cathy\Documents\renpy-6.99.1-sdk\renpy\main.py", line 466, in main
    run(restart)
  File "C:\Users\Cathy\Documents\renpy-6.99.1-sdk\renpy\main.py", line 83, in run
    renpy.display.screen.prepare_screens()
  File "C:\Users\Cathy\Documents\renpy-6.99.1-sdk\renpy\display\screen.py", line 827, in prepare_screens
    s.ast.prepare_screen()
  File "game/screens.rpy", line 345, in prepare_screen
    screen preferences():
  File "game/screens.rpy", line 345, in prepare
    screen preferences():
  File "game/screens.rpy", line 353, in prepare
    grid 3 1:
  File "game/screens.rpy", line 353, in prepare
    grid 3 1:
  File "game/screens.rpy", line 358, in prepare
    vbox:
  File "game/screens.rpy", line 358, in prepare
    vbox:
  File "game/screens.rpy", line 359, in prepare
    frame:
  File "game/screens.rpy", line 359, in prepare
    frame:
  File "game/screens.rpy", line 361, in prepare
    has vbox
  File "game/screens.rpy", line 361, in prepare
    has vbox
  File "game/screens.rpy", line 364, in prepare
    textbutton _("Window") action Preference("display", "window")
  File "game/screens.rpy", line 364, in prepare
    textbutton _("Window") action Preference("display", "window")
  File "C:\Users\Cathy\Documents\renpy-6.99.1-sdk\renpy\python.py", line 1472, in py_eval_bytecode
    return eval(bytecode, globals, locals)
  File "<screen language>", line 364, in <module>
  File "renpy/common/00preferences.rpy", line 345, in Preference
    rv = get()
  File "renpy/common/00preferences.rpy", line 167, in get
    return __DisplayAction(1.0)
  File "renpy/common/00preferences.rpy", line 27, in __init__
    self.width = int(factor * config.screen_width)
  File "C:\Users\Cathy\Documents\renpy-6.99.1-sdk\renpy\character.py", line 766, in __call__
    raise Exception("Character expects its what argument to be a string, got %r." % (what,))
Exception: Character expects its what argument to be a string, got 1024.0.
The thing is, I haven't really messed with the screens file outside the two window variant, so I'm not really sure what all this code means outside "I don't want to run your game >BC". Um, help? ;___;

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: [Coding help] Issue with screens.rpy?

#2 Post by trooper6 »

Well, since you messed with the screens.rpy file, it would be useful for you to post the section of the code you messed with, inside of the code tags.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
riribelle
Newbie
Posts: 9
Joined: Wed May 27, 2015 5:32 pm
Completed: The Summer Princess and The Winter Princess
Projects: Dreamchasers: Aphelion, Blossoming ❀ Love
Organization: Krispy Cat, Tiara Change Me Games
Tumblr: starryflan
Deviantart: riribelle
Skype: riynashay
Location: Not here, there
Contact:

Re: [Coding help] Issue with screens.rpy?

#3 Post by riribelle »

See, that's the thing, I only did this:

Code: Select all


            # The two window variant.
        vbox:
            style "say_two_window_vbox"
            order_reverse True
            spacing -20
            
            
which is lines 32-36, and nowhere near the lines mentioned in the traceback....
Last edited by riribelle on Tue Sep 01, 2015 9:47 pm, edited 1 time in total.

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: [Coding help] Issue with screens.rpy?

#4 Post by trooper6 »

The traceback says there is a problem with the character's what argument.
could you post the whole say screen?
And maybe the character definition of the character that would be speaking if that might be a thing?
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
riribelle
Newbie
Posts: 9
Joined: Wed May 27, 2015 5:32 pm
Completed: The Summer Princess and The Winter Princess
Projects: Dreamchasers: Aphelion, Blossoming ❀ Love
Organization: Krispy Cat, Tiara Change Me Games
Tumblr: starryflan
Deviantart: riribelle
Skype: riynashay
Location: Not here, there
Contact:

Re: [Coding help] Issue with screens.rpy?

#5 Post by riribelle »

What the heckie, renpy, I went back to my script.rpy file to rename one of my defined characters (which was "int" for intercom) and changed it to "inte" and somehow that fixed it????

I don't understand.....

But the whole code is

Code: Select all

# Say
#
# Screen that's used to display adv-mode dialogue.
# http://www.renpy.org/doc/html/screen_special.html#say
screen say(who, what, side_image=None, two_window=True):

    # Decide if we want to use the one-window or two-window variant.
    if not two_window:

        # The one window variant.
        window:
            id "window"

            has vbox:
                style "say_vbox"

            if who:
                text who id "who"

            text what id "what"

    else:

        # The two window variant.
        vbox:
            style "say_two_window_vbox"
            order_reverse True
            spacing -20
            
            if who:
                window:
                    style "say_who_window"

                    text who:
                        id "who"

            window:
                id "window"

                has vbox:
                    style "say_vbox"

                text what id "what"

    # If there's a side image, display it above the text.
    if side_image:
        add side_image
    else:
        add SideImage() xalign 0.0 yalign 1.0

    # Use the quick menu.
    use quick_menu
and the lines in question were

Code: Select all

define int = Character('Intercom', ctc="ctc_blink", ctc_position="fixed", show_two_window=True)

int "Last stop!" with hpunch
which apparently broke the game until I renamed them "inte"????

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: [Coding help] Issue with screens.rpy?

#6 Post by trooper6 »

riribelle wrote:What the heckie, renpy, I went back to my script.rpy file to rename one of my defined characters (which was "int" for intercom) and changed it to "inte" and somehow that fixed it????

I don't understand.....
That was your problem. You can't name a character "int."
int is a reserved word (it is short for integer)
You can look at the list of reserved words here: http://www.renpy.org/doc/html/reserved.html

You can't name your character list or int or input or tuple or class or any other word that is reserved to mean something specific. It makes computer languages unhappy and confused.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

VorrAkkagi
Newbie
Posts: 22
Joined: Tue Dec 11, 2018 5:41 am
Contact:

Re: [Coding help] Issue with screens.rpy?

#7 Post by VorrAkkagi »

Aannnd over 3 years later, you've solved my problem as well trooper6. Thanks!!! =) This has killed 2 days of dev time!

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]