Having the textbox change midgame
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.
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.
Having the textbox change midgame
I looked a lot and I probably wasn't typing the right keywords because I couldn't find anything. Is changing the textbox at certain places in the game/script possible? I hope this isn't a stupid question and I'm sorry if I'm not being clear.
- usul
- Veteran
- Posts: 415
- Joined: Mon Oct 29, 2007 12:35 pm
- Projects: Teachings of the Buddha, System-Addict, Generation XxX
- Location: Quebec
- Contact:
Re: Having the textbox change midgame
The text box is set up in the options file. If you can change it mid-game I don't know how.
"The universe is non-simultaneously apprehended"
— Buckminster Fuller
— Buckminster Fuller
-
- Eileen-Class Veteran
- Posts: 1265
- Joined: Fri Aug 31, 2007 7:02 am
- Projects: 0 completed game. Still haven't made any meaningfully completed games...
- Contact:
Re: Having the textbox change midgame
It depends, what do you want to change?Alphonse wrote:Is changing the textbox at certain places in the game/script possible?
I suspect somebody is stealing my internet identity so don't believe everything I tell you via messages. I don't post or send messages anymore so don't believe anything I tell you via messages or posts.
Re: Having the textbox change midgame
What you could do is use Style Customization to create a style that inherits from style.say_dialogue for each different style that you want.
Then, say you created style.say_dialogue_act1 and style.say_dialogue_act2. One way you could make it so that after a certain point the dialogue box changes is to define each character twice - once for act 1 and once for act 2.
For the Character for act 1, you set what_style=style.say_dialogue_act1,
and for the Character for act 2, you set what_style=style.say_dialogue_act2.
Then, for all the lines in act 1, you could, for example, say:
eileen_act1 "Hello!"
lucy_act1 "Hi."
and then in act 2:
eileen_act2 "I have slain the dragon."
dragon_act2 ":("
There might be another way hidden deep in the depths of the config file, but this'll probably work if you can figure out how to customize styles using the Style function.
Then, say you created style.say_dialogue_act1 and style.say_dialogue_act2. One way you could make it so that after a certain point the dialogue box changes is to define each character twice - once for act 1 and once for act 2.
For the Character for act 1, you set what_style=style.say_dialogue_act1,
and for the Character for act 2, you set what_style=style.say_dialogue_act2.
Then, for all the lines in act 1, you could, for example, say:
eileen_act1 "Hello!"
lucy_act1 "Hi."
and then in act 2:
eileen_act2 "I have slain the dragon."
dragon_act2 ":("
There might be another way hidden deep in the depths of the config file, but this'll probably work if you can figure out how to customize styles using the Style function.
- PyTom
- Ren'Py Creator
- Posts: 16113
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Having the textbox change midgame
Perhaps another way would be to use a ConditionSwitch as the value of style.window.background. This would let one change the background based on a variable.
Code: Select all
init python:
style.window.background = ConditionSwitch(
"frame == 1", Frame("frame_1.png", 10, 10),
"frame == 2", Frame("frame_2.png", 10, 10),
)
label start:
$ frame = 1
"This uses the first frame style."
$ frame = 2
"This uses the second frame style."
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
Re: Having the textbox change midgame
@JQuartz: Just the appearance.
@Dusty: ? That sounds a little complicated. So every time I had a scene with the different textboxes. I'd have to use different Character things? But this would be useful, if I didn't want to change textboxes. I'm sure this will come in handy eventually!
@PyTom: This ConditionSwitch of yours...how long has this been in existence?
I looked it up just now and, oh my God, if this does what I think it does, how was I living without this?! I think I'm in love. Is it legal in the States for a minor to marry a piece of code?
Thank you all for your help and for all of you not going into confusing programmer-talk! -tears of joy-
@Dusty: ? That sounds a little complicated. So every time I had a scene with the different textboxes. I'd have to use different Character things? But this would be useful, if I didn't want to change textboxes. I'm sure this will come in handy eventually!
@PyTom: This ConditionSwitch of yours...how long has this been in existence?
![Shocked :shock:](./images/smilies/icon_eek.gif)
Thank you all for your help and for all of you not going into confusing programmer-talk! -tears of joy-
-
- Regular
- Posts: 69
- Joined: Thu May 07, 2009 4:16 pm
- Projects: The Stolen Diamond Ring (a mystery VN)
- Contact:
Re: Having the textbox change midgame
I'm trying to achieve something similiar but even after reading all the posts in this and a few relevant threads I'm still not able to make a paragraph with alignment set to centered sit in the middle of the dialogue box.
So far I found out how to have the text centered in the middle of the screen: by using the "centered" command before the text. This is basically way above the dialogue window background + it also makes the dialogue window itself disappear.
For now I'm just trying to change the appearance of the text, not the actual background / frame around it.
In the project I'm working on it should be like this:
![Image](http://i41.tinypic.com/6q8t1x.jpg)
![Image](http://i42.tinypic.com/15wf637.jpg)
So the question is: how do I align a block of text centrally within the dialogue box?
So far I found out how to have the text centered in the middle of the screen: by using the "centered" command before the text. This is basically way above the dialogue window background + it also makes the dialogue window itself disappear.
For now I'm just trying to change the appearance of the text, not the actual background / frame around it.
In the project I'm working on it should be like this:
![Image](http://i41.tinypic.com/6q8t1x.jpg)
![Image](http://i42.tinypic.com/15wf637.jpg)
So the question is: how do I align a block of text centrally within the dialogue box?
-
- Eileen-Class Veteran
- Posts: 1265
- Joined: Fri Aug 31, 2007 7:02 am
- Projects: 0 completed game. Still haven't made any meaningfully completed games...
- Contact:
Re: Having the textbox change midgame
This should work:RayRayTea wrote:how do I align a block of text centrally within the dialogue box?
Code: Select all
init:
$ narrator=Character(None,show_say_vbox_properties=dict(xalign=0.5),what_text_align=0.5)
label start:
"Lorem ipsum dolor sit amet\nsadipscing ialura est.\nDolr sit, manea tanea."
I suspect somebody is stealing my internet identity so don't believe everything I tell you via messages. I don't post or send messages anymore so don't believe anything I tell you via messages or posts.
-
- Regular
- Posts: 69
- Joined: Thu May 07, 2009 4:16 pm
- Projects: The Stolen Diamond Ring (a mystery VN)
- Contact:
Re: Having the textbox change midgame
Thanks, that's exactly what I was looking for.
- SeventhHeart
- Newbie
- Posts: 19
- Joined: Mon May 08, 2017 8:01 pm
- Projects: Eternal Hour, Quantum Magica
- Organization: Seventh Heart Studios
- Soundcloud: seventh-heart-studio
- Location: Romania
- Contact:
Re: Having the textbox change midgame
Managed to implement this, super neat feature! ![Very Happy :D](./images/smilies/icon_biggrin.gif)
![Very Happy :D](./images/smilies/icon_biggrin.gif)
Who is online
Users browsing this forum: Google [Bot]