Is there a way to randomize choice direction?

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
MisterHarold
Regular
Posts: 51
Joined: Tue Jul 17, 2018 10:32 am
Location: Philippines
Contact:

Is there a way to randomize choice direction?

#1 Post by MisterHarold »

For example, there are two choices: a.) go to school b.) go home
and if clicked, they would go to..accordingly a1.) you get good grades b1.) you fail
I want to randomize the choice's outcome.

User avatar
jacobjumper
Regular
Posts: 44
Joined: Tue Jan 07, 2014 9:45 pm
Projects: Familiarity
Organization: Airheart
Location: Houston
Contact:

Re: Is there a way to randomize choice direction?

#2 Post by jacobjumper »

Sure, you can do that by creating a random int,

Code: Select all

$ randint = renpy.random.randint(0, 1)
then calling something like

Code: Select all

if randint == 0:
	jump school
elif randint == 1:
	jump home

Post Reply

Who is online

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