Page 1 of 1
[Solved] CTC Is Reformatting My Text
Posted: Wed Dec 08, 2021 5:10 am
by Zalor
As the title says, when I try to use ctc it dynamically reformats my text. Whether on ADV or NVL mode it does the same thing. Here are some pictures.
ADV reformatting:
Then when I hit enter to continue the line, it does this:
"221." went from the second line, back to the first line. It's worth noting that without using a ctc, everything naturally displays as it does in the second image. Meaning I have no idea why it clipped after "N.O." and placed "221" on another line (only to then return it to the first line).
On NVL mode it's the same exact same phenomenon. Something I should note however, is that my ctc is this "_", but it only shows up next to the text as you can see above if I set it to: ctc_position="nestled-close". If I set ctc_position="nestled", it shows beneath the text for some reason (and still reformats the text as well). For example like this:
and
I have no idea what is causing these problems, and I can't find anything in the gui.rpy or screens.rpy that deals with ctc so I don't know even know what settings I should fiddle around with. Here are the relevant bits of code from my script.rpy:
Code: Select all
define narrator = Character(color="#c8ffc8", kind=nvl, ctc="ctc", ctc_pause="ctc", ctc_position="nestled", who_bold=True, who_italic=True)
define d = Character(color="#f00", kind=adv, ctc="ctc", ctc_pause="ctc", ctc_position="nestled-close", who_bold=True, who_italic=True)
and
Code: Select all
image ctc:
contains:
Text("_")
alpha 1.0
pause 0.4
alpha 0
pause 0.4
alpha 1.0
repeat
Re: CTC Reformatting Text
Posted: Wed Dec 08, 2021 5:49 am
by Ocelot
1) How is your text displayed (actual line which causes text to appear with all tags)
2) What is the value of layout text style property? Did you ever change it to subtitle[/io] for any reason.
3) Make sure that all containers containing text in hierarch do not try to shrink to fit, because it can cause text displayable to change its width depending on amount of text.
Re: CTC Reformatting Text
Posted: Wed Dec 08, 2021 6:31 am
by Zalor
Ocelot wrote: ↑Wed Dec 08, 2021 5:49 am
1) How is your text displayed (actual line which causes text to appear with all tags)
2) What is the value of
layout text style property? Did you ever change it to
subtitle[/io] for any reason.
3) Make sure that all containers containing text in hierarch do not try to shrink to fit, because it can cause text displayable to change its width depending on amount of text.
1) I'm not entirely sure what you mean. Are you talking about the text from my script.rpy files? In that case this would be the excerpt that I used in my OP:
Code: Select all
label start:
scene template1 with Dissolve (2.0)
d "The current year is N.O. 221.{w} On February 13th at approximately 9:53 p.m. you passed away in a hospital bed."
show datacenter with Dissolve (2.0)
"Following the specifications of your Will, your consciousness was uploaded onto a server you reserved."
nvl clear
"For a period of 6 months your disembodied consciousness enjoyed idyllic uninterruption in a digital heaven.{w} A fantasy world selected by you."
nvl clear
"However, when your free 6 month trial of our afterlife Premium package expired you were automatically downgraded to our free service."
nvl clear
"Despite warnings to remain where you were until the downgrade completed.{w} You walked into a room that had not properly rendered in the midst of the transition."
"You are now in an unknown location."
nvl clear
2) I don't remember ever touching that stuff, but here is every instance of "layout" in my screens.rpy:
Code: Select all
style page_label_text:
text_align 0.5
layout "subtitle"
hover_color gui.hover_color
style history_text:
xpos gui.history_text_xpos
ypos gui.history_text_ypos
xanchor gui.history_text_xalign
xsize gui.history_text_width
min_width gui.history_text_width
text_align gui.history_text_xalign
layout ("subtitle" if gui.history_text_xalign else "tex")
style confirm_prompt_text:
text_align 0.5
layout "subtitle"
style nvl_dialogue:
xpos gui.nvl_text_xpos
xanchor gui.nvl_text_xalign
ypos gui.nvl_text_ypos
xsize gui.nvl_text_width
min_width gui.nvl_text_width
text_align gui.nvl_text_xalign
layout ("subtitle" if gui.nvl_text_xalign else "tex")
style nvl_thought:
xpos gui.nvl_thought_xpos
xanchor gui.nvl_thought_xalign
ypos gui.nvl_thought_ypos
xsize gui.nvl_thought_width
min_width gui.nvl_thought_width
text_align gui.nvl_thought_xalign
layout ("subtitle" if gui.nvl_text_xalign else "tex")
3) I'm sorry, what specifically should I check to confirm this part? I haven't changed very much in my screens.rpy, so I'll just list the sections that I did alter:
Code: Select all
screen choice(items):
style_prefix "choice"
vbox:
for i in items:
textbutton i.caption action i.action: #Original code didn't have a ":" after i.action, everything below is new to add a pause between choices
if len(items) > 0:
if items[0].caption == i.caption and items[0].action == i.action:
at choice_button_alpha1
if len(items) > 1:
if items[1].caption == i.caption and items[1].action == i.action:
at choice_button_alpha2
if len(items) > 2:
if items[2].caption == i.caption and items[2].action == i.action:
at choice_button_alpha3
if len(items) > 3:
if items[3].caption == i.caption and items[3].action == i.action:
at choice_button_alpha4
if len(items) > 4:
if items[4].caption == i.caption and items[4].action == i.action:
at choice_button_alpha5
if len(items) > 5:
if items[5].caption == i.caption and items[5].action == i.action:
at choice_button_alpha6
init -2:
transform choice_button_alpha1:
alpha 0.0
pause 0.0
ease 0.2 alpha 1.0
transform choice_button_alpha2:
alpha 0.0
pause 0.2
ease 0.2 alpha 1.0
transform choice_button_alpha3:
alpha 0.0
pause 0.4
ease 0.2 alpha 1.0
transform choice_button_alpha4:
alpha 0.0
pause 0.6
ease 0.2 alpha 1.0
transform choice_button_alpha5:
alpha 0.0
pause 0.8
ease 0.2 alpha 1.0
transform choice_button_alpha6:
alpha 0.0
pause 1.0
ease 0.2 alpha 1.0
style choice_vbox:
#This effects where the choices are placed on screen
xpos 250
ypos 500
####Former Code####
#xalign 0.5
#ypos 270
#yanchor 0.5
spacing gui.choice_spacing
screen nvl(dialogue, items=None):
window:
style "nvl_window"
has vbox:
spacing gui.nvl_spacing
null height 450
## Displays dialogue in either a vpgrid or the vbox.
if gui.nvl_height:
vpgrid:
cols 1
yinitial 1.0
use nvl_dialogue(dialogue)
else:
use nvl_dialogue(dialogue)
## Displays the menu, if given. The menu may be displayed incorrectly if
## config.narrator_menu is set to True, as it is above.
for i in items:
textbutton i.caption:
action i.action
style "nvl_button"
add SideImage() xalign 0.0 yalign 1.0
#style nvl_window:
#xfill True
#yfill True
#background "gui/nvl.png"
#padding gui.nvl_borders.padding
#style window:
#variant "small"
#background "gui/phone/textbox.png"
#style nvl_window:
#variant "small"
#background "gui/phone/nvl.png"
Re: CTC Reformatting Text
Posted: Wed Dec 08, 2021 6:51 am
by Ocelot
What happens if you return xfill True to the nvl_window style?
Re: CTC Reformatting Text
Posted: Wed Dec 08, 2021 7:10 am
by Zalor
Ocelot wrote: ↑Wed Dec 08, 2021 6:51 am
What happens if you return
xfill True to the nvl_window style?
So I went back and tried, and it didn't do anything. Specifically what I have now is:
Code: Select all
style nvl_window:
xfill True
yfill True
I also tried adding an xfill True statement in the screen nvl(dialogue, items=None) section:
Code: Select all
screen nvl(dialogue, items=None):
window:
style "nvl_window"
xfill True
But that didn't do anything either.
The only thing I know, is that if I don't include any ctc everything behaves as normal and as intended. I only started having these problems when I tried implementing ctc.
Re: CTC Is Reformatting My Text
Posted: Wed Dec 08, 2021 8:47 am
by Zalor
Update: I'm using the latest version of Renpy and I'm starting to think this might be a glitch outside of my control.
I've kept experimenting with this current project of mine, but with no results. So I decided to try to implement CTC into a VN I already made and released:
viewtopic.php?f=11&t=61379&p=539568#p539568
I didn't use any CTC in that original version, but I decided for the sake of experimenting to implement this:
Code: Select all
define narrator = Character(color="#c8ffc8", kind=nvl, ctc="ctc", ctc_position="nestled-close", who_bold=True, who_italic=True)
image ctc:
contains:
Text("_")
alpha 1.0
pause 0.4
alpha 0.0
pause 0.4
alpha 1.0
repeat
Despite having no formatting issues in that work, upon implementing the above code into the script.rpy I was immediately (from the first line) effected by the same exact reformatting glitch I detail in the OP. Tomorrow I'll try creating a completely blank slate file and testing on that, but I'm concerned that this problem might be rooted in a bug in the latest version of Renpy.
Re: CTC Is Reformatting My Text
Posted: Wed Dec 08, 2021 10:28 am
by Ocelot
Try to remove contains: from the image definition. It screws with text placement for me for some reason.
Re: CTC Is Reformatting My Text
Posted: Wed Dec 08, 2021 10:44 am
by Zalor
Ocelot wrote: ↑Wed Dec 08, 2021 10:28 am
Try to remove
contains: from the image definition. It screws with text placement for me for some reason.
Thank you so much! Yes, this was the exact source of the problem! Getting rid of "contains:" fixed everything.