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 Jun 19, 2013 7:13 pm

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  [ 4 posts ] 
Author Message
PostPosted: Sat May 05, 2012 7:21 pm 
Regular

Joined: Sat May 05, 2012 2:27 pm
Posts: 83
Hello everyone,I am new to this site(Well actually my twin sister is always on this site and i constantly look threw it,But this is the first time i've had an account on this site.)and I really need some help on how to put mutiple answers or reaction to another character's diolauge.I've tried but I can only do one because I don't know how to add more.

Here is an example.


"Aw. But I'll still be around to mooch off you guys.":
$ TedFamilyPoints +=1
show screen stats
t "Yeah...Well we still live down the street so you'll still be around."
j "That's so sweet of you,Little brother!"
t "Don't get all sweet on me,now!"
t "Now come on,Go down stairs and talk to Darryl."
j "Ok."

The top part is an answer,But I really need to know how to add more than one,Can anyone Please help me,I would very,Very Thankful :)


Top
 Profile Send private message  
 
PostPosted: Sat May 05, 2012 7:39 pm 
Miko-Class Veteran
User avatar

Joined: Mon Feb 06, 2012 9:50 pm
Posts: 759
Location: NYC
Projects: Icebound
Organization: Fastermind Games
The key is using "if" and "else",

Code:
if points == 1:
  d "Stuff"
if points == 2:
  d "Other stuff"
else:
  d "More stuff"

_________________
ImageImage


Top
 Profile Send private message  
 
PostPosted: Tue May 08, 2012 6:35 pm 
Newbie
User avatar

Joined: Mon Jan 10, 2011 5:28 am
Posts: 17
Location: USA
Completed: Across the Night to You
Projects: In The Chaos, Das Minneschwert, Star Gazers
I think what you're looking for is menu.
Code:
menu:
     "What should I say?"

     "Aw. But I'll still be around to mooch off you guys.":
         jump mooch

     "I'm really a Sith Lord anyway, bwahahaha!":
         jump sith_ending

     "Genuflect.":
         jump genuflect_ending

label mooch:
    $ TedFamilyPoints +=1
    show screen stats
[etc.- just put the rest of that first choice's stuff here]

You can make as many of these as you need, just so long as you put an indented command (in this case, to jump to a particular label) after the colon.
I hope this is helpful to you and that your Ren'Py career is fruitful!


Also, while you might not need this, I must add that when working with if, a third selector, elif, is needed. There's some information in the Python documentation about it here.
Example usage:
Code:
if points == 1:
      d "Stuff"
elif points == 2:
      d "Other stuff"
else:
      d "More stuff"

If you write multiple "if"s in one block, it tends to work strangely. At least, the other students in my class seemed to have trouble when they did that, so be careful.

_________________
Development blog | Home page
The thing to remember is that people can change.


Top
 Profile Send private message  
 
PostPosted: Thu May 10, 2012 2:59 pm 
Regular

Joined: Sat May 05, 2012 2:27 pm
Posts: 83
Thanks Everyone!I was kind of in a bind with the whole system of it!This really helps!


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: Exabot [Bot], ThisIsNoName


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