Kesash
Newbie
- Jul 2, 2022
- 37
- 35
- 28
Hey everyone,
I made a phone system for RenPy. I spent FOREVER looking for a phone system that worked like an actual phone, but I couldn't fine one, so figured id just make the thing myself.
I'll try to explain everything it does as best I can:
Dynamically loaded conversation with choices and permanent history:
-You can load into the game and a full conversation with someone you have had in the past can be preloaded on, completely scrollable. It will never disappear. Figured it was weird to open a game and you have 0 messages with your mom or gf, so you can add something like 'hey, got a new phone' with a reply and a full convo if you want, all pre loaded on.
-At any point in your game you can load a new conversation up, this can be one that the character starts by sending a message, or one that the character opens their phone to find 1,2 or 4 messages already received. To reiterate this will continue on from any conversation that was had before, this will not be a fresh chat. Chat history is PERMENANT. (I mean, you can delete it if you want to?)
-You can close and reopen the phone mid conversation, it does not matter, it will continue where you left off. This includes at a choice. If the played is presented with a choice of replies but doesn't want to decide straight away? They can close the phone, move around, re open it and then send the reply.
-Leave a conversation mid way and carry on with the game? You CAN TRACK THAT! Unload the rest of the conversation from the stack and have the person they were talking to send a message complaining they disappeared! Same for unread messages! Conversation became available at label 3 but by label 5 they still haven't replied? You can unload the message stack and have a message send complaining they never replied.
-Notification if there is an available conversation? DONE. A GUI element is added over the phone (I used a ! in testing) to say that there is an available convo.
-Characters can delete messages they have already sent!! Maybe they send you a photo by accident, they can delete it and it will be replaced with -this message was deleted-.
-Timestamps? System messages? Done that too. Not per message but you can add a system message to say anything you want to the stack of messages.
Images and videos:
-Characters can send you pictures and videos! They will appear in the chat and can be clicked to be made full screen!
Automated gallery:
-A completely automatic gallery system. It will scan the game on start-up for any images that match the naming convention and add them to the phone gallery. This is sectioned per character too. As messages are received any images are then unlocked in the gallery as you get them! (Its pretty simple, there is a config list you add the names of characters to, so ['sara','Iris','Laura'] It will then scan all images for any that starts 'name_' and add them to the gallery, 'name_profile' is ignored because thats the naming convention for profile pictures and anything ending '_x' is ignored just as a way to exclude images)
Everything is done via lists, dicts and good naming convention. You could make an entire game with this and never have to make anything more complicated than a list of maps. Its all auto loaded into the phone system and displayed. An example conversation would be:
There is a default dictionary that looks like this:
So if mid way through the game you want to start a new convo, just write it how i explained above and set it as the 'current_dialogue' and done....
Adding messages that are already there when the phone is open is as simple as appending them to 'all_dialogue'
The index tracks where you got to in any given conversation, it auto increments as the conversation happens.
To add a character to the phone system, just append a config list with the full_info map! If i added sarah_full_info to the list in the game with what I wrote above it would run, it would add the image to the gallery, make it unlocked once its seen, the choices would work, everything would play out
I am still testing things and adding more features but I'd like 1 or 2 people to possibly test it in return for use in a game or something??
OH AND THE UI SUCKS, I CANT DO UI, ITS UGLY! But its all customizable
I made a phone system for RenPy. I spent FOREVER looking for a phone system that worked like an actual phone, but I couldn't fine one, so figured id just make the thing myself.
I'll try to explain everything it does as best I can:
Dynamically loaded conversation with choices and permanent history:
-You can load into the game and a full conversation with someone you have had in the past can be preloaded on, completely scrollable. It will never disappear. Figured it was weird to open a game and you have 0 messages with your mom or gf, so you can add something like 'hey, got a new phone' with a reply and a full convo if you want, all pre loaded on.
-At any point in your game you can load a new conversation up, this can be one that the character starts by sending a message, or one that the character opens their phone to find 1,2 or 4 messages already received. To reiterate this will continue on from any conversation that was had before, this will not be a fresh chat. Chat history is PERMENANT. (I mean, you can delete it if you want to?)
-You can close and reopen the phone mid conversation, it does not matter, it will continue where you left off. This includes at a choice. If the played is presented with a choice of replies but doesn't want to decide straight away? They can close the phone, move around, re open it and then send the reply.
-Leave a conversation mid way and carry on with the game? You CAN TRACK THAT! Unload the rest of the conversation from the stack and have the person they were talking to send a message complaining they disappeared! Same for unread messages! Conversation became available at label 3 but by label 5 they still haven't replied? You can unload the message stack and have a message send complaining they never replied.
-Notification if there is an available conversation? DONE. A GUI element is added over the phone (I used a ! in testing) to say that there is an available convo.
-Characters can delete messages they have already sent!! Maybe they send you a photo by accident, they can delete it and it will be replaced with -this message was deleted-.
-Timestamps? System messages? Done that too. Not per message but you can add a system message to say anything you want to the stack of messages.
Images and videos:
-Characters can send you pictures and videos! They will appear in the chat and can be clicked to be made full screen!
Automated gallery:
-A completely automatic gallery system. It will scan the game on start-up for any images that match the naming convention and add them to the phone gallery. This is sectioned per character too. As messages are received any images are then unlocked in the gallery as you get them! (Its pretty simple, there is a config list you add the names of characters to, so ['sara','Iris','Laura'] It will then scan all images for any that starts 'name_' and add them to the gallery, 'name_profile' is ignored because thats the naming convention for profile pictures and anything ending '_x' is ignored just as a way to exclude images)
Everything is done via lists, dicts and good naming convention. You could make an entire game with this and never have to make anything more complicated than a list of maps. Its all auto loaded into the phone system and displayed. An example conversation would be:
Code:
default example_convo = [
{"me", "Hey"}, <--- this message will be click to send
{"image","path_to_image.png"}, <--- they send an image
{"laura", "Make a choice!"}, <----- these will load automatically until the played needs to send a reply
{"me", "okay!"},<--- back to click to send
[{"this is what they will see for option 1":eek:ption_1_convo},{"this is what they will see for option 1":eek:ption_2_convo}] # structure for making choices
]
default example_convo _index = 0
default option_1_convo = [
create option 1 convo here <---- clicking option 1 will take them to this convo
]
default option_1_convo_index = 0
default option_2_convo = [
create option 2 convo here <---- clicking option 2 will take them to this convo
]
default option_2_convo_index = 0
Code:
default sarah_list_dialogue = []
default sarah_full_info = {
"unlocked":True,
"name":"Sarah",
"profile":"sarah/sarah_profile.png",
"current_index":"example_convo _index",
"all_dialogue":sarah_list_dialogue,
"current_dialogue":example_convo,
"scroll_to_bottom": False,
}
Adding messages that are already there when the phone is open is as simple as appending them to 'all_dialogue'
The index tracks where you got to in any given conversation, it auto increments as the conversation happens.
To add a character to the phone system, just append a config list with the full_info map! If i added sarah_full_info to the list in the game with what I wrote above it would run, it would add the image to the gallery, make it unlocked once its seen, the choices would work, everything would play out
I am still testing things and adding more features but I'd like 1 or 2 people to possibly test it in return for use in a game or something??
OH AND THE UI SUCKS, I CANT DO UI, ITS UGLY! But its all customizable
Last edited: