Problems with script [RESOLVED]

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
HigurashiKira
Miko-Class Veteran
Posts: 832
Joined: Mon Nov 01, 2010 9:10 pm
Contact:

Problems with script [RESOLVED]

#1 Post by HigurashiKira »

Every time I try and run my script to see if it's working, I keep getting:
On line 82 of C:\Documents and Settings\Kira\Desktop\Doujin Games\Death Rule-Episode 0/game/options.rpy: invalid syntax
gm_root = "sundialnight.png"
^

Could someone help me?
*Note: I have the recent version of Ren'Py*
Last edited by HigurashiKira on Tue Nov 02, 2010 8:23 pm, edited 1 time in total.

broken_angel
Veteran
Posts: 322
Joined: Sun Oct 03, 2010 11:49 pm
Completed: Memoirs of an Angel (2010)
Projects: Memoirs of an Angel (Remake); W.I.S.H
Location: United States
Contact:

Re: Problems with script

#2 Post by broken_angel »

Well, what do you have at line 82 exactly?

If you post that part of the code here, people will be able to help you better. :3

But it's likely that you wrote it wrong somehow, like you forgot a comma or something.

EDIT:
That's exactly what it is: you forgot a comma.
It should be...

Code: Select all

        gm_root = "imagename.png",

HigurashiKira
Miko-Class Veteran
Posts: 832
Joined: Mon Nov 01, 2010 9:10 pm
Contact:

Re: Problems with script

#3 Post by HigurashiKira »

did that and it still reads it:

Code: Select all

On line 82 of C:\Documents and Settings\Kira\Desktop\Doujin Games\Death Rule-Episode 0/game/options.rpy: invalid syntax
        gm_root = "sundialnight.png",

KimiYoriBaka
Miko-Class Veteran
Posts: 636
Joined: Thu May 14, 2009 8:15 pm
Projects: Castle of Arhannia
Contact:

Re: Problems with script

#4 Post by KimiYoriBaka »

Ah, syntax errors. those tend to be fun.

Okay so, whenever you get a syntax error in any situation, if you can't tell what it is immediately you should look at the lines around it. This is especially true if you get the error on the first or last character of the line, because the compiler/interpreter is telling you when it realized there was a problem, and thus the problem is elsewhere.

in this case, you should look at the entire section in the parentheses, as that line is probably part of the theme.roundrect() function that is placed in options.rpy whenever you start a new project. you should especially check the line before it (or before the comments before it).

Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: Problems with script

#5 Post by Jake »

KimiYoriBaka wrote: Okay so, whenever you get a syntax error in any situation, if you can't tell what it is immediately you should look at the lines around it. This is especially true if you get the error on the first or last character of the line, because the compiler/interpreter is telling you when it realized there was a problem, and thus the problem is elsewhere.
(I agree completely, but as it goes, the compiler is actually pointing to point around the '=', as you can see if you quote the OP and put that part in 'code' tags:

Code: Select all

        gm_root = "sundialnight.png"
               ^
- HTML renderers collapse all adjacent spaces into a single space just to annoy people, so since the error report didn't go into code tags (which produces alternate non-collapsing 'nbsp' entity spaces) it will always look like the caret is near the beginning of the line. :/)




I can reproduce a similar error message by having the following in those lines:

Code: Select all

        mm_root =

        ## The background of the game menu. This can be a color
        ## beginning with '#', or an image filename. The latter
        ## should take up the full height and width of the screen.
        gm_root = "#dcebff",
- in this case, Ren'Py/Python sees the "mm_root =" on the previous code line, waits for a value, keeps waiting until the next code line and eventually finds 'gm_root', assumes 'gm_root' is actually the value to be passed into the 'mm_root' parameter and then expects a close-bracket (no more parameters to the roundrect theme) or a comma (moving on to the next parameter), but instead gets an equals sign - it's effectively interpreting the code as if I'd written this:

Code: Select all

        mm_root = gm_root = "#dcebff",


- so if I were you, HigurashiKira, I'd make sure you've specified a value for mm_root and put a comma after it.


If this isn't your problem, then you might be better off just attaching the entire options.rpy to a post, so we can take a look and see what's wrong.
Server error: user 'Jake' not found

HigurashiKira
Miko-Class Veteran
Posts: 832
Joined: Mon Nov 01, 2010 9:10 pm
Contact:

Re: Problems with script

#6 Post by HigurashiKira »

Well I did go back and check, turns out I was missing a comma from the previous script from mm_root. So I just fixed my own problem. Thanks for all your help people!
I have moved to a new account. Please contact me here from now on. T/Y~

Post Reply

Who is online

Users browsing this forum: Nozori_Games, Ocelot