Chatroom-like layout in Ren'py?
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.
- madocallie
- Regular
- Posts: 44
- Joined: Tue May 14, 2013 1:57 am
- Completed: Bad Faith (DEMO), When We First Met, Party Favors
- Projects: Bad Faith (Full Release)
- itch: madocallie
- Location: UK
- Discord: madocallie#2937
- Contact:
Chatroom-like layout in Ren'py?
Hey, I haven't been on here in quite a while, but I've been planning to make another visual novel for a game jam!
One thing I'd like it to incorporate is chatroom-like dialogue in certain scenes.
Sorta like this: https://img.itch.zone/aW1hZ2UvMTQzODk ... wzN.png (from Brianna Lei's fantastic game Butterfly Soup!)
How should I go about coding it? I have a feeling I'd need to heavily edit NVL code or something, but I'm not quite sure...
One thing I'd like it to incorporate is chatroom-like dialogue in certain scenes.
Sorta like this: https://img.itch.zone/aW1hZ2UvMTQzODk ... wzN.png (from Brianna Lei's fantastic game Butterfly Soup!)
How should I go about coding it? I have a feeling I'd need to heavily edit NVL code or something, but I'm not quite sure...
- Kia
- Eileen-Class Veteran
- Posts: 1011
- Joined: Fri Aug 01, 2014 7:49 am
- Deviantart: KiaAzad
- Discord: Kia#6810
- Contact:
Re: Chatroom-like layout in Ren'py?
it seems NVL is the right choice, however, it shouldn't be that hard to make it look like chat, just add a frame around each "text d.what:" and it should look like the chat you want
- madocallie
- Regular
- Posts: 44
- Joined: Tue May 14, 2013 1:57 am
- Completed: Bad Faith (DEMO), When We First Met, Party Favors
- Projects: Bad Faith (Full Release)
- itch: madocallie
- Location: UK
- Discord: madocallie#2937
- Contact:
Re: Chatroom-like layout in Ren'py?
cool! that's good to know!
next question:
how would i go about adding icons/images like in the example above?
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3636
- Joined: Mon Dec 14, 2015 5:05 am
- Location: Your monitor
- Contact:
Re: Chatroom-like layout in Ren'py?
You can insert images in text using the {image=""} function
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Free Android GUI - Updated occasionally
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
- madocallie
- Regular
- Posts: 44
- Joined: Tue May 14, 2013 1:57 am
- Completed: Bad Faith (DEMO), When We First Met, Party Favors
- Projects: Bad Faith (Full Release)
- itch: madocallie
- Location: UK
- Discord: madocallie#2937
- Contact:
Re: Chatroom-like layout in Ren'py?
i know that can be done, but since a good portion of my game is going to take place in these chatrooms, is there a way to assign an image to a character instead of repeating the image over and over?
also just a quick question: where do i find the "text d. what:" parts of the code..?
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3636
- Joined: Mon Dec 14, 2015 5:05 am
- Location: Your monitor
- Contact:
Re: Chatroom-like layout in Ren'py?
You want to emulate emoticons, right?
All I can think of is {image="smiley.png"}
Or
All I can think of is {image="smiley.png"}
Or
Code: Select all
image smiley:
"smiley.png"
pause 0.5
"smiley2.png"
pause 0.5
repeat
{image="smiley"}Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Free Android GUI - Updated occasionally
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
- madocallie
- Regular
- Posts: 44
- Joined: Tue May 14, 2013 1:57 am
- Completed: Bad Faith (DEMO), When We First Met, Party Favors
- Projects: Bad Faith (Full Release)
- itch: madocallie
- Location: UK
- Discord: madocallie#2937
- Contact:
Re: Chatroom-like layout in Ren'py?
Imperf3kt wrote: ↑Thu Nov 02, 2017 5:57 pmYou want to emulate emoticons, right?
All I can think of is {image="smiley.png"}
Ori actually wanted to emulate user icons, but this is helpful too!Code: Select all
image smiley: "smiley.png" pause 0.5 "smiley2.png" pause 0.5 repeat {image="smiley"} [/quote]
- Divona
- Miko-Class Veteran
- Posts: 678
- Joined: Sun Jun 05, 2016 8:29 pm
- Completed: The Falconers: Moonlight
- Organization: Bionic Penguin
- itch: bionicpenguin
- Contact:
Re: Chatroom-like layout in Ren'py?
That will be under "screen nvl_dialogue" in "screens.rpy" file.madocallie wrote: ↑Thu Nov 02, 2017 4:49 pmalso just a quick question: where do i find the "text d. what:" parts of the code..?
- madocallie
- Regular
- Posts: 44
- Joined: Tue May 14, 2013 1:57 am
- Completed: Bad Faith (DEMO), When We First Met, Party Favors
- Projects: Bad Faith (Full Release)
- itch: madocallie
- Location: UK
- Discord: madocallie#2937
- Contact:
Re: Chatroom-like layout in Ren'py?
excellent! thanks so much!Divona wrote: ↑Thu Nov 02, 2017 10:51 pmThat will be under "screen nvl_dialogue" in "screens.rpy" file.madocallie wrote: ↑Thu Nov 02, 2017 4:49 pmalso just a quick question: where do i find the "text d. what:" parts of the code..?
just to ask again, but is there also a way of incorporating user icons into the chat too..? (like in the example above?)
- Divona
- Miko-Class Veteran
- Posts: 678
- Joined: Sun Jun 05, 2016 8:29 pm
- Completed: The Falconers: Moonlight
- Organization: Bionic Penguin
- itch: bionicpenguin
- Contact:
Re: Chatroom-like layout in Ren'py?
Perhaps you could assign an image to Character() and use that to add the image in front of the NVL text?
Then in "screens.rpy" under "screen nvl_dialogue":
Not a pretty as of now, but you get the idea.
Code: Select all
define d = Character("Divona", kind=nvl, icon="divona_avatar.png")
Code: Select all
screen nvl_dialogue(dialogue):
for d in dialogue:
window:
id d.window_id
fixed:
yfit gui.nvl_height is None
if "icon" in d.who_args:
add d.who_args["icon"] xalign 0.1
if d.who is not None:
text d.who:
id d.who_id
text d.what:
id d.what_id
- madocallie
- Regular
- Posts: 44
- Joined: Tue May 14, 2013 1:57 am
- Completed: Bad Faith (DEMO), When We First Met, Party Favors
- Projects: Bad Faith (Full Release)
- itch: madocallie
- Location: UK
- Discord: madocallie#2937
- Contact:
Re: Chatroom-like layout in Ren'py?
cool! i'm gonna test this out right now.Divona wrote: ↑Fri Nov 03, 2017 8:57 amPerhaps you could assign an image to Character() and use that to add the image in front of the NVL text?
Then in "screens.rpy" under "screen nvl_dialogue":Code: Select all
define d = Character("Divona", kind=nvl, icon="divona_avatar.png")
Not a pretty as of now, but you get the idea.Code: Select all
screen nvl_dialogue(dialogue): for d in dialogue: window: id d.window_id fixed: yfit gui.nvl_height is None if "icon" in d.who_args: add d.who_args["icon"] xalign 0.1 if d.who is not None: text d.who: id d.who_id text d.what: id d.what_id
back to the frame question by the way, but how exactly would i go about adding one to the code? I've been trying various ways without much success...
- Kia
- Eileen-Class Veteran
- Posts: 1011
- Joined: Fri Aug 01, 2014 7:49 am
- Deviantart: KiaAzad
- Discord: Kia#6810
- Contact:
Re: Chatroom-like layout in Ren'py?
try:
you might want to fiddle with the position and alignment to get it right though
Code: Select all
frame:
text d.what:
id d.what_id- madocallie
- Regular
- Posts: 44
- Joined: Tue May 14, 2013 1:57 am
- Completed: Bad Faith (DEMO), When We First Met, Party Favors
- Projects: Bad Faith (Full Release)
- itch: madocallie
- Location: UK
- Discord: madocallie#2937
- Contact:
Re: Chatroom-like layout in Ren'py?
how would i go about customizing it? i also want to add custom textboxes specifically for these scenes...Kia wrote: ↑Fri Nov 03, 2017 10:56 amtry:you might want to fiddle with the position and alignment to get it right thoughCode: Select all
frame: text d.what: id d.what_id
- Kia
- Eileen-Class Veteran
- Posts: 1011
- Joined: Fri Aug 01, 2014 7:49 am
- Deviantart: KiaAzad
- Discord: Kia#6810
- Contact:
Re: Chatroom-like layout in Ren'py?
here's a striped down nvl screen you can start with:madocallie wrote: ↑Fri Nov 03, 2017 2:01 pmhow would i go about customizing it? i also want to add custom textboxes specifically for these scenes...
Code: Select all
screen nvl(dialogue, items=None):
window:
xsize 1000 xalign .5
style "nvl_window"
vbox:
spacing 40
use nvl_dialogue(dialogue)
for i in items:
textbutton i.caption:
action i.action
style "nvl_button"
add SideImage() xalign 0.0 yalign 1.0
screen nvl_dialogue(dialogue):
for d in dialogue:
window:
id d.window_id
hbox:
xsize 1000 xalign 1.0
if d.who is not None:
frame:
xsize 300 background None
text d.who:
xalign 1.0
id d.who_id
frame:
xalign 1.0 xsize 800
text d.what:
align(.5,.5)
id d.what_id
define config.nvl_list_length = 10
- madocallie
- Regular
- Posts: 44
- Joined: Tue May 14, 2013 1:57 am
- Completed: Bad Faith (DEMO), When We First Met, Party Favors
- Projects: Bad Faith (Full Release)
- itch: madocallie
- Location: UK
- Discord: madocallie#2937
- Contact:
Re: Chatroom-like layout in Ren'py?
Thanks so much!Kia wrote: ↑Fri Nov 03, 2017 3:32 pmhere's a striped down nvl screen you can start with:madocallie wrote: ↑Fri Nov 03, 2017 2:01 pmhow would i go about customizing it? i also want to add custom textboxes specifically for these scenes...you'll have to delete all of the styles for this screen and start styling every element from scratch. if you don't know how, you need to read through https://www.renpy.org/doc/html/style.html and https://www.renpy.org/doc/html/screens.htmlCode: Select all
screen nvl(dialogue, items=None): window: xsize 1000 xalign .5 style "nvl_window" vbox: spacing 40 use nvl_dialogue(dialogue) for i in items: textbutton i.caption: action i.action style "nvl_button" add SideImage() xalign 0.0 yalign 1.0 screen nvl_dialogue(dialogue): for d in dialogue: window: id d.window_id hbox: xsize 1000 xalign 1.0 if d.who is not None: frame: xsize 300 background None text d.who: xalign 1.0 id d.who_id frame: xalign 1.0 xsize 800 text d.what: align(.5,.5) id d.what_id define config.nvl_list_length = 10
Who is online
Users browsing this forum: Google [Bot]

