Basic Message System
Forum rules
Do not post questions here!
This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Do not post questions here!
This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Re: Basic Message System
Thank you very much for sharing this!!
I was wondering if there's a way to make the area for the message and the links to the message be separate screens?
I was wondering if there's a way to make the area for the message and the links to the message be separate screens?
- saguaro
- Miko-Class Veteran
- Posts: 560
- Joined: Sun Feb 12, 2012 9:17 am
- Completed: Locked-In, Sunrise, The Censor
- Organization: Lucky Special Games
- itch: saguarofoo
- Location: USA
- Contact:
Re: Basic Message System
Probably what you want is to put them in different types of containers (hbox, vbox) or change the styling. Check out screen language and style properties in the documentation.
- balldancing
- Regular
- Posts: 65
- Joined: Tue Sep 03, 2013 9:32 am
- Location: milan
- Contact:
Re: Basic Message System
Hi there!! This is absolutely perfect and a dream come true.
A few questions if you don't mind ^^ I used the basic in-message system before this and I'm really bad with coding, but to achieve this kind of layout for my inbox, I defined styles and then changed the style values to shape and shop the whole thing with this:
I understand there are styles at the bottom of messages.rpy, but they're a bit vague and I can't seem to piece the styles together with the coding like I did with the other... I really would like to achieve the layout I linked earlier but with this messaging system because the reply idea is really neat *-*
A few questions if you don't mind ^^ I used the basic in-message system before this and I'm really bad with coding, but to achieve this kind of layout for my inbox, I defined styles and then changed the style values to shape and shop the whole thing with this:
Code: Select all
style.messageWindow = Style(style.window)
style.messageColumns = Style(style.hbox)
style.messageListBox = Style(style.vbox)
style.messageListViewport = Style(style.viewport)
style.messageButton = Style(style.button)
style.messageButtonText = Style(style.button_text)
style.messageScrollBar = Style(style.vscrollbar)
style.messageBodyScrollBar = Style(style.vscrollbar)
style.messageBodyBox = Style(style.vbox)
style.messageBodyViewport = Style(style.viewport)
style.messageText = Style(style.say_dialogue)
style.messageControls = Style(style.hbox)
-
- Newbie
- Posts: 12
- Joined: Mon May 19, 2014 10:45 pm
- Contact:
Re: Basic Message System
Hi,
Is there a way to incorporate some sort contact list? I want to be able to add some senders to the list and be able to compose new messages to said contacts. Would it be too hard and/or complex?
Is there a way to incorporate some sort contact list? I want to be able to add some senders to the list and be able to compose new messages to said contacts. Would it be too hard and/or complex?
- saguaro
- Miko-Class Veteran
- Posts: 560
- Joined: Sun Feb 12, 2012 9:17 am
- Completed: Locked-In, Sunrise, The Censor
- Organization: Lucky Special Games
- itch: saguarofoo
- Location: USA
- Contact:
Re: Basic Message System
I thought others might also be interested in that feature so I updated the system with a draft feature and I added the queue and a few other things while I was at it. I hope that helps.
-
- Newbie
- Posts: 12
- Joined: Mon May 19, 2014 10:45 pm
- Contact:
Re: Basic Message System
Awesome! I'll look into it right now.
Meanwhile, I tinkered with the code to add a delete confirmation. Do you think it'd be a good way to do it like so?I'm trying to learn to code Ren'Py, and by extension, Python. I tried this and it works, but perhaps there's a better way to go about it?
Meanwhile, I tinkered with the code to add a delete confirmation. Do you think it'd be a good way to do it like so?
Code: Select all
screen mailbox_commands:
hbox:
...
if current_message:
textbutton "Delete" action [Show("yesno_prompt",message="Delete message?",yes_action=current_message.delete,Hide("yesno_prompt")],no_action=Hide("yesno_prompt")), SetScreenVariable("current_message", None)]
- saguaro
- Miko-Class Veteran
- Posts: 560
- Joined: Sun Feb 12, 2012 9:17 am
- Completed: Locked-In, Sunrise, The Censor
- Organization: Lucky Special Games
- itch: saguarofoo
- Location: USA
- Contact:
Re: Basic Message System
The only other way I can think of would be to make a custom popup, which is only really necessary if you need the confirmation to be styled differently than the yes/no screen.
-
- Newbie
- Posts: 12
- Joined: Mon May 19, 2014 10:45 pm
- Contact:
Re: Basic Message System
Hmm, custom popup. I'll probably try it this weekend.
Can you tell me why I can't send current_message.subject into yesno_prompt's message? This fails with a weird, weird error which I don't have on hand. I discarded the idea and just went with "Delete message".
Can you tell me why I can't send current_message.subject into yesno_prompt's message?
Code: Select all
Show("yesno_prompt",message="Delete [current_message.subject]?",yes_action=current_message.delete,Hide("yesno_prompt")
-
- Eileen-Class Veteran
- Posts: 1258
- Joined: Fri Sep 21, 2007 7:13 am
- Projects: a battle engine
- Contact:
Re: Basic Message System
Yeah, no dots in renpy substitution. Don't use renpy substitution, use python substitutionstorymasterq wrote:Hmm, custom popup. I'll probably try it this weekend.
Can you tell me why I can't send current_message.subject into yesno_prompt's message?This fails with a weird, weird error which I don't have on hand. I discarded the idea and just went with "Delete message".Code: Select all
Show("yesno_prompt",message="Delete [current_message.subject]?",yes_action=current_message.delete,Hide("yesno_prompt")
"Delete %s?" % current_message.subject
-
- Newbie
- Posts: 12
- Joined: Mon May 19, 2014 10:45 pm
- Contact:
Re: Basic Message System
Oh, yay! Knowledge! Thanks, Asceai!
Proofreading for Free - here - Current project(s): None
Currently working on: My first VN, a futuristic slice-of-life with a hint of romance.
Currently working on: My first VN, a futuristic slice-of-life with a hint of romance.
-
- Newbie
- Posts: 12
- Joined: Mon May 19, 2014 10:45 pm
- Contact:
Re: Basic Message System
Me again, sorry for double posting.
I wanted to ask you to do this for me, but I found it to be such good programming practice, I did it myself
Here's a little addition to the Messaging system, Attachments!I also added a little space between the mail header and body, just to see it better.
The attachment is a tuple of "Attachment text", such as "NotVirus.exe", and "Label_text", which is where Ren'Py should jump to upon clicking the attachment. So, usage would be something like this
So, what do you think?
I wanted to ask you to do this for me, but I found it to be such good programming practice, I did it myself
Here's a little addition to the Messaging system, Attachments!
Code: Select all
def __init__(self, subject, sender, body, reply_label=False, delay=False, view=True, read=False, attach=False):
...
self.read = read
self.attach = attach
...
Code: Select all
def add_message(subject, sender, body, reply_label=False, delay=False, attach=False):
message = Mail(subject, sender, body, reply_label, delay, attach=attach)
Code: Select all
...
if current_message:
vbox spacing 10:
vbox:
text ("From: " + current_message.sender)
text ("Subject: " + current_message.subject)
if current_message.attach:
hbox xalign 0 spacing 10:
text ("Attachment: ")
textbutton (current_message.attach[0]) action Jump(current_message.attach[1])
text current_message.body
vbar value YScrollValue("view_message")
use mailbox_commands
Code: Select all
add_message("Needs something enlarged?", "Penlargement", "Get yourself some woo, hoo", attach=["NotVirus.exe","attach_notvirus"])
Proofreading for Free - here - Current project(s): None
Currently working on: My first VN, a futuristic slice-of-life with a hint of romance.
Currently working on: My first VN, a futuristic slice-of-life with a hint of romance.
- saguaro
- Miko-Class Veteran
- Posts: 560
- Joined: Sun Feb 12, 2012 9:17 am
- Completed: Locked-In, Sunrise, The Censor
- Organization: Lucky Special Games
- itch: saguarofoo
- Location: USA
- Contact:
Re: Basic Message System
For broader usage, two things I would consider are the jump action and modal.
Once the player jumps to a label, how do they get back to where they were in the script? The inbox is a modal screen, so once they click the attachment... what happens? In the case of a virus-type attachment that is supposed to mess with the screen, we can manually hide the mailbox in the label, but what about an attachment of a image or a text document, for example?
So I guess the question is if you'd like people to be able to attach different "types" of attachments.
Once the player jumps to a label, how do they get back to where they were in the script? The inbox is a modal screen, so once they click the attachment... what happens? In the case of a virus-type attachment that is supposed to mess with the screen, we can manually hide the mailbox in the label, but what about an attachment of a image or a text document, for example?
So I guess the question is if you'd like people to be able to attach different "types" of attachments.
-
- Newbie
- Posts: 12
- Joined: Mon May 19, 2014 10:45 pm
- Contact:
Re: Basic Message System
Hmm, alright, so something to the effect of call_in_new_context with a return, then?
Attachments of images or text should be handled by the called label, either by displaying the image or narrating the text.
Attachments of images or text should be handled by the called label, either by displaying the image or narrating the text.
Proofreading for Free - here - Current project(s): None
Currently working on: My first VN, a futuristic slice-of-life with a hint of romance.
Currently working on: My first VN, a futuristic slice-of-life with a hint of romance.
Re: Basic Message System
First of all, I really like this new message system. I've been using the old one for a while, and this one works much better overall.
I'm trying to implement a "Refresh" button. That is, you click the button, and it adds new messages. The idea here is to add a few more messages with each refresh, allowing an email conversation to develop slowly. I'm trying to use the "add_now" function to do it, but it's not working too great. I don't want to have to exit out of the inbox and advance the main text each time I want to add more messages. Alternatively, if there's a way to add messages instantly after I use the Exit button, I can make that work.
Any tips on how to approach this? Thanks!
I'm trying to implement a "Refresh" button. That is, you click the button, and it adds new messages. The idea here is to add a few more messages with each refresh, allowing an email conversation to develop slowly. I'm trying to use the "add_now" function to do it, but it's not working too great. I don't want to have to exit out of the inbox and advance the main text each time I want to add more messages. Alternatively, if there's a way to add messages instantly after I use the Exit button, I can make that work.
Any tips on how to approach this? Thanks!
Re: Basic Message System
I've discovered that if you open a message longer than the message viewport, scroll to the bottom, then view another message that's also long, the viewport will remain scrolled down instead of reset to the top.
I can't seem to work out how to do it myself. I thought SetVariable("view_message.viewport.top", 0) might do it, or anything to do with viewport.y/viewport.top, any ideas?
I can't seem to work out how to do it myself. I thought SetVariable("view_message.viewport.top", 0) might do it, or anything to do with viewport.y/viewport.top, any ideas?
Who is online
Users browsing this forum: No registered users