Lemma Soft Forums

Supporting creators of visual novels and story-based games since 2003.


Visit our new games list, blog aggregator, IRC, and wiki.
Activation problem? Email [email protected]
It is currently Wed May 22, 2013 7:59 am

All times are UTC - 5 hours [ DST ]


Forum rules


Ask questions about one topic per thread, and use a descriptive subject. "NotImplemented error in script.rpy" is a good subject, "Tom's problems" is not. Remember to include all of traceback.txt or error.txt when reporting a problem, as well as the relevant lines of script. Use the [code] tag to format scripts.



Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: If Statements
PostPosted: Fri Apr 03, 2009 4:47 am 
Regular
User avatar

Joined: Mon Mar 30, 2009 3:59 am
Posts: 72
Location: Moriya Shrine, Gensokyo
I've been having trouble with If Statements and after messing around with it, I got this error. I figured if I posted that somebody could help me set it up properly. The line that is supposed to be triggered by the If Statement still shows up in the route where it shouldn't.


Attachments:
traceback.txt [1.11 KiB]
Downloaded 48 times

_________________
"I've heard that villains who go soft and then crazy are pretty popular these days, right?
Even sooo, I've studied a lot of manga, anime and galge that have been popular, you seeee?" - Beatrice, Umineko no Naku Koro ni

Loli Salad~ Music, Doujin, Touhou, Umineko and Anime
(previously I was Hashihime~)
Top
 Profile Send private message  
 
 Post subject: Re: If Statements
PostPosted: Fri Apr 03, 2009 4:54 am 
Veteran
User avatar

Joined: Fri Dec 28, 2007 5:47 am
Posts: 284
Location: Where the Dragons rule!
Can you post the code in question too?

_________________
Angels of paradise, angels of sacrifice
Please let me be under your wings...


Top
 Profile Send private message  
 
 Post subject: Re: If Statements
PostPosted: Fri Apr 03, 2009 5:20 am 
Regular
User avatar

Joined: Mon Mar 30, 2009 3:59 am
Posts: 72
Location: Moriya Shrine, Gensokyo
Hmmm I should just attach the whole script right? Or would that be a bit much to search through? Because if I posted it here it might take up some space...

_________________
"I've heard that villains who go soft and then crazy are pretty popular these days, right?
Even sooo, I've studied a lot of manga, anime and galge that have been popular, you seeee?" - Beatrice, Umineko no Naku Koro ni

Loli Salad~ Music, Doujin, Touhou, Umineko and Anime
(previously I was Hashihime~)


Top
 Profile Send private message  
 
 Post subject: Re: If Statements
PostPosted: Fri Apr 03, 2009 5:24 am 
Veteran
User avatar

Joined: Fri Dec 28, 2007 5:47 am
Posts: 284
Location: Where the Dragons rule!
No, just some lines before and after the row which causes error.

_________________
Angels of paradise, angels of sacrifice
Please let me be under your wings...


Top
 Profile Send private message  
 
 Post subject: Re: If Statements
PostPosted: Fri Apr 03, 2009 5:28 am 
Regular
User avatar

Joined: Mon Mar 30, 2009 3:59 am
Posts: 72
Location: Moriya Shrine, Gensokyo
Oh, okay~

Code:
   
scene bg hall
    with fade
   
    a "Another boring night ahead. I guess I should do my homework for real this time..."
   
    if goto_class:
       a  "The teachers went easy on me afterall..."
       
    a "Maybe that hikikomori will help me too..."


That's where I get the error.

_________________
"I've heard that villains who go soft and then crazy are pretty popular these days, right?
Even sooo, I've studied a lot of manga, anime and galge that have been popular, you seeee?" - Beatrice, Umineko no Naku Koro ni

Loli Salad~ Music, Doujin, Touhou, Umineko and Anime
(previously I was Hashihime~)


Top
 Profile Send private message  
 
 Post subject: Re: If Statements
PostPosted: Fri Apr 03, 2009 6:04 am 
Veteran
User avatar

Joined: Fri Dec 28, 2007 5:47 am
Posts: 284
Location: Where the Dragons rule!
You need to define variable before you use it. Do you by any chance have

goto_class = True

somewhere before that if statement occurs?

_________________
Angels of paradise, angels of sacrifice
Please let me be under your wings...


Top
 Profile Send private message  
 
 Post subject: Re: If Statements
PostPosted: Fri Apr 03, 2009 6:23 am 
Regular
User avatar

Joined: Mon Mar 30, 2009 3:59 am
Posts: 72
Location: Moriya Shrine, Gensokyo
I had it at the beginning where the new label started and I didn't get the error. But it still showed up for the route that didn't choose the choice that should have activated it.

Code:
    jump walkhome

label walkhome:
   
    $ goto_class = True
   
    scene bg street day
    with fade


Unless it's supposed to. I was under the impression it wouldn't show if I chose a different option from the menu.

_________________
"I've heard that villains who go soft and then crazy are pretty popular these days, right?
Even sooo, I've studied a lot of manga, anime and galge that have been popular, you seeee?" - Beatrice, Umineko no Naku Koro ni

Loli Salad~ Music, Doujin, Touhou, Umineko and Anime
(previously I was Hashihime~)


Top
 Profile Send private message  
 
 Post subject: Re: If Statements
PostPosted: Fri Apr 03, 2009 6:27 am 
Miko-Class Veteran
User avatar

