Display a chat-like interface alongside dialogue? [Solved]
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.
- Fuu
- Newbie
- Posts: 18
- Joined: Tue Mar 03, 2015 3:10 pm
- Completed: 404 Error: Connection Not Found Demo, NAOMI, Simple Answers
- Projects: 404 Error: Connection Not Found, Ashes//Dust
- Organization: CODE:Phantasm, Paper Star Studios
- Tumblr: Rottenadel
- itch: Codephantasm
- Contact:
Display a chat-like interface alongside dialogue? [Solved]
Is it possible to have both NVL and regular textbox (is this called ADV?) at the same time? I'm trying to replicate something like what I have drawn out below (pardon the language).
Basically I want the dialogue (left side) to run independently of the chatbox (right side). Is this possible? It doesn't necessarily have to be NVL/ADV.
Basically I want the dialogue (left side) to run independently of the chatbox (right side). Is this possible? It doesn't necessarily have to be NVL/ADV.
Last edited by Fuu on Tue Jul 11, 2017 11:49 am, edited 1 time in total.
- vollschauer
- Veteran
- Posts: 231
- Joined: Sun Oct 11, 2015 9:38 am
- Github: vollschauer
- Contact:
Re: Displaying textbox and NVL at the same time?
Short answer would be no it's not possible... you can one set one kind (NVL or ADL) to your character. But what you can do is that you stay with the default ADL and create you own screen for the chat window... or your design a new say screen with 2 different window...maybe the better choice.
- Fuu
- Newbie
- Posts: 18
- Joined: Tue Mar 03, 2015 3:10 pm
- Completed: 404 Error: Connection Not Found Demo, NAOMI, Simple Answers
- Projects: 404 Error: Connection Not Found, Ashes//Dust
- Organization: CODE:Phantasm, Paper Star Studios
- Tumblr: Rottenadel
- itch: Codephantasm
- Contact:
Re: Displaying textbox and NVL at the same time?
Would you know of a way to do that, or could you point me to a guide? Sorry I'm having a hard time finding one on here.
- chocoberrie
- Veteran
- Posts: 254
- Joined: Wed Jun 19, 2013 10:34 pm
- Projects: Marshmallow Days
- Contact:
Re: Displaying textbox and NVL at the same time?
I'm curious to see how this can work! It sounds like an interesting game mechanic.
Here's the documentation about the say screen: https://www.renpy.org/doc/html/screen_s ... me-screens
And here's the documentation about screen language, which includes the kinds of things that go in the say screen: https://www.renpy.org/doc/html/screens.html
I also found this thread: viewtopic.php?f=8&t=41047 that seems to ask the same question you're asking here!
Here's the documentation about the say screen: https://www.renpy.org/doc/html/screen_s ... me-screens
And here's the documentation about screen language, which includes the kinds of things that go in the say screen: https://www.renpy.org/doc/html/screens.html
I also found this thread: viewtopic.php?f=8&t=41047 that seems to ask the same question you're asking here!
- Fuu
- Newbie
- Posts: 18
- Joined: Tue Mar 03, 2015 3:10 pm
- Completed: 404 Error: Connection Not Found Demo, NAOMI, Simple Answers
- Projects: 404 Error: Connection Not Found, Ashes//Dust
- Organization: CODE:Phantasm, Paper Star Studios
- Tumblr: Rottenadel
- itch: Codephantasm
- Contact:
Re: Displaying textbox and NVL at the same time?
I did look over those links! I appreciate the help.chocoberrie wrote:I'm curious to see how this can work! It sounds like an interesting game mechanic.
Here's the documentation about the say screen: https://www.renpy.org/doc/html/screen_s ... me-screens
And here's the documentation about screen language, which includes the kinds of things that go in the say screen: https://www.renpy.org/doc/html/screens.html
I also found this thread: viewtopic.php?f=8&t=41047 that seems to ask the same question you're asking here!
One thing I'm running into is that I really have no idea how to customize the vbox for text as it says. I want to be able to post in the window like I would normal say dialogue.
Example:
Code: Select all
character "This text goes in the normal say dialogue box."
chatroom1 "This text goes in the chat window but doesn't make the say window disappear."
chatroom 2 "This goes beneath the last line of dialogue in the chat window."
character "The chat window stays on the screen and you can see my thoughts on the matter!"
- Milkymalk
- Miko-Class Veteran
- Posts: 753
- Joined: Wed Nov 23, 2011 5:30 pm
- Completed: Don't Look (AGS game)
- Projects: KANPEKI! ★Perfect Play★
- Organization: Crappy White Wings
- Location: Germany
- Contact:
Re: Displaying textbox and NVL at the same time?
You could make a viewport inside a screen and display a list inside it:
Whenever you want something to appear in the chat, you would instead do
This is all untested and not guaranteed to work without bugfixing, but it's how I would start with this.
Code: Select all
python:
class Message:
def __init__(self, name, message):
self.name = name
self.message = message
class Chatlog:
def __init__(self):
self.history = []
def addmessage(self, name, message):
self.history.append(Message(name, message))
def delchat(self):
self.history = []
screen chatdisplay:
frame:
viewport id "chatwindow":
mousewheel True
side_area (100, 100, 300, 600)
yinitial 0.0
scrollbars "vertical"
hbox:
vbox:
for i in chat.history:
text i.name
vbox:
for i in chat.history:
text i.message
init:
default chat = Chatlog()
Code: Select all
$ chat.addmessage("Ren", "Hi, is anybody online?")
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)
- Fuu
- Newbie
- Posts: 18
- Joined: Tue Mar 03, 2015 3:10 pm
- Completed: 404 Error: Connection Not Found Demo, NAOMI, Simple Answers
- Projects: 404 Error: Connection Not Found, Ashes//Dust
- Organization: CODE:Phantasm, Paper Star Studios
- Tumblr: Rottenadel
- itch: Codephantasm
- Contact:
Re: Displaying textbox and NVL at the same time?
I get the following error when I try this.
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "renpy/common/00start.rpy", line 178, in script
python:
File "renpy/common/00start.rpy", line 179, in <module>
renpy.execute_default_statement(True)
File "game/screens.rpy", line 596, in set_default
default chat = Chatlog()
File "game/screens.rpy", line 596, in <module>
default chat = Chatlog()
NameError: name 'Chatlog' is not defined
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "C:\Users\Adelei\Dropbox\Paper Star Studios\Ren'Py Engine and Tools\renpy-6.99.12.4-sdk\renpy\bootstrap.py", line 295, in bootstrap
renpy.main.main()
File "C:\Users\Adelei\Dropbox\Paper Star Studios\Ren'Py Engine and Tools\renpy-6.99.12.4-sdk\renpy\main.py", line 487, in main
run(restart)
File "C:\Users\Adelei\Dropbox\Paper Star Studios\Ren'Py Engine and Tools\renpy-6.99.12.4-sdk\renpy\main.py", line 147, in run
renpy.execution.run_context(True)
File "C:\Users\Adelei\Dropbox\Paper Star Studios\Ren'Py Engine and Tools\renpy-6.99.12.4-sdk\renpy\execution.py", line 761, in run_context
context.run()
File "renpy/common/00start.rpy", line 178, in script
python:
File "C:\Users\Adelei\Dropbox\Paper Star Studios\Ren'Py Engine and Tools\renpy-6.99.12.4-sdk\renpy\ast.py", line 814, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "C:\Users\Adelei\Dropbox\Paper Star Studios\Ren'Py Engine and Tools\renpy-6.99.12.4-sdk\renpy\python.py", line 1719, in py_exec_bytecode
exec bytecode in globals, locals
File "renpy/common/00start.rpy", line 179, in <module>
renpy.execute_default_statement(True)
File "C:\Users\Adelei\Dropbox\Paper Star Studios\Ren'Py Engine and Tools\renpy-6.99.12.4-sdk\renpy\exports.py", line 3108, in execute_default_statement
i.set_default(start)
File "game/screens.rpy", line 596, in set_default
default chat = Chatlog()
File "C:\Users\Adelei\Dropbox\Paper Star Studios\Ren'Py Engine and Tools\renpy-6.99.12.4-sdk\renpy\python.py", line 1743, in py_eval_bytecode
return eval(bytecode, globals, locals)
File "game/screens.rpy", line 596, in <module>
default chat = Chatlog()
NameError: name 'Chatlog' is not defined
Windows-8-6.2.9200
Ren'Py 6.99.12.4.2187
404 0.0
- Milkymalk
- Miko-Class Veteran
- Posts: 753
- Joined: Wed Nov 23, 2011 5:30 pm
- Completed: Don't Look (AGS game)
- Projects: KANPEKI! ★Perfect Play★
- Organization: Crappy White Wings
- Location: Germany
- Contact:
Re: Displaying textbox and NVL at the same time?
Sorry, I should have seen that. Change "python:" into "init python:" The problem is the order of things, the classes need to be defined before that line with "default" is executed.
Maybe it's also necessary to change all "class Blah:" into "class Blah(object):"
Maybe it's also necessary to change all "class Blah:" into "class Blah(object):"
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)
- Fuu
- Newbie
- Posts: 18
- Joined: Tue Mar 03, 2015 3:10 pm
- Completed: 404 Error: Connection Not Found Demo, NAOMI, Simple Answers
- Projects: 404 Error: Connection Not Found, Ashes//Dust
- Organization: CODE:Phantasm, Paper Star Studios
- Tumblr: Rottenadel
- itch: Codephantasm
- Contact:
Re: Displaying textbox and NVL at the same time?
You may be right. I'm getting the following error now.Milkymalk wrote:Sorry, I should have seen that. Change "python:" into "init python:" The problem is the order of things, the classes need to be defined before that line with "default" is executed.
Maybe it's also necessary to change all "class Blah:" into "class Blah(object):"
Code: Select all
I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.
File "game/screens.rpy", line 565: expected statement.
class Message:
^
File "game/screens.rpy", line 570: expected statement.
class Chatlog:
^
Ren'Py Version: Ren'Py 6.99.12.4.2187
EDIT: Also it seems changing the first line to "init python:" causes the game to not go past the start menu.
- Milkymalk
- Miko-Class Veteran
- Posts: 753
- Joined: Wed Nov 23, 2011 5:30 pm
- Completed: Don't Look (AGS game)
- Projects: KANPEKI! ★Perfect Play★
- Organization: Crappy White Wings
- Location: Germany
- Contact:
Re: Displaying textbox and NVL at the same time?
Sorry, tired. Will try to get it to run by myself after sleep
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)
- Fuu
- Newbie
- Posts: 18
- Joined: Tue Mar 03, 2015 3:10 pm
- Completed: 404 Error: Connection Not Found Demo, NAOMI, Simple Answers
- Projects: 404 Error: Connection Not Found, Ashes//Dust
- Organization: CODE:Phantasm, Paper Star Studios
- Tumblr: Rottenadel
- itch: Codephantasm
- Contact:
Re: Displaying textbox and NVL at the same time?
Thank you so much for the help!
I switched from Legacy screens to the updated one and the errors cleared, however when I use the $ chat.addmessage bit in the script, nothing happens and the game just skips over it.
I switched from Legacy screens to the updated one and the errors cleared, however when I use the $ chat.addmessage bit in the script, nothing happens and the game just skips over it.
- Milkymalk
- Miko-Class Veteran
- Posts: 753
- Joined: Wed Nov 23, 2011 5:30 pm
- Completed: Don't Look (AGS game)
- Projects: KANPEKI! ★Perfect Play★
- Organization: Crappy White Wings
- Location: Germany
- Contact:
Re: Displaying textbox and NVL at the same time?
Dumb question: Did you show the screen?
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)
- Fuu
- Newbie
- Posts: 18
- Joined: Tue Mar 03, 2015 3:10 pm
- Completed: 404 Error: Connection Not Found Demo, NAOMI, Simple Answers
- Projects: 404 Error: Connection Not Found, Ashes//Dust
- Organization: CODE:Phantasm, Paper Star Studios
- Tumblr: Rottenadel
- itch: Codephantasm
- Contact:
Re: Displaying textbox and NVL at the same time?
welp, I feel like a bloody idiot. After all the fiddling that's what was wrong!Milkymalk wrote:Dumb question: Did you show the screen?
Thank you so much for helping with this!
- Milkymalk
- Miko-Class Veteran
- Posts: 753
- Joined: Wed Nov 23, 2011 5:30 pm
- Completed: Don't Look (AGS game)
- Projects: KANPEKI! ★Perfect Play★
- Organization: Crappy White Wings
- Location: Germany
- Contact:
Re: Displaying textbox and NVL at the same time?
So it works now?
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)
- Fuu
- Newbie
- Posts: 18
- Joined: Tue Mar 03, 2015 3:10 pm
- Completed: 404 Error: Connection Not Found Demo, NAOMI, Simple Answers
- Projects: 404 Error: Connection Not Found, Ashes//Dust
- Organization: CODE:Phantasm, Paper Star Studios
- Tumblr: Rottenadel
- itch: Codephantasm
- Contact:
Re: Displaying textbox and NVL at the same time?
It appears to! I haven't been able to do extensive testing yet but it's displaying as I wanted. I take it I would customize this as a viewport?Milkymalk wrote:
So it works now?
Who is online
Users browsing this forum: Google [Bot]