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.
Hello everyone !
I have a question about random in renpy.
I tried to make a random quote each time the narrator's speaking using renpy.random.choice () but unfortunately the quote is always the same. I tried to figure out how to do this but I didn't seem to find what I was looking for.
default quotes=["The weather's good today","I'm bored.","I wanna sleeeeeep !!","Hard-work is really important guys"]
# - - - - - - - - - - Game starts here - - - - - - - - - -
label start:
$ rd_quotes=renpy.random.choice(quotes) #pick a random tense from the list "quotes"
scene black
m "Someone's there ?"
narrator " Maybe or maybe not."
m "Who're you ?"
narrator "[rd_quotes]"
m "What ?"
narrator "[rd_quotes]"
m "Didn't understand."
narrator "[rd_quotes]"
m "Huh..."
narrator "[rd_quotes]"
m "Well I..."
narrator "[rd_quotes]"
m "Okay,I give up."
return
default quotes=["The weather's good today","I'm bored.","I wanna sleeeeeep !!","Hard-work is really important guys"]
# - - - - - - - - - - Game starts here - - - - - - - - - -
label start:
scene black
m "Someone's there ?"
narrator " Maybe or maybe not."
m "Who're you ?"
$ rd_quotes=renpy.random.choice(quotes) #pick a random tense from the list "quotes"
narrator "[rd_quotes]"
m "What ?"
$ rd_quotes=renpy.random.choice(quotes) #pick a random tense from the list "quotes"
narrator "[rd_quotes]"
m "Didn't understand."
$ rd_quotes=renpy.random.choice(quotes) #pick a random tense from the list "quotes"
narrator "[rd_quotes]"
m "Huh..."
$ rd_quotes=renpy.random.choice(quotes) #pick a random tense from the list "quotes"
narrator "[rd_quotes]"
m "Well I..."
$ rd_quotes=renpy.random.choice(quotes) #pick a random tense from the list "quotes"
narrator "[rd_quotes]"
m "Okay,I give up."
return