How do you do a probalbillty code?

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
briannavon
Miko-Class Veteran
Posts: 505
Joined: Mon Mar 26, 2012 6:51 pm
Location: Philadelphia
Contact:

How do you do a probalbillty code?

#1 Post by briannavon » Wed Dec 26, 2012 12:42 am

How do you do a code like :

if happy :

("dance","skip","sing" , 3)

if dance :
dance

if skip:
skip
if sing :
sing

if mad :

("yell", "scream", 2)


if yell :
yell

if scream :
scream
Join Me At LivingGame Productions!

http://livinggameproductions.blogspot.com/

User avatar
Spiky Caterpillar
Veteran
Posts: 253
Joined: Fri Nov 14, 2008 7:59 pm
Completed: Lots.
Projects: Black Closet
Organization: Slipshod
Location: Behind you.
Contact:

Re: How do you do a probalbillty code?

#2 Post by Spiky Caterpillar » Wed Dec 26, 2012 7:08 am

Code: Select all

$ action = renpy.random.choice(('dance','skip','sing'))
if action=='dance':
    "You dance until your feet can't take it any more."
elif action=="skip":
    "You skip through the field."
Nom nom nom nom nom LEAVES.

briannavon
Miko-Class Veteran
Posts: 505
Joined: Mon Mar 26, 2012 6:51 pm
Location: Philadelphia
Contact:

Re: How do you do a probalbillty code?

#3 Post by briannavon » Wed Dec 26, 2012 12:43 pm

Thank you! :D
Join Me At LivingGame Productions!

http://livinggameproductions.blogspot.com/

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]