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 Sun May 19, 2013 10:00 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  [ 17 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Choices? HELP! :(
PostPosted: Fri Jun 17, 2011 3:44 am 
Newbie
User avatar

Joined: Thu Jun 16, 2011 5:09 am
Posts: 24
Projects: Clannad - K.A.
Ok so...I'm new and stuff so that's why I need help with the choices thing. I've used the code in the wiki and the help.html. But I always get exceptions and stuff. I just want a simple "Ignore" as choice 1 or "Apologize" as choice 2. I also want it at the bottom of the screen where the text is, instead of in the middle of the screen. (If possible)

Thanks in advanced! :D


Top
 Profile Send private message  
 
 Post subject: Re: Choices? HELP! :(
PostPosted: Fri Jun 17, 2011 3:47 am 
Eileen-Class Veteran
User avatar

Joined: Sat Apr 23, 2011 2:43 pm
Posts: 1086
Completed: Ristorante Amore, The Elevator, SPLENDIDEST OTOGE
Projects: Break Chance Memento, Swan Grimoire
Organization: Cyanide Tea
For putting it in the textbox: viewtopic.php?f=8&t=10493

You should post your code so we can tell you why you're getting the exceptions, but this is the general coding for something like that:

Code:
    menu:
        "Ignore":
            "He ignored the guy."
        "Apologize":
            "He apologized to the guy."

_________________
1/2 of Cyanide Tea | BCM | Ristorante Amore | The Elevator | @Twitter


Top
 Profile Send private message  
 
 Post subject: Re: Choices? HELP! :(
PostPosted: Fri Jun 17, 2011 3:55 am 
Newbie
User avatar

Joined: Thu Jun 16, 2011 5:09 am
Posts: 24
Projects: Clannad - K.A.
Camille wrote:
For putting it in the textbox: viewtopic.php?f=8&t=10493

You should post your code so we can tell you why you're getting the exceptions, but this is the general coding for something like that:

[spoiler]
Code:
    menu:
        "Ignore":
            "He ignored the guy."
        "Apologize":
            "He apologized to the guy."


Ahh...Thanks! But...the thing I want is like this one: http://www.renpy.org/wiki/renpy/doc/tutorials/Remembering_User_Choices
Where it remembers the choice for later on. But I get this exception when I use it:

Code:
File "game/script.rpy", line 14: menu statement expects a non-empty block.
    menu:
        ^

File "game/script.rpy", line 15: expected statement.
    "Buy her an Iguana":
                       ^

File "game/script.rpy", line 18: expected statement.
    "Buy her a Corn Snake":
                          ^

File "game/script.rpy", line 21: expected statement.
    "Buy her a tortoise":
                        ^

Ren'Py Version: Ren'Py 6.12.1.1501


Sorry im new to ren'py :(


Last edited by Tomoya on Fri Jun 17, 2011 3:59 am, edited 1 time in total.

Top
 Profile Send private message  
 
 Post subject: Re: Choices? HELP! :(
PostPosted: Fri Jun 17, 2011 3:59 am 
Regular
User avatar

Joined: Sun Sep 06, 2009 6:54 am
Posts: 93
Did you intent the choices? It actually matters here, so

Code:
    menu:
        "Ignore":
            "He ignored the guy."
        "Apologize":
            "He apologized to the guy."

is different from
Code:
    menu:
    "Ignore":
    "He ignored the guy."
    "Apologize":
    "He apologized to the guy."


(posting the code you're using would help greatly)

_________________
-Gumaster
There is no n.
http://electrofishstudios.wordpress.com/


Top
 Profile Send private message  
 
 Post subject: Re: Choices? HELP! :(
PostPosted: Fri Jun 17, 2011 4:04 am 
Newbie
User avatar

Joined: Thu Jun 16, 2011 5:09 am
Posts: 24
Projects: Clannad - K.A.
Gumaster wrote:
Did you intent the choices? It actually matters here, so

Code:
    menu:
        "Ignore":
            "He ignored the guy."
        "Apologize":
            "He apologized to the guy."

is different from
Code:
    menu:
    "Ignore":
    "He ignored the guy."
    "Apologize":
    "He apologized to the guy."


(posting the code you're using would help greatly)


Ok...the code im using is the one from http://www.renpy.org/wiki/renpy/doc/tutorials/Remembering_User_Choices

I didn't edit it or anything yet. I just pasted into a new project.

Here's code:

Code:
label start:
   
    menu:
    "Buy her an Iguana":
        $ gift = "iguana"
        b "I'll take an iguana, my good man!"
    "Buy her a Corn Snake":
        $ gift = "corn snake"
        b "I'll take a Corn Snake, my good man!"
    "Buy her a tortoise":
        $ gift = "tortoise"
        b "Give me your slowest tortoise, please!"
       
        b "Open it, Mary."
if gift == "iguana":
    m "Oh Bob, I've always wanted an iguana!"
if gift == "corn snake":
    m "Oh Bob, I needed a corn snake that matches my red dress! Thank you so much!"
if gift == "tortoise":
    m "Bob! It's so slow! I love you!"


I know I probably did something wrong because im new :( (P.S.: these arent the choices I want in my game, just default choice's lol)


Top
 Profile Send private message  
 
 Post subject: Re: Choices? HELP! :(
PostPosted: Fri Jun 17, 2011 4:08 am 
Eileen-Class Veteran
User avatar

Joined: Sat Apr 23, 2011 2:43 pm
Posts: 1086
Completed: Ristorante Amore, The Elevator, SPLENDIDEST OTOGE
Projects: Break Chance Memento, Swan Grimoire
Organization: Cyanide Tea
See, you didn't indent properly. It should be like:

Code:
label start:
   
    menu:
        "Buy her an Iguana":
            $ gift = "iguana"
            b "I'll take an iguana, my good man!"
        "Buy her a Corn Snake":
            $ gift = "corn snake"
            b "I'll take a Corn Snake, my good man!"
        "Buy her a tortoise":
            $ gift = "tortoise"
            b "Give me your slowest tortoise, please!"
            b "Open it, Mary."
    if gift == "iguana":
        m "Oh Bob, I've always wanted an iguana!"
    elif gift == "corn snake":
        m "Oh Bob, I needed a corn snake that matches my red dress! Thank you so much!"
    elif gift == "tortoise":
        m "Bob! It's so slow! I love you!"


Also, make sure you have all of those variables defined in an init block. Like Gumaster said, indentation really matters.

_________________
1/2 of Cyanide Tea | BCM | Ristorante Amore | The Elevator | @Twitter


Top
 Profile Send private message  
 
 Post subject: Re: Choices? HELP! :(
PostPosted: Fri Jun 17, 2011 4:10 am 
Newbie
User avatar

Joined: Thu Jun 16, 2011 5:09 am
Posts: 24
Projects: Clannad - K.A.
Camille wrote:
See, you didn't indent properly. It should be like:

Code:
label start:
   
    menu:
        "Buy her an Iguana":
            $ gift = "iguana"
            b "I'll take an iguana, my good man!"
        "Buy her a Corn Snake":
            $ gift = "corn snake"
            b "I'll take a Corn Snake, my good man!"
        "Buy her a tortoise":
            $ gift = "tortoise"
            b "Give me your slowest tortoise, please!"
            b "Open it, Mary."
    if gift == "iguana":
        m "Oh Bob, I've always wanted an iguana!"
    if gift == "corn snake":
        m "Oh Bob, I needed a corn snake that matches my red dress! Thank you so much!"
    if gift == "tortoise":
        m "Bob! It's so slow! I love you!"


Also, make sure you have all of those variables defined in an init block.


OHHHHH...Thanks! It's working now. But how do I know how much to indent and stuff? And the options appeared in middle of screen even with the code from that link you gave me a few minutes ago. :(


Top
 Profile Send private message  
 
 Post subject: Re: Choices? HELP! :(
PostPosted: Fri Jun 17, 2011 4:14 am 
Eileen-Class Veteran
User avatar

Joined: Sat Apr 23, 2011 2:43 pm
Posts: 1086
Completed: Ristorante Amore, The Elevator, SPLENDIDEST OTOGE
Projects: Break Chance Memento, Swan Grimoire
Organization: Cyanide Tea
You're not supposed to actually just copy and paste the code from the link, you have to follow the instructions. The code is just there as a guide to let you know what part of your code you need to change.

More about indentation: http://renpy.org/doc/html/language_basi ... and-blocks

An indent in Ren'Py is 4 spaces. Generally when you have something with a colon, whatever follows it has to be four spaces over like:

Code:
label start:
    menu:
        "Option here":
            "Text here."


See how you add four spaces each time as you get "deeper" into the code?

_________________
1/2 of Cyanide Tea | BCM | Ristorante Amore | The Elevator | @Twitter


Top
 Profile Send private message  
 
 Post subject: Re: Choices? HELP! :(
PostPosted: Fri Jun 17, 2011 4:18 am 
Newbie
User avatar

Joined: Thu Jun 16, 2011 5:09 am
Posts: 24
Projects: Clannad - K.A.
Camille wrote:
You're not supposed to actually just copy and paste the code from the link, you have to follow the instructions. The code is just there as a guide to let you know what part of your code you need to change.

More about indentation: http://renpy.org/doc/html/language_basi ... and-blocks

An indent in Ren'Py is 4 spaces. Generally when you have something with a colon, whatever follows it has to be four spaces over like:

Code:
label start:
    menu:
        "Option here":
            "Text here."


See how you add four spaces each time as you get "deeper" into the code?


Lol...Thanks your really good at ren'py coding! :)


Top
 Profile Send private message  
 
 Post subject: Re: Choices? HELP! :(
PostPosted: Fri Jun 17, 2011 11:39 am 
Eileen-Class Veteran
User avatar

Joined: Sat Apr 23, 2011 2:43 pm
Posts: 1086
Completed: Ristorante Amore, The Elevator, SPLENDIDEST OTOGE
Projects: Break Chance Memento, Swan Grimoire
Organization: Cyanide Tea
Haha I'm not really. Note my join date: I haven't been doing this for very long, I just read a lot. Coding properly takes a lot of trial and error, a lot of reading, and a lot of patience.

Anyway, best of luck!

_________________
1/2 of Cyanide Tea | BCM | Ristorante Amore | The Elevator | @Twitter


Top
 Profile Send private message  
 
 Post subject: Re: Choices? HELP! :(
PostPosted: Sun Jun 19, 2011 1:18 am 
Regular
User avatar

Joined: Wed Aug 26, 2009 5:54 pm
Posts: 181
Projects: Dad is a Prince and Mom is the Hero?!, Unnamed Trivia Game, Beautiful Tail [BxG] [Sci-fi]
Organization: Chu! Bam! Pow!
I have constant trouble with knowing when to indent where and how much! Thank you Camille for taking some time to give an example. I know that's not really the purpose of this thread, but as I was reading, I had quite an aha moment!


Top
 Profile Send private message  
 
 Post subject: Re: Choices? HELP! :(
PostPosted: Sun Jun 19, 2011 10:45 am 
Eileen-Class Veteran
User avatar

Joined: Sat Apr 23, 2011 2:43 pm
Posts: 1086
Completed: Ristorante Amore, The Elevator, SPLENDIDEST OTOGE
Projects: Break Chance Memento, Swan Grimoire
Organization: Cyanide Tea
Ionait wrote:
I have constant trouble with knowing when to indent where and how much! Thank you Camille for taking some time to give an example. I know that's not really the purpose of this thread, but as I was reading, I had quite an aha moment!

I love those aha moments! (: I think using the whole "if there's a colon, the next line has to be 4 spaces over" idea as a golden rule is pretty good, and then you just remember that everything in that block is indented the same. Once you're done putting all the things in a menu, for example, then you go back to the same indentation as the "menu:" part for the next block. Iiiif that makes sense. :D

I think that like a good chunk of the problems posted about in Ren'Py Help tend to be actually be problems with indentation, so it's an important concept. XD

_________________
1/2 of Cyanide Tea | BCM | Ristorante Amore | The Elevator | @Twitter


Top
 Profile Send private message  
 
 Post subject: Re: Choices? HELP! :(
PostPosted: Wed Jun 22, 2011 10:21 am 
Newbie

Joined: Thu May 26, 2011 1:39 am
Posts: 13
Camille wrote:
I love those aha moments! (: I think using the whole "if there's a colon, the next line has to be 4 spaces over" idea as a golden rule is pretty good, and then you just remember that everything in that block is indented the same. Once you're done putting all the things in a menu, for example, then you go back to the same indentation as the "menu:" part for the next block. Iiiif that makes sense. :D

I think that like a good chunk of the problems posted about in Ren'Py Help tend to be actually be problems with indentation, so it's an important concept. XD


Thank you, my Hero! Well, I encountered another trouble, maybe you can help me?

So, I was trying it out and it worked for the first time, yeah I never knew the 4-Lines-Rule, so I'm guessing now it's somehow clear why it didn't worked.

Anyways, my problem is that the Choice's are within the textbox, so what should I do to place it in the middle of the screen like in every Visual Novel you normally read?

Thank you, please (someone) answer me !


Top
 Profile Send private message  
 
 Post subject: Re: Choices? HELP! :(
PostPosted: Wed Jun 22, 2011 11:10 am 
Regular
User avatar

Joined: Wed Aug 11, 2010 8:49 pm
Posts: 160
Projects: What Do You See?
Zypharium wrote:
Thank you, my Hero! Well, I encountered another trouble, maybe you can help me?

So, I was trying it out and it worked for the first time, yeah I never knew the 4-Lines-Rule, so I'm guessing now it's somehow clear why it didn't worked.

Anyways, my problem is that the Choice's are within the textbox, so what should I do to place it in the middle of the screen like in every Visual Novel you normally read?

Thank you, please (someone) answer me !


If you look around renpy.org, you can find a lot of this stuff you may be asking.
Anyway, just copy this code onto your options tab, and it'll appear.
I'm not common with renpy and changing the layout of the button, so this is all i know. sorry.

Code:
    # Layouts
   
    ## This enables the use of an in-game menu that is made out of
    ## buttons.

    layout.button_menu()

_________________
Dev Blog
What Do You See? [NaNo13]


Top
 Profile Send private message  
 
 Post subject: Re: Choices? HELP! :(
PostPosted: Wed Jun 22, 2011 11:21 am 
Eileen-Class Veteran
User avatar

Joined: Sat Apr 23, 2011 2:43 pm
Posts: 1086
Completed: Ristorante Amore, The Elevator, SPLENDIDEST OTOGE
Projects: Break Chance Memento, Swan Grimoire
Organization: Cyanide Tea
Zypharium wrote:
Thank you, my Hero! Well, I encountered another trouble, maybe you can help me?

So, I was trying it out and it worked for the first time, yeah I never knew the 4-Lines-Rule, so I'm guessing now it's somehow clear why it didn't worked.

Anyways, my problem is that the Choice's are within the textbox, so what should I do to place it in the middle of the screen like in every Visual Novel you normally read?

Thank you, please (someone) answer me !

0_o I'm not sure why your choices are within the textbox, because by default they should be in the middle of the screen. Are you using the menu code? (menu = choices)

_________________
1/2 of Cyanide Tea | BCM | Ristorante Amore | The Elevator | @Twitter


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

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users


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