Joined: Wed Sep 21, 2005 10:49 pm
Posts: 546
Projects: Winter Shard, EVE, Hyperion
Generally, it is a good idea to have a full list of variables defined from the beginning. So go and add something like...

Code:
label start:
    $ goto_room = False

_________________
「通りすがりのメーカだ。覚えとけ。」

----------
Winter shard
Image
WIP: Hyperion(Trace unknown), ?????(Progressing)


Top
 Profile Send private message  
 
 Post subject: Re: If Statements
PostPosted: Fri Apr 03, 2009 6:45 am 
Regular
User avatar

Joined: Mon Mar 30, 2009 3:59 am
Posts: 72
Location: Moriya Shrine, Gensokyo
Yeah, I had that in too.

_________________
"I've heard that villains who go soft and then crazy are pretty popular these days, right?
Even sooo, I've studied a lot of manga, anime and galge that have been popular, you seeee?" - Beatrice, Umineko no Naku Koro ni

Loli Salad~ Music, Doujin, Touhou, Umineko and Anime
(previously I was Hashihime~)


Top
 Profile Send private message  
 
 Post subject: Re: If Statements
PostPosted: Fri Apr 03, 2009 7:18 am 
Veteran
User avatar

Joined: Fri Dec 28, 2007 5:47 am
Posts: 284
Location: Where the Dragons rule!
This may seem ridiculous, but try this for if statement:

if goto_class==True:

This is out on a limb, though, because if goto_class: should do the same.

_________________
Angels of paradise, angels of sacrifice
Please let me be under your wings...


Top
 Profile Send private message  
 
 Post subject: Re: If Statements
PostPosted: Fri Apr 03, 2009 7:55 am 
Regular
User avatar

Joined: Mon Mar 30, 2009 3:59 am
Posts: 72
Location: Moriya Shrine, Gensokyo
Okay, I tried that. It still didn't work.

Could the following be the trouble?

Code:
   
a "What should I do?"

menu:
    "Got to class":
         jump goto_class

    "Skip class":
         jump skip

label goto_class:
   
    $ goto_class = True
   
    a "I'll have other chances to talk to her. I might be able to explain myself to the teacher anyways..."

_________________
"I've heard that villains who go soft and then crazy are pretty popular these days, right?
Even sooo, I've studied a lot of manga, anime and galge that have been popular, you seeee?" - Beatrice, Umineko no Naku Koro ni

Loli Salad~ Music, Doujin, Touhou, Umineko and Anime
(previously I was Hashihime~)


Top
 Profile Send private message  
 
 Post subject: Re: If Statements
PostPosted: Fri Apr 03, 2009 8:11 am 
Veteran
User avatar

Joined: Fri Dec 28, 2007 5:47 am
Posts: 284
Location: Where the Dragons rule!
Yes, you can't have a label and a variable with the same name. I think. Change the name of label to something different.

_________________
Angels of paradise, angels of sacrifice
Please let me be under your wings...


Top
 Profile Send private message  
 
 Post subject: Re: If Statements
PostPosted: Fri Apr 03, 2009 8:23 am 
Regular
User avatar

Joined: Mon Mar 30, 2009 3:59 am
Posts: 72
Location: Moriya Shrine, Gensokyo
Ah, I was hoping that would work. I shorted the label down to 'goto' but still no luck, the line still appears regardless.

_________________
"I've heard that villains who go soft and then crazy are pretty popular these days, right?
Even sooo, I've studied a lot of manga, anime and galge that have been popular, you seeee?" - Beatrice, Umineko no Naku Koro ni

Loli Salad~ Music, Doujin, Touhou, Umineko and Anime
(previously I was Hashihime~)


Top
 Profile Send private message  
 
 Post subject: Re: If Statements
PostPosted: Fri Apr 03, 2009 8:42 am 
Veteran
User avatar

Joined: Fri Dec 28, 2007 5:47 am
Posts: 284
Location: Where the Dragons rule!
goto is a reserved word I think. Try some other words instead.

_________________
Angels of paradise, angels of sacrifice
Please let me be under your wings...


Top
 Profile Send private message  
 
 Post subject: Re: If Statements
PostPosted: Fri Apr 03, 2009 9:09 am 
Eileen-Class Veteran
User avatar

Joined: Mon Jul 07, 2003 4:57 pm
Posts: 1151
Location: Cambridge, UK
Projects: Elven Relations 2: Mermaid Liaisons
Hmm. Since our first couple of attempts to track this down have failed, it sounds like it'd be a good idea to post your entire script. (If you'd rather keep it secret, strip it down to a small bit of it, but the important thing is that it's (1) a complete script file that we can run in our own Ren'Py and (2) still produces the error you're seeing.)

_________________
Author of Elven Relations (IntRenAiMo 2007), When I Rule The World (NaNoRenO 2005), Cloud Fairy (Cute Light & Fluffy, 2009), the TileEngine and UnitEngine (LSF@5), and the fantasy novel Ultimate Dream (NaNoWriMo 2006 onwards).
In development (progress slow but ongoing):
Elven Relations 2: Mermaid Liaisons: Story 96% done, script 75% done, character art 95% done, event CGs 60% done, backgrounds 50% done, customisation 0% done; demo available


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: pwisaguacate


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Protected by Anti-Spam ACP
Powered by phpBB® Forum Software © phpBB Group