Random Option?

A place to discuss things that aren't specific to any one creator or game.
Forum rules
Ren'Py specific questions should be posted in the Ren'Py Questions and Annoucements forum, not here.
Post Reply
Message
Author
guest

Random Option?

#1 Post by guest » Thu Jan 29, 2009 9:19 pm

I'm a very indecisive person
so is there any way that I could put a "Random" option onto my menus?

User avatar
JQuartz
Eileen-Class Veteran
Posts: 1265
Joined: Fri Aug 31, 2007 7:02 am
Projects: 0 completed game. Still haven't made any meaningfully completed games...
Contact:

Re: Random Option?

#2 Post by JQuartz » Thu Jan 29, 2009 9:40 pm

This should do the trick (It's roundabout and a quite a hassle though)

Code: Select all

menu:
    "Eat plutonium":
        jump eat_plutonium
    "Eat uranium":
        jump eat_uranium
    "Eat random radioactive material":
        jump eat_random

label eat_random:
    $ value=renpy.random.randint(1,2)
    if value==1:
        jump eat_plutonium
    elif value==2:
        jump eat_uranium
    
    
I suspect somebody is stealing my internet identity so don't believe everything I tell you via messages. I don't post or send messages anymore so don't believe anything I tell you via messages or posts.

$inker
Newbie
Posts: 13
Joined: Mon Feb 02, 2009 12:37 am
Projects: My First Visual Novel... Yeah!
Contact:

Re: Random Option?

#3 Post by $inker » Wed Feb 04, 2009 3:03 am

Nice, thanks for the tip, I'll have to use the idea in the game I'm making. Although I don't think I'll have those exact choices; after all who wants to eat uranium, it has an awful aftertaste. :P
~$inker~

Post Reply

Who is online

Users browsing this forum: No registered users