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 make an epigraph that's more polished than "continuously reveal text at 24 cps". Of course, because I'm using a Text() displayable, tags like {w=2.0} have no effect.
"\"Polyphemus? Why do you cry so sore in the starry night? You will not let us sleep. Sure no man's driving off your flock? No man has tricked you, ruined you?\"\n...\n\"Nohbdy, Nohbdy's tricked me, Nohbdy's ruined me!\"\n\n—from {i}The Odyssey{/i} by Homer, translated by Robert Fitzgerald"
Is there some way to work around this? My first guess would be multiple Text()s, one for each "paragraph"/"line break", stacked on top of each other.
Last edited by 017Bluefield on Sun Jul 15, 2018 12:47 am, edited 1 time in total.
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
scene black
centered "{size=24}\"So God does play dice with the universe. All the evidence points to him being an inveterate gambler, who throws the dice on every possible occasion.\"{/size}\n{vspace=10}{size=15}{space=270}{i}– Stephen Hawking{/i}{/size}"
And this is how it looks on screen (click the image to enlarge):
This method lets you make use of any style/formatting tag that you want.
screen show_text(text=""):
# Every \n replaced by 48 0px wide spaces and a \n
#
$ text = text.replace("\n", "{space=0}"*48+"\n")
fixed:
text "[text]":
slow_cps 24
label start:
"Start"
show screen show_text("word\nword\nword\nword")
"End"
Alternatively, you could inline adjust the cps with "{cps=1}" or maybe "{cps=0.5}" for the first character of a line (or perhaps the slow ellipsis dots) then ramp it back up to 24 afterwards...
Imperf3kt wrote: ↑Fri Jun 22, 2018 9:54 pm
Work around what? You haven't really stated what it is that it does, which you are dissatisfied with.
Sorry about that.
What it does currently is that it makes the text appear, at a consistent 24 cps. That...doesn't really give the player much time to read the text before the epigraph fades out for the next part. What I'm trying to do is one of the following:
Add pauses in the text part of the Text() node (Check? The {cps=1} trick seems to work, if a bit clunky).
Figure out how to break up an epigraph into multiple Text() elements (one per "paragraph"), so that they line up vertically on the screen, and I can tweak them that way.
Add pauses in the text part of the Text() node (Check? The {cps=1} trick seems to work, if a bit clunky).
Figure out how to break up an epigraph into multiple Text() elements (one per "paragraph"), so that they line up vertically on the screen, and I can tweak them that way.
Plus, I'm trying to make it aligned to the left (e.g. align=0.0). Problem is, it stays in the truecenter, which might have something to do with the fact that any change to that align= results in absolutely no change.
image epigraph = Text("{cps=1}\"{/cps}Polyphemus?{cps=1} W{/cps}hy do you cry so sore in the starry night?{cps=1} Y{/cps}ou will not
let us sleep.{cps=1} S{/cps}ure[[ly] no man's driving off your flock?{cps=1} N{/cps}o man has tricked you,{cps=2} r{/cps}uined you?
\"\n{vspace=10}{cps=2} ... {vspace=10}{space=32}\"{/cps}Nohbdy[[!]{cps=1} N{/cps}ohbdy's tricked me,{cps=1} N{/cps}ohbdy's ruined me!\"
{cps=1}\n\n{space=90}{size=-14}—{/size}{/cps}{size=-14}from {i}The Odyssey{/i} by Homer,{cps=1} t{/cps}ranslated by Robert Fitzgerald{/size}",
color="#FFC",
size=30,
slow_cps=24,
first_indent=32)
I know you marked this solved, but I was going through the forums and wanted to chip in. I don't really see the need for Text() displayables when usually straight dialogue will do just as fine. Is there a specific reason that the Text() displayable is needed? Additionally, as a random player feedback bit: I ran your example and it was annoying me because of how slow it is.
init 9999: # this is only because I used centered, which is defined very late. I forget where, but 9999 is safest. You don't have to use it if you'd rather set the parameters from scratch, but it works well as a shortcut for this sort of thing.
define epi_speaker = Character(None, kind=centered, what_size=30, what_slow_cps=24, what_text_align=0.0, what_xalign=0.0, what_xpos=30, what_first_indent=32)
label start:
scene black
epi_speaker "{w=.5}\"Polyphemus? {w=.3}Why do you cry so sore in the starry night? {w=.3}You will not let us sleep. {w=.3}Sure[[ly] no man's driving off your flock? {w=.3}No man has tricked you, {w=.1}ruined you?\"\n{vspace=10} {cps=5}... {vspace=10}{space=32}{/cps}\"Nohbdy[[!] {w=.3}Nohbdy's tricked me, Nohbdy's ruined me!\"{w=.3} \n\n{space=90}{size=16}—from {i}The Odyssey{/i} by Homer, translated by Robert Fitzgerald{/size}"
init 9999: # this is only because I used centered, which is defined very late. I forget where, but 9999 is safest. You don't have to use it if you'd rather set the parameters from scratch, but it works well as a shortcut for this sort of thing.
define epi_speaker = Character(None, kind=centered, what_size=30, what_slow_cps=24, what_text_align=0.0, what_xalign=0.0, what_xpos=30, what_first_indent=32)
label start:
scene black
epi_speaker "{w=.5}\"Polyphemus? {w=.3}Why do you cry so sore in the starry night? {w=.3}You will not let us sleep. {w=.3}Sure[[ly] no man's driving off your flock? {w=.3}No man has tricked you, {w=.1}ruined you?\"\n{vspace=10} {cps=5}... {vspace=10}{space=32}{/cps}\"Nohbdy[[!] {w=.3}Nohbdy's tricked me, Nohbdy's ruined me!\"{w=.3} \n\n{space=90}{size=16}—from {i}The Odyssey{/i} by Homer, translated by Robert Fitzgerald{/size}"
While running game code:
File "game/script.rpy", line 12, in script
define epilogue_speaker = Character(None, kind=centered, what_size=30, what_slow_cps=24, what_text_align=0.0, what_xalign=0.0, what_xpos=30, what_first_indent=32)
File "game/script.rpy", line 12, in <module>
define epilogue_speaker = Character(None, kind=centered, what_size=30, what_slow_cps=24, what_text_align=0.0, what_xalign=0.0, what_xpos=30, what_first_indent=32)
NameError: name 'centered' is not defined
Okay, so, I tried it with centered, which...worked, yes, but it presented two problems that I don't think I brought up in the initial post:
The epigraph is part of a non-interactive sequence, meaning it has to play without the player having to touch anything until the whole sequence is over. This also means that Auto is active and the $ quick_menu is off (meaning the player can't set Auto during the sequence). Using centered like this means I was sitting there for a good 10 seconds, wondering why the epigraph was still there, before realizing "Oh crap, I forgot to set Auto."
Text()-made images allow me to use Dissolve() and other visual effects; centered (a dialogue-based Character()) does not. It just blacks the epigraph out, which is jarring in a sequence where there are other Text() images called in with dissolves.
While running game code:
File "game/script.rpy", line 272, in script
epigraph_speaker "{w=0.5}\"Polyphemus?{w=0.3} Why do you cry so sore in the starry night?{w=0.3} You will not let us sleep.{w=0.3} Sure[[ly] no man's driving off your flock?{w=0.3} No man has tricked you,{w=0.1} ruined you?\"\n{vspace=10}{cps=5} ...{vspace=10}{space=32}{/cps}\"Nohbdy[[!]{w=0.3} Nohbdy's tricked me,{w=0.3} Nohbdy's ruined me!\"{w=1.0}\n\n{space=90}{size=-4}—from {i}The Odyssey{/i} by Homer,{w=0.5} translated by Robert Fitzgerald{/size}"
Exception: Sayer 'epigraph_speaker' is not defined.
1. Typo, I assume. (epilogue_speaker and epigraph_speaker)
2. {nw} is available.
3. If you need effects, then yes, a displayable may be more suitable. You can dissolve in dialogue if need be, but it's probably not worth the hassle. So yes, if there is a good reason to use Text(), go ahead.