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.
label start:
$ name = renpy.random.choice(['Sara','Cindy','Julie','Megan'])
"I'll ask her... my name is [name]"
menu:
$ name = renpy.random.choice(['Sara','Cindy','Julie','Megan'])
"It's a [name].":
jump goo
$ name = renpy.random.choice(['Sara','Cindy','Julie','Megan'])
"It's a [name].":
jump muu
is there any function to optimize this? or I have to always put all code random?
label start:
$ name_list = ['Sara','Cindy','Julie','Megan']
$ name = renpy.random.choice(name_list)
"I'll ask her... my name is [name]"
$ a = renpy.random.choice(name_list)
$ b = renpy.random.choice(name_list)
menu:
"It's a [a].":
jump goo
"It's a [b].":
jump muu
label start:
$ name_list = ['Sara','Cindy','Julie','Megan']
$ name = renpy.random.choice(name_list)
"I'll ask her... my name is [name]"
$ a = renpy.random.choice(name_list)
$ b = renpy.random.choice(name_list)
menu:
"It's a [a].":
jump goo
"It's a [b].":
jump muu