Chatrooms
Navigation
- Chatrooms
- Creating a Chatroom
- Writing Chatroom Dialogue
- Advanced Chatroom Features
- Entering and Exiting the Chatroom
- Updating the Characters’ Profiles
- Clearing the Chat History
- Clearing Chatroom Participants
- Resetting Chatroom Participants
- Providing Choices
- Showing a Chatroom Banner
- Showing a Heart Icon
- Awarding an Hourglass
- Showing the Hacked Scroll Effect
- Showing the Secure Chatroom Animation
- Shaking the Screen
- Showing the Cracked Overlay
- Sending Links
- Custom Fonts and Bubbles
- Adding Chatroom Backgrounds
- Timed Menus
- Chatroom Creator
Creating a Chatroom
Tip
The following section is for creating chatrooms using Ren’Py scripting and additions added for Mysterious Messenger. If you’re interested in the visual chatroom creator, see Chatroom Creator.
Note
Example files to look at:
tutorial_5_coffee.rpy
tutorial_6_meeting.rpy
A brief overview of the steps required (more detail below):
Create a new
.rpyfile (Optional, but recommended)Create a new label for the chatroom.
(Optional) Set the background with
scene morningwheremorningis replaced by whatever time of day/background you want to use.Add background music with
play music mystic_chatwheremystic_chatis replaced by the desired music variable.Write the chatroom dialogue.
You may want to use either
Script Generator.xlsxor themsgCDS.
End the label with
return.
The first thing you should do when creating a new chatroom is create a new .rpy file and name it something descriptive so it’s easy to find it again. For example, you might name it something like day_1_chatroom_3.rpy or day_1_3.rpy. It’s a good idea to put all the files related to a particular route inside a folder for organization.
In your newly created .rpy file, begin by making a label for the chatroom:
label day_1_1:
Don’t forget the colon after the label name. Your label name also can’t have any spaces in it or begin with a number.
Next, it’s time to set up the chatroom background. Note that everything under the label name should be indented at least one level to the right. You can look at the example files mentioned above if you’re not sure what this means.
New to v3.3.0 is the “autobackground” feature, where Mysterious Messenger will automatically set the background for a chatroom based on the time of day it should trigger at. If you don’t set a background, the automatic one will be used instead. If you want the program to set up the background for you, you can skip over this next section. Otherwise, you can manually set up the background like so:
label day_1_1:
scene morning
While chatrooms also use Ren’Py’s scene statement to show backgrounds, there is a limited number of built-in backgrounds to use. New backgrounds must be defined as described in Adding Chatroom Backgrounds. Your background options are:
morning
noon
evening
night
earlyMorn
hack
redhack
redcrack
secure
rainy_day
snowy_day
morning_snow
The background names are case-sensitive, so you need to get the capitalization correct. The program will automatically clear the chat history when beginning a new chatroom so new messages begin appearing at the bottom.
Tip
If you’re using Mysterious Messenger’s autobackground feature to set up the background for you, but you need to change the background manually during a chatroom (e.g. to show the hacked background), if you want to change it back according to the time-of-day rules, you can use the special line:
scene autobackground
When this line is encountered, the program will automatically switch to whatever background should be used based on the time-of-day this chatroom triggers at.
Note
The autobackground feature is based off of the trigger time of the chatroom where it is used, not what real-life time the player plays the chatroom at. So, for example, if the player buys back a chatroom that had expired, and that chatroom’s trigger time is 8:00am, whether it is 8:00am now or 10:00pm, autobackground will show the morning background to the player for that chatroom, since it was set to trigger at 8:00am and that’s within the range of the “morning” background time.
Now that the background is set up, you probably want some music. Music is played with the line:
play music mystic_chat
where mystic_chat can be replaced by the name of whatever music you want. There are several files pre-defined in variables_music_sound.rpy. If you want to define your own music, you need to add it to the music_dictionary as well so that it is compatible with audio captions. See Adding New Audio for more information.
Next, you’ll write the dialogue for your chatroom. See Writing Chatroom Dialogue. Finally, to end the chatroom, end the label with return:
label day_1_1:
scene earlyMorn
play music mint_eye
# Dialogue will go here
return
To learn how to make this chatroom appear in your game, check out Setting up a Route.
Writing Chatroom Dialogue
There are two primary ways of writing dialogue for your chatroom. The first is to use the msg CDS, and the second is to use a special spreadsheet to help generate the dialogue for you.
Using the msg CDS
The msg CDS helps add effects to your dialogue, such as special speech bubbles or alternative fonts, without sacrificing the readability of the dialogue. Dialogue written with the msg CDS looks like the following:
msg r "Usually, the program would delay sending text messages and phone calls" sser1
msg r "until after both this chatroom and the Story Mode were played." sser1
msg r "But since v3.0, things are more flexible!" flower_m
msg r "If you declare a route using the new format,"
msg r "you can have text messages and phone calls and the like after any story item,"
msg r "even a chatroom that has a Story Mode attached" glow
(Dialogue taken from tutorial_3_text_message.rpy)
The msg CDS requires a speaker (in the example, r) and some dialogue (surrounded by ""). There are several optional clauses that can be added after the dialogue to affect how it displays.
Fonts
The msg CDS has several built-in fonts that can be applied to the text. These are:
Short form |
Description |
|---|---|
sser1 |
Sans serif font 1 (Nanum Gothic) |
sser2 |
Sans serif font 2 (Seoul Namsan) |
ser1 |
Serif font 1 (Nanum Myeongjo) |
ser2 |
Serif font 2 (Seoul Hangang) |
curly |
Cursive font (Sandoll Misaeng) |
blocky |
Blocky font (BM-HANNA) |
You can also use your own fonts with the msg CDS. See Custom Fonts and Bubbles for more on custom fonts and special bubbles.
In order to use one of the built-in fonts, just include the name of the desired font after the dialogue e.g.
msg u "This is example dialogue in the cursive font." curly
msg u "This is in the sans serif 1 font." sser1
Note that you can only have one font at a time; including more than one will simply use the last font given. The default font is sser1, and dialogue will show up using sser1 unless you give it a different font.
Emphasis
You can emphasize text in several ways. To use the bold version of a font, use the argument bold after the dialogue e.g.
msg u "This text is bolded." bold
Some fonts have extra-bold variants as well. These are defined in variables_editable.rpy in the variable bold_xbold_fonts_list. To make a font extra bold, add the xbold clause after the dialogue e.g.
msg ja "This text is in the sans serif 2 font, extra bold." sser2 xbold
Finally, you can increase the size of the text inside a speech bubble with the big argument e.g.
msg ju "This text is shown at a bigger size." big
You can also combine big and bold or xbold for additional emphasis.
msg s "VERY IMPORTANT MESSAGE!!" sser2 big xbold
To apply these styles only to parts of a word, you can use the {b} text tag for bolded text:
msg y "I can't believe you {b}left{/b} me..."
And the custom {big} text tag for larger text:
msg z "I can't believe you think it's {big}not a big deal!{/big}"
Underline
To underline all the text in a bubble, you can use either underline or under as part of the msg CDS:
msg u "This text is underlined!" curly underline
msg u "This is also underlined." under
If you just want to underline particular words, the built-in {u} tag will handle that:
msg u "This is {u}underlined{/u} for emphasis." glow
Special Bubbles
You can also use special speech bubbles as the background of dialogue. There are several bubbles built in to the program:
Base bubble |
Sizes |
Additional Notes |
|---|---|---|
cloud |
s, m, l |
|
round |
s, m, l |
Only available for |
round2 |
s, m, l |
Only available for |
sigh |
s, m, l |
Not available for |
spike |
s, m, l |
small (s) size only available for |
square |
s, m, l |
Not available for |
square2 |
s, m, l |
Only available for |
flower |
s, m, l |
Only available for |
glow |
N/A |
Available for all pre-defined characters excluding |
glow2 |
N/A |
Only available for |
Unless otherwise mentioned, u, ri, and m have no special bubble variants of their own.
For bubbles which have sizes, you must include which size bubble you would like (s for small, m for medium, and l for large) after the name of the bubble e.g. square_m or sigh_l.
To use a special bubble, add the name of the bubble after dialogue e.g.
msg r "This is a bubble with the flower background." flower_m
msg r "And this is a bubble with the glowing background." glow
msg r "These can be combined with other fonts and effects, too!" glow curly big
You can also have the characters use each other’s special speech bubbles by prefacing the bubble name with their file_id e.g.
msg s "I'm using Jumin's cat bubble!" bubble ju_cloud_l
y "This message uses Zen's flower bubble~" (bounce=True, specBubble="z_flower_m")
Finally, you can use your own bubbles with the msg CDS. See Custom Fonts and Bubbles for more on custom special bubbles and fonts.
Images
The msg CDS will automatically detect if dialogue includes a recognized emoji and mark the dialogue as an image accordingly. If you want a character to post an image in the chatroom (such as a CG), then you can use the img argument:
msg s "cg s_1" img
msg s "I just posted a CG!"
You need to follow the rules outlined in Defining a CG and Showing a CG in a Chatroom or Text Message in order for the program to find the correct image and display it during a chatroom. For CGs, the program will also automatically unlock the image in the gallery.
For emojis, it’s sufficient to write:
msg s "{image=seven_wow}"
where seven_wow is the name of the emoji image to be shown. The program will automatically recognize it as an emoji.
Modifying Message Speed
Finally, you can also adjust the speed at which a message is posted. For example, if you want a character to post a bunch of messages in quick succession, you can use the pv clause to use a multiplier on the speed at which a message is posted e.g.
msg s "These" pv 0.1
msg s "messages" pv 0.1
msg s "are" pv 0.1
msg s "posted" pv 0.1
msg s "quickly!!!" pv 0.1
If you have paraphrase_choices turned off, you will generally want to add pv 0 after a message posted by the main character after a menu e.g.
menu:
"Emojis and Images":
msg m "I want to learn how to use emojis and images." pv 0
msg u "Emojis and images, huh?" ser1
Using the Chatroom Spreadsheet
The second way of writing chatroom dialogue is similar to writing regular Ren’Py script, but passes special keyword arguments in brackets after the dialogue. A spreadsheet, Script Generator.xlsx, is included with the program to make this style of writing easier.
The first tab in the spreadsheet is called Chatroom Instructions and explains how the CHATROOM TEMPLATE tab is used. Where possible, the spreadsheet will try to check off the appropriate boxes depending on what fonts, emphasis, or bubbles you want to use. It will also notify you if you’ve typed a character’s name incorrectly.
The tab tutorial_6_meeting has examples directly from the corresponding .rpy file of how dialogue for that chatroom was written using the spreadsheet.
In general, you should create a copy of the CHATROOM TEMPLATE tab and fill it out with your desired dialogue. Don’t forget that messages such as 707 has entered the chatroom are handled differently – see Advanced Chatroom Features for more.
If you’ve filled out the spreadsheet correctly, you should be able to copy-paste the dialogue from the “What should be filled into the program” column into your script file.
Comparison of Chatroom Dialogue
Both methods of writing dialogue can be mixed and matched freely in-game. For example, if you don’t want to add any additional fonts, emphasis, or special bubbles, it can be easier to type out dialogue using just the character variable and their dialogue. Here is a comparison of what dialogue looks like for each method when various fonts, emphasis, and special bubbles are added:
# msg CDS
msg u "Extra bold sans serif 2 font" sser2 xbold
# Spreadsheet dialogue
u "{=sser2xb}Extra bold sans serif 2 font{/=sser2xb}"
# msg CDS
msg u "Glowing bubble with blocky font" blocky glow
# Spreadsheet dialogue
u "{=blocky}Glowing bubble with blocky font{/=blocky}" (bounce=True)
# msg CDS
msg z "Bold large curly font with flower bubble" curly bold big flower_m
# Spreadsheet dialogue
z "{=curly}{size=+10}{b}Bold large curly font with flower bubble{/b}{/size}{/=curly}" (bounce=True, specBubble="flower_m")
# msg CDS
msg s "{image=seven_wow}"
# Spreadsheet dialogue
s "{image=seven_wow}" (img=True)
# msg CDS
msg m "Dialogue with a speed modifier." pv 0
# Spreadsheet dialogue
m "Dialogue with a speed modifier." (pauseVal=0)
# msg CDS
msg s "cg s_1" img
# Spreadsheet dialogue
s "cg s_1" (img=True)
Attention
If you have script from v2.x or earlier, you don’t need to modify it to work with the msg CDS. You can mix and match script writing styles within the same chatroom.
Advanced Chatroom Features
Now that you’ve made a label for your chatroom and filled it with some dialogue, you may want to add additional polish to your chatroom, like allowing the player to make a choice or adding the special 707 has entered the chatroom-style messages.
Entering and Exiting the Chatroom
To get the message Character has entered the chatroom, use the enter chatroom CDS:
enter chatroom s
where s is the variable of the character who is entering the chatroom. See Creating Characters for a list of the characters currently programmed into the game.
Tip
You can also use call enter(s) to have a character enter the chatroom.
To get the message Character has left the chatroom, use the exit chatroom CDS:
exit chatroom s
where s is the variable of the character who is exiting the chatroom.
Tip
You can also use call exit(s) to have a character leave the chatroom.
Updating the Characters’ Profiles
Updating the Profile Picture
To update a character’s profile picture, you just need to write
$ ja.prof_pic = "Profile Pics/Jaehee/jae-2.webp"
where ja is the ChatCharacter variable of the character whose profile picture you’d like to update. Profile pictures should be 110x110 pixels at minimum, and can optionally have a second, larger version supplied that is up to 314x314 pixels and will be used on the character’s profile screen. The program looks for the larger version under the same name with the suffix -b e.g. Profile Pics/Jaehee/jae-2-b.webp.
You can update a profile picture anywhere – during a chatroom, phone call, text message, etc. To have the profile picture show up in the History screen as well as during regular gameplay, it is recommended that you change the profile picture at the beginning of a label and its associated expired version, if applicable e.g.
label day_1_chatroom_1():
$ r.prof_pic = "Profile Pics/Ray/ray-1.webp"
play music mint_eye
enter chatroom r
msg r "Good morning!" curly glow
Updating a character’s profile picture will automatically change their portrait on the homepage to have an “updated” background.
Note
There are also bonus profile pictures, which the player can update themselves. For more on that, see Bonus Profile Pictures.
Updating a Character’s Status
To update a character’s status, use
$ ju.status = "I wonder what Elizabeth the 3rd is up to..."
where ju is the ChatCharacter variable of the character whose status you would like to update. Updating a character’s status will automatically give their portrait on the homepage an “updated” background to indicate there is new information on their profile page.
You can update a character’s status wherever you like inside a label; in the middle of phone calls, at the end of a chatroom, in the after_ label, wherever.
Updating the Character’s Cover Photo
To update a character’s cover photo, use
$ s.cover_pic = "Cover Photos/rfa_cover.webp"
where s is the ChatCharacter variable of the character whose cover photo you would like to update. Cover photos should be 750 x 672 pixels in size.
Updating a character’s cover photo will automatically give their portrait on the homepage an “updated” background to indicate their is new information on their profile page.
You can update a character’s cover photo wherever you like inside a label; during Story Mode, in the middle of an expired chatroom, in a text message, wherever.
Clearing the Chat History
If you would like to clear the chat history so that all previous messages are erased, you can use the clear chat CDS:
y "Anyway, I should go now."
exit chatroom y
clear chat
scene hack
show hack effect
enter chatroom u
u "Hi, [name]."
Note
The chat history is automatically cleared before beginning a new chatroom.
Clearing Chatroom Participants
If you would like to clear all current chatroom participants from the chatroom header, you can use the extra argument participants for the clear chat CDS:
label my_chatroom:
scene morning
play music narcissistic_jazz
enter chatroom z
z "Has the chatroom been acting up for you too, [name]?"
msg z "I've been having trouble with it all morning." sigh_s
clear chat participants
scene hack
show hack effect
enter chatroom u
u "Ah, excellent."
u "I've gained access to the messenger."
This will both clear the chat history and remove any existing participants from the list at the top of the messenger screen.
This isn’t typically used outside of using story mode sections in the middle of chatrooms (see Including a Story Mode During a Chatroom) or linking together “separate” chatrooms as part of a scene for something like an After End.
Resetting Chatroom Participants
Similar to the above section on clearing chat participants, there is also a special function provided to reset chat participants even without jumping to Story Mode and back, for example, as part of a montage of chatroom sequences. The function is called reset_participants and takes one parameter, a list of ChatCharacters to add back to the participants list.
u "This is the end of the first chatroom."
$ reset_participants([z, s, m])
s "Hey [name], Zen, you haven't seen anything suspicious lately, right?"
Note
You will need to add m to the participant list yourself if you would like the player to appear in the participants list after the reset, regardless of whether the chatroom was expired or not.
Providing Choices
During a chatroom, you may want to allow the player to make a choice. This can be accomplished with Ren’Py’s built-in menu system:
msg s "What kind of food do you eat?"
menu:
"I like soup.":
msg s "You like soup?"
"I eat a lot of junk food.":
msg s "lolol same."
msg s "But you should have a balanced diet, unlike me~" glow
Note that for this menu, it is assumed that paraphrase_choices is turned on for this route. This means that the main character will automatically say the exact dialogue on the chosen choice. If paraphrase_choices is turned off, the menu might look something like this:
msg s "What kind of food do you eat?"
menu:
"I like soup.":
msg m "I like soup." pv 0
msg s "You like soup?"
"I eat a lot of junk food.":
msg m "I eat a lot of junk food." pv 0
msg s "lolol same."
msg s "But you should have a balanced diet, unlike me~" glow
You can also turn paraphrased on or off on a per-menu or per-choice basis. For more on paraphrasing, see Paraphrased Choices.
You can add as many choices as you want to the menu, though only 5 options will fit on the screen at once. All code indented after a choice will only be run if the player picks that choice. So, only a player who chose "I like soup" will see the line "You like soup?". Anything indented at the same level as the menu will be run regardless of the choice made, so the player will see the line "But you should have a balanced diet, unlike me~" regardless of whether they said they like soup or eat junk food.
Warning
You can use the TAB key to indent your code an additional level to the right, but make sure your code editor is using spaces to indent code. Otherwise, you will get errors complaining about “tab” characters in your code.
You’ll also notice in the “paraphrased” version of the menu, the main character (m) has the clauses pv 0 after their dialogue. This tells the program to not wait at all before posting the MC’s message. Usually the program will pause before posting a message to simulate “typing time”, but you want the player’s choice to appear right away after a choice, so you should include pv 0 if you’re using the msg CDS, or (pauseVal=0) if you’re using the spreadsheet style.