[SOLVED] Could not find label "start"—but it *does* exist!

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
Kaji
Regular
Posts: 87
Joined: Thu Nov 17, 2022 10:17 pm
Github: Kaji01
Discord: Kaji#7767
Contact:

[SOLVED] Could not find label "start"—but it *does* exist!

#1 Post by Kaji »

Did my first export of my app so I could send it out to some friends for testing, and when I tried running the Mac version of the app I got the following error:
I'm sorry, but an uncaught exception occurred.

While running game code:
File "renpy/common/00start.rpy", line 287, in script
python:
ScriptError: could not find label 'start'.

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

Full traceback:
File "/Applications/XAMPP/xamppfiles/htdocs/RenPyProjects/Rakugo-1.0-dists/Rakugo-1.0-mac/Rakugo.app/Contents/Resources/autorun/renpy/bootstrap.py", line 277, in bootstrap
renpy.main.main()
File "/Applications/XAMPP/xamppfiles/htdocs/RenPyProjects/Rakugo-1.0-dists/Rakugo-1.0-mac/Rakugo.app/Contents/Resources/autorun/renpy/main.py", line 660, in main
run(restart)
File "/Applications/XAMPP/xamppfiles/htdocs/RenPyProjects/Rakugo-1.0-dists/Rakugo-1.0-mac/Rakugo.app/Contents/Resources/autorun/renpy/main.py", line 146, in run
renpy.execution.run_context(True)
File "/Applications/XAMPP/xamppfiles/htdocs/RenPyProjects/Rakugo-1.0-dists/Rakugo-1.0-mac/Rakugo.app/Contents/Resources/autorun/renpy/execution.py", line 938, in run_context
context.run()
File "renpy/common/00start.rpy", line 287, in script
python:
File "/Applications/XAMPP/xamppfiles/htdocs/RenPyProjects/Rakugo-1.0-dists/Rakugo-1.0-mac/Rakugo.app/Contents/Resources/autorun/renpy/script.py", line 927, in lookup
raise ScriptError("could not find label '%s'." % str(original))
ScriptError: could not find label 'start'.

macOS-10.16-x86_64-i386-64bit x86_64
Ren'Py 8.0.3.22090809

Mon Nov 21 09:21:42 2022
There's only one "start" label in the program, in script.rpy, where it was put initially when the project was first set up. Granted, at present it's been reduced to just a jump command to the actual start of the script that I have elsewhere for organizational purposes, but I've gone back and verified that it has not been deleted.

Did I miss something when doing the export, or is there something else that could have caused it to forget that it has a "start" label?
Last edited by Kaji on Sun Nov 27, 2022 4:04 pm, edited 1 time in total.

User avatar
Tess
Regular
Posts: 59
Joined: Thu Aug 04, 2022 3:43 pm
Projects: The Songbird Guild
Organization: Yurisoft
Github: wainwt2
Discord: Tess#7782
Contact:

Re: Could not find label "start"—but it *does* exist!

#2 Post by Tess »

Maybe try force recompiling and then exporting again?
Ren'Py searches its rpyc files for labels, not the rpy files, so sometimes if the rpyc file hasn't been updated with the info in its respective rpy file, it'll give weird errors. Force recompile will tell Ren'Py to rebuild those rpycs.

User avatar
Kaji
Regular
Posts: 87
Joined: Thu Nov 17, 2022 10:17 pm
Github: Kaji01
Discord: Kaji#7767
Contact:

Re: Could not find label "start"—but it *does* exist!

#3 Post by Kaji »

Just reviewed things and it was force-recompiled the first time. To take it a step further I went and deleted l .rpyc and .rpymc files from the project and repeated the export—still nothing. Also was able to confirm that the PC export is doing the same thing.

Here is the entire contents of my script.rpy file at the moment:

Code: Select all

# The script of the game goes in this file.

# Declare characters used by this game. The color argument colorizes the
# name of the character.

# The game starts here.

label start:

    # Show a background. This uses a placeholder by default, but you can
    # add a file (named either "bg room.png" or "bg room.jpg") to the
    # images directory to show it.

#    scene bg stage

#    show npc1 w

#    "emote test"

    # This shows a character sprite. A placeholder is used, but you can
    # replace it by adding a file named "eileen happy.png" to the images
    # directory.

#    show sensei at bounce, left

