Code Error (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
macaron
Regular
Posts: 31
Joined: Sat Mar 30, 2013 4:16 am
Contact:

Code Error (SOLVED)

#1 Post by macaron » Sun Jul 14, 2013 2:50 am

I'm following the tips for this site:
http://www.otome-games.com/index.php/ma ... l=&start=6

It says to make it easier to choices menu scene I could create a new file, scenes.rpy and I did but..
When I run the game it kept saying an exception has occurred and I'm not sure what I've did wrong because I follow everything from there.

While running game code:
File "game/script.rpy",line 30, in script call
File "game/script.rpy", line 30, in script call
ScriptError: could not find label 'day1'.

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

Full traceback:
File "C:\Users\ASUS\Downloads\renpy-6.15.2-sdk\renpy\execution.py", line 288, in run
node.execute()
File "C:\Users\ASUS\Downloads\renpy-6.15.2-sdk\renpy\ast.py", line 1147, in execute
rv = renpy.game.context().call(label, return_site=self.next.name)
File "C:\Users\ASUS\Downloads\renpy-6.15.2-sdk\renpy\execution.py", line 365, in call
return renpy.game.script.lookup(label)
File "C:\Users\ASUS\Downloads\renpy-6.15.2-sdk\renpy\script.py", line 537, in lookup
raise ScriptError("could not find label '%s'." % str(label))
ScriptError: could not find label 'day1n'.

Windows-7-6.1.7601-SP1
Ren'Py 6.15.2.281
A Ren'Py Game 0.0

(script)

Code: Select all

    m "Oh between I'm going to this cafe with my friends."
    m "Wanna tag along?"
    menu:
        "Sure.":
          call day1
        "Nah, I've homeworks to do.":
          call day1n
    n "Well then time to head home."
    n "Mom, I'm home."
(scenes)

Code: Select all

label day1:
  n "..." 
  return 
  
label day1n:
  m "Bummer."
  return 
P.s. If it's a obvious mistake I'm sorry for posting this, I'm still trying to figure this whole code thing out and am terribly confuse.. = A =;;
Last edited by macaron on Sun Jul 14, 2013 8:18 am, edited 1 time in total.

User avatar
Googaboga
Eileen-Class Veteran
Posts: 1395
Joined: Wed Dec 12, 2012 1:37 pm
Completed: https://gbpatch.itch.io/
Projects: Floret Bond, XOXO Blood Droplets, Our Life
Organization: GB Patch Games
Tumblr: gb-patch
itch: gbpatch
Contact:

Re: Code Error

#2 Post by Googaboga » Sun Jul 14, 2013 3:19 am

Well there doesn't seem to be anything wrong with the code itself and if you were to put the labels in the script.rpy it should work fine. Which means there may be something wrong with the scenes.rpy file you made. Is that saved correctly and do you have the scenes.rpy file in the correct folder? It should be in same folder as the script.rpy file.
In-Progress:
Floret Bond, XOXO Blood Droplets, Our Life
Released:
A Foretold Affair, My Magical Divorce Bureau, XOXO Droplets, Lake of Voices

Ryue
Miko-Class Veteran
Posts: 745
Joined: Fri Nov 02, 2012 8:41 am
Projects: Red eyes in the darkness
Contact:

Re: Code Error

#3 Post by Ryue » Sun Jul 14, 2013 3:26 am

Googaboga wrote:Well there doesn't seem to be anything wrong with the code itself and if you were to put the labels in the script.rpy it should work fine. Which means there may be something wrong with the scenes.rpy file you made. Is that saved correctly and do you have the scenes.rpy file in the correct folder? It should be in same folder as the script.rpy file.
It doesnt have to be in the same folder, can also be in a subfolder (thus is the scenes.rpy in the same folder or a subfolder of it?).


Question: For the scenes file are you sure that hit is named scenes.rpy ?

I use editra and when I create a new file with it I overlook half of the time that I need to add the .rpy extension manually when I save the file for the first time.

User avatar
macaron
Regular
Posts: 31
Joined: Sat Mar 30, 2013 4:16 am
Contact:

Re: Code Error

#4 Post by macaron » Sun Jul 14, 2013 8:17 am

Wolf wrote:
Googaboga wrote:Well there doesn't seem to be anything wrong with the code itself and if you were to put the labels in the script.rpy it should work fine. Which means there may be something wrong with the scenes.rpy file you made. Is that saved correctly and do you have the scenes.rpy file in the correct folder? It should be in same folder as the script.rpy file.
It doesnt have to be in the same folder, can also be in a subfolder (thus is the scenes.rpy in the same folder or a subfolder of it?).


Question: For the scenes file are you sure that hit is named scenes.rpy ?

I use editra and when I create a new file with it I overlook half of the time that I need to add the .rpy extension manually when I save the file for the first time.
yes, I did add the .rpy and i saved it in the editra folder there.

User avatar
macaron
Regular
Posts: 31
Joined: Sat Mar 30, 2013 4:16 am
Contact:

Re: Code Error

#5 Post by macaron » Sun Jul 14, 2013 8:20 am

Googaboga wrote:Well there doesn't seem to be anything wrong with the code itself and if you were to put the labels in the script.rpy it should work fine. Which means there may be something wrong with the scenes.rpy file you made. Is that saved correctly and do you have the scenes.rpy file in the correct folder? It should be in same folder as the script.rpy file.
Wolf wrote: It doesnt have to be in the same folder, can also be in a subfolder (thus is the scenes.rpy in the same folder or a subfolder of it?).


Question: For the scenes file are you sure that hit is named scenes.rpy ?
Ah alright I got it now, thanks :D

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], khezo, span4ev, _ticlock_