Annoying/inconsequental error at the start of every game

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.
Message
Author
User avatar
chesarty
Regular
Posts: 116
Joined: Sat Aug 25, 2018 3:07 am
Completed: 0
Contact:

Annoying/inconsequental error at the start of every game

#1 Post by chesarty »

(I'm just really spamming this forum today, aren't I?)

EDIT: after postin this, i realized my quickmenu no longer works even though i literally haven't touched it at all. dunno if it has something to do with this error.

I implemented a "Continue" button into my main menu using some cookbook code and for te most part it's working great. The button itself functions correctly, but a couple hours after I implemented the code, Ren'Py gives me this error message every time I click "New game" or "Continue".

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "renpy/common/00start.rpy", line 301, in script call
    call expression "before_main_menu"
  File "game/script.rpy", line 68, in script
    call screen confirm (message = u "Are you sure you want to restart the game?", yes_action = Start (), no_action = Jump ("main_menu"))
  File "renpy/common/000statements.rpy", line 526, in execute_call_screen
    args, kwargs = a.evaluate()
SyntaxError: invalid syntax (game/script.rpy, line 68)

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

Full traceback:
  File "renpy/common/00start.rpy", line 301, in script call
    call expression "before_main_menu"
  File "game/script.rpy", line 68, in script
    call screen confirm (message = u "Are you sure you want to restart the game?", yes_action = Start (), no_action = Jump ("main_menu"))
  File "C:\Users\chesw\Documents\renpy-7.3.2-sdk\renpy\ast.py", line 1947, in execute
    self.call("execute")
  File "C:\Users\chesw\Documents\renpy-7.3.2-sdk\renpy\ast.py", line 1935, in call
    return renpy.statements.call(method, parsed, *args, **kwargs)
  File "C:\Users\chesw\Documents\renpy-7.3.2-sdk\renpy\statements.py", line 277, in call
    return method(parsed, *args, **kwargs)
  File "renpy/common/000statements.rpy", line 526, in execute_call_screen
    args, kwargs = a.evaluate()
  File "C:\Users\chesw\Documents\renpy-7.3.2-sdk\renpy\ast.py", line 188, in evaluate
    kwargs[k] = renpy.python.py_eval(v, locals=scope)
  File "C:\Users\chesw\Documents\renpy-7.3.2-sdk\renpy\python.py", line 2033, in py_eval
    code = py_compile(code, 'eval')
  File "C:\Users\chesw\Documents\renpy-7.3.2-sdk\renpy\python.py", line 690, in py_compile
    raise e
SyntaxError: invalid syntax (game/script.rpy, line 68)

Windows-8-6.2.9200
Ren'Py 7.3.2.320
Lovesick 1.0
Wed Aug 21 21:25:23 2019
If I ignore the error message, the game continues normally so I don't understand what it's trying to tell me. Here's my code for the Continue button in my script.rpy file:

Code: Select all

label main_menu:
    call screen main_menu
label restart:
    call screen confirm (message = u "Are you sure you want to restart the game?", yes_action = Start (), no_action = Jump ("main_menu"))
### Auto-save activation:
init -1 python hide:
    config.has_autosave = True
init +1 python:
    class LoadMostRecent():

        def __init__(self):
            self.slot = renpy.newest_slot()

        def __call__(self):
            renpy.load(self.slot)

        def get_sensitive(self):
            return self.slot is not None