#    show npc1 r at right # Hachigoro
#    show npc2 p blush embarrassed vein # Mom

    # These display lines of dialogue.

#    show sensei at invisible
#    sensei "The main menu for the game will go here."

#    show npc1 extreme_shock blush teardrop

#    show sensei at visible
#    sensei "In the meantime, enjoy Jugemu!"

#    jump jugemu_start
#    jump test_script_start
#    jump dumb_programmer_start
#    jump effects_test_start
#    jump tairabayashi_start
    jump binbougami_start

    # This ends the game.
    
    return

# Additional script files are automatically detected and included
# e.g. the label 'jugemu_start' that we jump to above is in jugemu.rpy

# Create separate files for each script to keep things grouped logically and prevent them from getting out of hand in one massive file
Again, this runs properly from the launcher, and even after deleting all the files mentioned above it ran without issue. Not sure where else to look offhand.

Is it possible that Python's just misinterpreting where the block ends and is ignoring it as an empty block or something?

enaielei
Veteran
Posts: 293
Joined: Fri Sep 17, 2021 2:09 am
Organization: enaielei
Tumblr: enaielei
Deviantart: enaielei
Github: enaielei
Skype: enaielei
Soundcloud: enaielei
itch: enaielei
Discord: enaielei#7487
Contact:

Re: Could not find label "start"—but it *does* exist!

#4 Post by enaielei »

The traceback that you provided.
chrome_06gAlfPba2.png
(5.11 KiB) Not downloaded yet
It says here that the script file is in .py format. Ren'Py scripts ends with .rpy extension and not with .py.

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2400
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Could not find label "start"—but it *does* exist!

#5 Post by Ocelot »

enaielei wrote: Tue Nov 22, 2022 4:22 am The traceback that you provided.

It says here that the script file is in .py format. Ren'Py scripts ends with .rpy extension and not with .py.
script.py is RenPy internal file responsible for loading and executing game script.
< < insert Rick Cook quote here > >

User avatar
Kaji
Regular
Posts: 87
Joined: Thu Nov 17, 2022 10:17 pm
Github: Kaji01
Discord: Kaji#7767
Contact:

Re: Could not find label "start"—but it *does* exist!

#6 Post by Kaji »

Ocelot wrote: Tue Nov 22, 2022 5:15 am
enaielei wrote: Tue Nov 22, 2022 4:22 am The traceback that you provided.

It says here that the script file is in .py format. Ren'Py scripts ends with .rpy extension and not with .py.
script.py is RenPy internal file responsible for loading and executing game script.
This. The traceback is being provided by the compiled app, which is why it's reporting from a .py file instead of .rpy. The question is why it's clearly ignoring the Start label in the .rpy code, even though it's present and works fine from the Launcher.

User avatar
Kaji
Regular
Posts: 87
Joined: Thu Nov 17, 2022 10:17 pm
Github: Kaji01
Discord: Kaji#7767
Contact:

Re: Could not find label "start"—but it *does* exist!

#7 Post by Kaji »

Digging into things, here's the relevant bits from the code per the traceback—I'm attaching the entire 00start.rpy file in case anyone wants to inspect it as well.

First off, it should be noted that on Line 187 there is a _start: label:

Code: Select all

    jump expression "splashscreen"


# This is the true starting point of the program. Sssh... Don't
# tell anyone.
label _start:

    if config.early_start_store:
        call _start_store

    python:
        renpy.execute_default_statement(True)
The traceback, on the other hand, invokes Line 287 which is the start of the second python block in _invoke_main_menu::

Code: Select all

label _invoke_main_menu:

    # Again, this has to be Python.
    python:
        if _restart:
            renpy.call_in_new_context(_restart[2])
        elif not renpy.os.environ.get("RENPY_SKIP_MAIN_MENU", False):
            renpy.call_in_new_context("_main_menu")


    # If the main menu returns, then start the game.

    python:
        renpy.game.context().force_checkpoint = True
        renpy.jump("start")
Just to see what would happen, I decided to add in the start label manually, as follows:

Code: Select all

label start:
    python:
        renpy.jump("binbougami_start")
This shifted the problem forward; now it claims that the label to start the specific story I was going to send it into doesn't exist.
Attachments
00start.rpy
00start.rpy file from after building the app
(9.07 KiB) Downloaded 52 times

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2400
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Could not find label "start"—but it *does* exist!

