Errors on using certain code parts

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
Neon Lemmy Koopa
Regular
Posts: 35
Joined: Sat Aug 23, 2008 3:23 am
Projects: Prince of Lawyers
Contact:

Errors on using certain code parts

#1 Post by Neon Lemmy Koopa » Sat Aug 23, 2008 6:36 pm

So Im going through alot of the documentation on the Ren'Py website. Im using it in the context shown in the examples, however it doesn't seem to work for me. One of the commands included the pause command:

Code: Select all

 scene whitebg with pause(1)
Here is the error from the trackback file

Code: Select all

I'm sorry, but an exception occured while executing your Ren'Py
script.

NameError: name 'pause' is not defined

While running game code:
 - script at line 37 of C:\Documents and Settings\Sam Hobson\My Documents\renpy-6.6.3-full\renpy-6.6.3\Test AA App/game/script.rpy

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

  File "C:\Documents and Settings\Sam Hobson\My Documents\renpy-6.6.3-full\renpy-6.6.3\renpy\bootstrap.py", line 212, in bootstrap
  File "C:\Documents and Settings\Sam Hobson\My Documents\renpy-6.6.3-full\renpy-6.6.3\renpy\main.py", line 303, in main
  File "C:\Documents and Settings\Sam Hobson\My Documents\renpy-6.6.3-full\renpy-6.6.3\renpy\main.py", line 92, in run
  File "C:\Documents and Settings\Sam Hobson\My Documents\renpy-6.6.3-full\renpy-6.6.3\renpy\execution.py", line 199, in run
  File "C:\Documents and Settings\Sam Hobson\My Documents\renpy-6.6.3-full\renpy-6.6.3\renpy\ast.py", line 855, in execute
  File "C:\Documents and Settings\Sam Hobson\My Documents\renpy-6.6.3-full\renpy-6.6.3\renpy\python.py", line 909, in py_eval
  File "<none>", line 1, in <expression>
NameError: name 'pause' is not defined

While running game code:

Ren'Py Version: Ren'Py 6.6.3a
also using the define a position command

Code: Select all

topright = Position(xpos=0.5, xanchor='right', ypos=0.0, yanchor='top')
Error:

Code: Select all

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


On line 4 of C:\Documents and Settings\Sam Hobson\My Documents\renpy-6.6.3-full\renpy-6.6.3\Test AA App/game/script.rpy: expected statement.
topright = Position(xpos=0.5, xanchor='right', ypos=0.0, yanchor='top')
         ^

Ren'Py Version: Ren'Py 6.6.3a
These were the only 2 I could remember, but most of the errors I got looked like one of the two above. And Im sure I was using them in the context shown on the website.
Now, they often call me Speedo, But my real name is Mr. Earl!
Now, they often call me Speedo, But my real name is Mr. Earl!
Known for meetin' brand new fellas and takin' other folk's girl!
Now, some, they call me Joe, Some may call me Moe
Just remember Speedo, he don't never take it slow
Even R&B in the 50's was cool

User avatar
Dusty
Regular
Posts: 126
Joined: Fri Jul 25, 2008 11:51 pm
Contact:

Re: Errors on using certain code parts

#2 Post by Dusty » Sat Aug 23, 2008 7:17 pm

First: The function Pause needs a capital P because Python functions are case-sensitive.

Second: Put a $ before creating/assigning a variable like

Code: Select all

$ topright = Position(xpos=0.5, xanchor='right', ypos=0.0, yanchor='top')

User avatar
Neon Lemmy Koopa
Regular
Posts: 35
Joined: Sat Aug 23, 2008 3:23 am
Projects: Prince of Lawyers
Contact:

Re: Errors on using certain code parts

#3 Post by Neon Lemmy Koopa » Sun Aug 24, 2008 1:34 am

OK so I think the $ was the problem for most of those. However now I'm getting an error with the position.

Code: Select all

init:
  $     top = Position(xpos=0.5, xanchor='center', ypos=0.0, yanchor='top')           
  
And heres the error

Code: Select all

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


On line 4 of C:\Documents and Settings\Sam Hobson\My Documents\renpy-6.6.3-full\renpy-6.6.3\Test AA App/game/script.rpy: one-line python statement does not expect a block. Please check the indentation of the line after this one.
$     top = Position(xpos=0.5, xanchor='center', ypos=0.0, yanchor='top')           
                                                                                    ^