Is there something wrong with it? I also noticed my game has begun lagging quite a bit which is very annoying and it only started today after I implemented the continue button as well as a custom cursor for the game (I'm not sure which one of them is causing the lag, though?)
This is very annoying and takes up a lot of my time since I can't easily reload my game without getting the error. Has anyone had anything similar?

User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: Annoying/inconsequental error at the start of every game

#2 Post by namastaii »

Seems the cookbook code isn't very compatible and probably interferes with functions engrained into renpy

User avatar
chesarty
Regular
Posts: 116
Joined: Sat Aug 25, 2018 3:07 am
Completed: 0
Contact:

Re: Annoying/inconsequental error at the start of every game

#3 Post by chesarty »

namastaii wrote: Wed Aug 21, 2019 7:07 pm Seems the cookbook code isn't very compatible and probably interferes with functions engrained into renpy
i wonder if there is a more updated version to this... to me, the continue button seems pretty important so i dont wanna just drop it :(

User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: Annoying/inconsequental error at the start of every game

#4 Post by namastaii »

What is the purpose of this button exactly?

User avatar
isobellesophia
Miko-Class Veteran
Posts: 979
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

Re: Annoying/inconsequental error at the start of every game

#5 Post by isobellesophia »

You can tell what exactly the purpose of that code, there might be something that can be renew again.
I am a friendly user, please respect and have a good day.


Image

Image


User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: Annoying/inconsequental error at the start of every game

#6 Post by namastaii »

Try removing the space between start and () and jump ()

User avatar
chesarty
Regular
Posts: 116
Joined: Sat Aug 25, 2018 3:07 am
Completed: 0
Contact:

Re: Annoying/inconsequental error at the start of every game

#7 Post by chesarty »

namastaii wrote: Wed Aug 21, 2019 9:30 pm What is the purpose of this button exactly?
instead of having to choose a save file every time you want to continue a play session after closing the game, it picks up an autosave and continues from where you left off. pretty nifty! if it worked, that is

User avatar
IrinaLazareva
Veteran
Posts: 399
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy
Organization: SunShI
Location: St.Petersburg, Russia
Contact:

Re: Annoying/inconsequental error at the start of every game

#8 Post by IrinaLazareva »

chesarty wrote: Thu Aug 22, 2019 12:27 am
namastaii wrote: Wed Aug 21, 2019 9:30 pm What is the purpose of this button exactly?
instead of having to choose a save file every time you want to continue a play session after closing the game, it picks up an autosave and continues from where you left off. pretty nifty! if it worked, that is
viewtopic.php?t=34420#p388783

User avatar
isobellesophia
Miko-Class Veteran
Posts: 979
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

Re: Annoying/inconsequental error at the start of every game

#9 Post by isobellesophia »

Oh, there is also a another example if it is works for you.

viewtopic.php?f=51&t=48154

I dont think it looks the same, but you can try it.
I am a friendly user, please respect and have a good day.


Image

Image


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

Re: Annoying/inconsequental error at the start of every game

#10 Post by Imperf3kt »

I currently just do this for a continue button. It works perfectly.


In your screen:

Code: Select all

    $recent_save = renpy.newest_slot(r"\d+")

    fixed:
        xpos 1450
        ypos 100
        
        if recent_save:
            $ recent_save_page, recent_save_name = recent_save.split("-")
            imagebutton:
                auto "gui/buttons/continue_%s.png"
                action FileLoad(recent_save_name, confirm=True, page=recent_save_page)
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
chesarty
Regular
Posts: 116
Joined: Sat Aug 25, 2018 3:07 am
Completed: 0
Contact:

Re: Annoying/inconsequental error at the start of every game

#11 Post by chesarty »

namastaii wrote: Wed Aug 21, 2019 11:33 pm Try removing the space between start and () and jump ()
Omg that actually fixed it. :D thank you sm!

EDIT: nevermind… it seems to have been a one-time fix and now it's erroring again :(

User avatar
chesarty
Regular
Posts: 116
Joined: Sat Aug 25, 2018 3:07 am
Completed: 0
Contact:

Re: Annoying/inconsequental error at the start of every game

#12 Post by chesarty »

isobellesophia wrote: Thu Aug 22, 2019 7:19 am Oh, there is also a another example if it is works for you.

viewtopic.php?f=51&t=48154

I dont think it looks the same, but you can try it.
I'm using that exact tutorial. Neither of the codes work for me :(

User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: Annoying/inconsequental error at the start of every game

#13 Post by namastaii »

What's the current error code now

User avatar
chesarty
Regular
Posts: 116
Joined: Sat Aug 25, 2018 3:07 am
Completed: 0
Contact:

Re: Annoying/inconsequental error at the start of every game

#14 Post by chesarty »

namastaii wrote: Thu Aug 22, 2019 11:10 pm What's the current error code now

Code: Select all

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


File "game/script.rpy", line 73: is not terminated with a newline. (Check strings and parenthesis.)
        call screen confirm(message = u "Are you sure you want to start over?", yes_action = Start(), no_action = Jump("main_menu")

Ren'Py Version: Ren'Py 7.3.2.320
Fri Aug 23 06:45:16 2019

Here's my code on that one specific line:

Code: Select all

call screen confirm(message = u "Are you sure you want to start over?", yes_action = Start(), no_action = Jump("main_menu")
EDIT: i added a ) at the end of the line and now the error is back to the invalid syntax stuff.

User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: Annoying/inconsequental error at the start of every game

#15 Post by namastaii »

Yes it was missing another ) to close off the beginning (

Syntax for which code
Show the new error

Post Reply

Who is online

Users browsing this forum: Exiscoming, Semrush [Bot]