#8 Post by Ocelot »

Your script files are not getting bundled into built app. This is the only sensible explanation.
< < insert Rick Cook quote here > >

User avatar
Kaji
Regular
Posts: 87
Joined: Thu Nov 17, 2022 10:17 pm
Github: Kaji01
Discord: Kaji#7767
Contact:

Re: Could not find label "start"—but it *does* exist!

#9 Post by Kaji »

That would appear to be the case, but...why? For organizational purposes I have them in a /scripts folder inside of /game, but from what I've seen in the documentation it should detect that automatically, and it does so when run from the Launcher. It also doesn't explain why start: is missing, since that's still located inside of the default script.rpy file from when the project was first built.

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2400
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Could not find label "start"—but it *does* exist!

#10 Post by Ocelot »

Check Contents\Resources\autorun\game inside .app file and look if script files are there. Also check build classification within game, you could set to do something strange with rpy files accidentally.
< < insert Rick Cook quote here > >

User avatar
Kaji
Regular
Posts: 87
Joined: Thu Nov 17, 2022 10:17 pm
Github: Kaji01
Discord: Kaji#7767
Contact:

Re: Could not find label "start"—but it *does* exist!

#11 Post by Kaji »

The files are there and the labels are present. Not sure how to check the build classification (unless you mean which platforms were selected, in which case I left it with the default PC and Mac choices); let me know what to look at and I'll verify that point.

User avatar
Tess
Regular
Posts: 59
Joined: Thu Aug 04, 2022 3:43 pm
Projects: The Songbird Guild
Organization: Yurisoft
Github: wainwt2
Discord: Tess#7782
Contact:

Re: Could not find label "start"—but it *does* exist!

#12 Post by Tess »

I think they're asking you to make sure you don't have one of these statements that would be excluding the files from the build: https://www.renpy.org/doc/html/build.ht ... ring-files

If the files are there though, I think you might be good on that front. Are you building this on a Mac or are you building it on something else then bringing the build to a Mac? (idk if that makes a difference but it's worth a shot.)

User avatar
Kaji
Regular
Posts: 87
Joined: Thu Nov 17, 2022 10:17 pm
Github: Kaji01
Discord: Kaji#7767
Contact:

Re: Could not find label "start"—but it *does* exist!

#13 Post by Kaji »

Tess wrote: Wed Nov 23, 2022 4:07 pm I think they're asking you to make sure you don't have one of these statements that would be excluding the files from the build: https://www.renpy.org/doc/html/build.ht ... ring-files

If the files are there though, I think you might be good on that front. Are you building this on a Mac or are you building it on something else then bringing the build to a Mac? (idk if that makes a difference but it's worth a shot.)
Ah, thanks! Yeah, nothing like that in my code that I'm aware of. Building on an M1 Mac running Ventura—outside chance that it could be because it's not an Intel Mac, perhaps?

User avatar
Kaji
Regular
Posts: 87
Joined: Thu Nov 17, 2022 10:17 pm
Github: Kaji01
Discord: Kaji#7767
Contact:

Re: Could not find label "start"—but it *does* exist!

#14 Post by Kaji »

So just to provide something of an update, I've been sitting down starting with a brand new project and exporting builds every step of the way as I copy code over from the project having the issue. By this point I've moved virtually everything over and there hasn't been any issue running the built applications; it's still finding start just fine, and the script.rpy file from the original project ran without any modifications whatsoever (only thing I changed was the config.name and build.name of the project at the top of options.rpy so that it would build into a separate directory and could be told apart if needed).

All I can guess at this point is that something got corrupted in the original project somehow? Next step from here will probably be a directory swap putting the new files where the old ones resided and seeing if it still works (since I'd rather my working project be properly named, instead of just "ExportTest"...).

User avatar
Kaji
Regular
Posts: 87
Joined: Thu Nov 17, 2022 10:17 pm
Github: Kaji01
Discord: Kaji#7767
Contact:

Re: Could not find label "start"—but it *does* exist!

#15 Post by Kaji »

...OK, the files all build properly before renaming the directory, but renaming the old folder to "rakugo_bak" and renaming the ExportTest to "Rakugo" then force rebuilding gets the same error.

Does it simply hate my directory name for some reason?

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]