Grid Screen Error? "Uncaught Exception"

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
That Oyajicon
Regular
Posts: 33
Joined: Sun May 29, 2016 7:31 pm
Location: The Pillars of Nosgoth
Contact:

Grid Screen Error? "Uncaught Exception"

#1 Post by That Oyajicon » Thu Jan 31, 2019 11:37 pm

Okay, so I'm following this on screens:

Everything works great.

I get to the part where I'm supposed to make a grid, and I (as far as I can tell) copy the code exactly as written in the video (around 13:08):

Code: Select all


screen grid_screen(buttons):
    grid 2 len(buttons)/2+1:
        spacing 5
        xalign 0.6
        yalign 0.1
        for button in buttons:
            textbutton button:
                action Null
                text_size text_size
        for i in range(0, (len(buttons)/2 +1 ) * 2 - len(buttons)):
            null
In the script file, I type:

Code: Select all

	e "Once you add a story, pictures, and music, you can release it to the world!"

	hide screen vbox1_screen
	show screen grid_screen(numbers, 20)

	e "Yes?" 
And for some reason, I get the following error.
I'm sorry, but an uncaught exception occurred.

While running game code:
File "game/script.rpy", line 40, in script
e "Yes?"
Exception: Too many arguments in call (expected 1, got 2).
Could someone please help me fix this?

philat
Eileen-Class Veteran
Posts: 1853
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Grid Screen Error? "Uncaught Exception"

#2 Post by philat » Fri Feb 01, 2019 12:30 am

The error message is literally telling you what the problem is. (ETA: Please read this in a mild mannered way, it's not meant to be curt. I'm just tired rn so can't bother with more words for politeness.)

Exception: Too many arguments in call (expected 1, got 2).

Your definition:
screen grid_screen(buttons): # 1 argument

What you called:
show screen grid_screen(numbers, 20) # 2 arguments
Last edited by philat on Fri Feb 01, 2019 12:32 am, edited 1 time in total.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3636
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: Grid Screen Error? "Uncaught Exception"

#3 Post by Imperf3kt » Fri Feb 01, 2019 12:32 am

I think if you remove "numbers" it should work. Just leave "20" in there
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py

Post Reply

Who is online

Users browsing this forum: No registered users