Ren'Py Version: Ren'Py 6.6.3a
Now, they often call me Speedo, But my real name is Mr. Earl!
Now, they often call me Speedo, But my real name is Mr. Earl!
Known for meetin' brand new fellas and takin' other folk's girl!
Now, some, they call me Joe, Some may call me Moe
Just remember Speedo, he don't never take it slow
Even R&B in the 50's was cool

User avatar
Neon Lemmy Koopa
Regular
Posts: 35
Joined: Sat Aug 23, 2008 3:23 am
Projects: Prince of Lawyers
Contact:

Re: Errors on using certain code parts

#4 Post by Neon Lemmy Koopa » Sun Aug 24, 2008 1:39 am

scratch that, it was an indentation error.
Now, they often call me Speedo, But my real name is Mr. Earl!
Now, they often call me Speedo, But my real name is Mr. Earl!
Known for meetin' brand new fellas and takin' other folk's girl!
Now, some, they call me Joe, Some may call me Moe
Just remember Speedo, he don't never take it slow
Even R&B in the 50's was cool

User avatar
Neon Lemmy Koopa
Regular
Posts: 35
Joined: Sat Aug 23, 2008 3:23 am
Projects: Prince of Lawyers
Contact:

Re: Errors on using certain code parts

#5 Post by Neon Lemmy Koopa » Sun Aug 24, 2008 2:24 am

Ok so now I'm trying to un-# some options in the options.rpy and Im coming out with errors.

Code: Select all

    style.window.yminimum = 150
<---thats what I un-#
Here's the trackback file:

Code: Select all

I'm sorry, but an exception occured while executing your Ren'Py
script.

Exception: Syntax error on line 124 of C:\Documents and Settings\Sam Hobson\My Documents\renpy-6.6.3-full\renpy-6.6.3\Test AA App\game/options.rpy

While compiling python block starting at line 10 of C:\Documents and Settings\Sam Hobson\My Documents\renpy-6.6.3-full\renpy-6.6.3\Test AA App\game/options.rpy.

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

  File "C:\Documents and Settings\Sam Hobson\My Documents\renpy-6.6.3-full\renpy-6.6.3\renpy\bootstrap.py", line 212, in bootstrap
  File "C:\Documents and Settings\Sam Hobson\My Documents\renpy-6.6.3-full\renpy-6.6.3\renpy\main.py", line 190, in main
  File "C:\Documents and Settings\Sam Hobson\My Documents\renpy-6.6.3-full\renpy-6.6.3\renpy\script.py", line 478, in load_script
  File "C:\Documents and Settings\Sam Hobson\My Documents\renpy-6.6.3-full\renpy-6.6.3\renpy\script.py", line 155, in __init__
  File "C:\Documents and Settings\Sam Hobson\My Documents\renpy-6.6.3-full\renpy-6.6.3\renpy\script.py", line 367, in load_appropriate_file
  File "C:\Documents and Settings\Sam Hobson\My Documents\renpy-6.6.3-full\renpy-6.6.3\renpy\script.py", line 334, in load_file
  File "C:\Documents and Settings\Sam Hobson\My Documents\renpy-6.6.3-full\renpy-6.6.3\renpy\script.py", line 427, in update_bytecode
  File "C:\Documents and Settings\Sam Hobson\My Documents\renpy-6.6.3-full\renpy-6.6.3\renpy\python.py", line 218, in py_compile_exec_bytecode
  File "C:\Documents and Settings\Sam Hobson\My Documents\renpy-6.6.3-full\renpy-6.6.3\renpy\python.py", line 202, in py_compile
Exception: Syntax error on line 124 of C:\Documents and Settings\Sam Hobson\My Documents\renpy-6.6.3-full\renpy-6.6.3\Test AA App\game/options.rpy

While compiling python block starting at line 10 of C:\Documents and Settings\Sam Hobson\My Documents\renpy-6.6.3-full\renpy-6.6.3\Test AA App\game/options.rpy.

Ren'Py Version: Ren'Py 6.6.3a
Now, they often call me Speedo, But my real name is Mr. Earl!
Now, they often call me Speedo, But my real name is Mr. Earl!
Known for meetin' brand new fellas and takin' other folk's girl!
Now, some, they call me Joe, Some may call me Moe
Just remember Speedo, he don't never take it slow
Even R&B in the 50's was cool

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Errors on using certain code parts

#6 Post by PyTom » Sun Aug 24, 2008 10:20 am

Can you post the whole options.rpy file? It's hard to diagnose a syntax error without the whole file.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Majestic-12 [Bot]