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.
I'm trying to create a monolog/narration sequence. I need to freely position text on a black screen, without the text-window in the way. I also need the text to have variable cps. I tried to achieve this by opening a screen on which I add the text:
init python:
from time import sleep
def wait(t): #stops the entire process sadly
sleep(t)
return True
screen monologue(txt):
$ head, tail = txt[0], txt[1:] #splits off the first string in the array
$ time_elapsed = wait(2)
add Text(head,color='#FFF', slow_cps=20)# <-- different param sets speed independent of Preferences (1 letter per 2 seconds = v v slow ;) )
if time_elapsed: #if true, add more text. doesn't work though
add Text(tail,color='#FFF', slow_cps=20, substitute=True, ypos = 70)
label klausurergebnisse_1:
$ monologuetxt = ["sigh..... \n" , "wait then say something", "say something else \n"]
window hide
call screen monologue(monologuetxt)
hide screen monologue
How I tried to solve it is to first call the screen. In the screen I call a python function which just sleeps for t seconds, then returns True. The hope was that it would type the second set of text only after the time_elapsed variable was set to true. Unfortunately the wait() function stops the screen from displaying, and then displays everything at once. like: 1. call screen 2.wait 2s 3.type all text at once. I want: 1. call screen 2.type first sentence 3. wait 2s 4.write the rest