Mobile phone text-message system

A place for Ren'Py tutorials and reusable Ren'Py code.
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.
Message
Author
User avatar
noeinan
Eileen-Class Veteran
Posts: 1153
Joined: Sun Apr 04, 2010 10:10 pm
Projects: Ren'Py QuickStart, Crimson Rue
Organization: Statistically Unlikely Games
Deviantart: noeinan
Github: noeinan
Location: Washington State, USA
Contact:

Re: Mobile phone text-message system

#16 Post by noeinan »

Wow, this is really, really cool! Thanks for sharing the code. :)

Would you be okay with me including this (with credit and a link to this thread) in my quick-start guide? It's a kind of all-in-one package meant to help beginner players access features that they aren't able to program themselves. (Link: viewtopic.php?f=51&t=22393&p=283217#p283217 )
Image

Image
Image

User avatar
Lord Dragon
Regular
Posts: 54
Joined: Fri Apr 15, 2016 3:54 am
Projects: Trappy
Tumblr: lorddragonshenanigans
Contact:

Re: Mobile phone text-message system

#17 Post by Lord Dragon »

The thread is kinda dead, but I've been able to move the phone along the screen and the messages with it however I haven't been able to move the replies along with the phone.

Image

Solved

glithch
Regular
Posts: 93
Joined: Sat Jul 23, 2016 5:32 am
Contact:

Re: Mobile phone text-message system

#18 Post by glithch »

Lord Dragon wrote:The thread is kinda dead, but I've been able to move the phone along the screen and the messages with it however I haven't been able to move the replies along with the phone.

Image

Solved

im having similiar problem but i wanted to move the phone up q-q

User avatar
littanana
Regular
Posts: 48
Joined: Mon Sep 05, 2016 2:15 pm
Tumblr: girlgaymer
Contact:

Re: Mobile phone text-message system

#19 Post by littanana »

Image

New update! Code cleaned up, added bunch of comments. Supports images too. Check out the download, it's in the starting post.

User avatar
DragonKnight
Regular
Posts: 51
Joined: Sun Nov 12, 2017 10:16 am
Projects: Taboo Hearts
Contact:

Re: Mobile phone text-message system

#20 Post by DragonKnight »

Code: Select all

call phone_start
call message_start("[player_name]", "Hey, Mom and I are going out to eat.  Wanna come?")
call reply_message("[sister_name]", "Sure,  can we eat at Dad's favorite place?")
# this one is the same as the above one, but instead it has one more place for you to set an image
# you have to make the image be small enough to fit the screen or its gonna stretch weird!
call messa
How do you make the reply messages show who sent them. I have the outgoing messages taken care of (it is in the script). But I can't get the reply messages to show who sent them. I keep getting this:
problem2.png
Currently working on Taboo Hearts :D
Currently working on Forbidden :D

User avatar
littanana
Regular
Posts: 48
Joined: Mon Sep 05, 2016 2:15 pm
Tumblr: girlgaymer
Contact:

Re: Mobile phone text-message system

#21 Post by littanana »

DragonKnight wrote: Thu Mar 15, 2018 2:37 pm

Code: Select all

call phone_start
call message_start("[player_name]", "Hey, Mom and I are going out to eat.  Wanna come?")
call reply_message("[sister_name]", "Sure,  can we eat at Dad's favorite place?")
# this one is the same as the above one, but instead it has one more place for you to set an image
# you have to make the image be small enough to fit the screen or its gonna stretch weird!
call messa
How do you make the reply messages show who sent them. I have the outgoing messages taken care of (it is in the script). But I can't get the reply messages to show who sent them. I keep getting this:
problem2.png
you're getting an error since you're putting two arguments in a call that only takes one

"reply_message" and "message" with "me" as the name are the person who is receiving the messages (so the player) you're using them the wrong way around. you dont need the name to show since its always the same person using the same phone.

if you want the player name to show instead of "me" change the label message in your options.rpy to this;

Code: Select all

label message(who, what):
    $ renpy.pause()
    hide screen phone_message
    hide screen phone_message2
    hide screen phone_message3
    hide screen phone_message_image
    $ renpy.pause(0.1)
    # if you want to change the players name to be something else than "me" you can change it here
    if who.lower() == "[player_name]": 
        show screen phone_message2(who, what)
    else:
        show screen phone_message(who, what)
    return

isay_coconut
Newbie
Posts: 1
Joined: Fri Mar 23, 2018 6:47 am
Contact:

Re: Mobile phone text-message system

#22 Post by isay_coconut »

Has anyone figured out how to make this fit for 1280x720 resolution?

User avatar
littanana
Regular
Posts: 48
Joined: Mon Sep 05, 2016 2:15 pm
Tumblr: girlgaymer
Contact:

Re: Mobile phone text-message system

#23 Post by littanana »

isay_coconut wrote: Fri Mar 23, 2018 6:50 am Has anyone figured out how to make this fit for 1280x720 resolution?
you open the game up and go to screens.rpy and start playing with the numbers until it looks correct.
stuff like xalign, xsize and xoffset
maybe make the phone sprite a bit smaller in your image editor of choise

User avatar
margaretcatter
Regular
Posts: 44
Joined: Fri May 18, 2018 7:16 pm
Projects: Kathelm Princess X Princess | Hurricane Like Me
itch: margaretcatter
Location: New York/LA
Contact:

Re: Mobile phone text-message system

#24 Post by margaretcatter »

Help, I'm trying to do something I thought was a little easy. Below is my little bit of code.

Code: Select all

call phone_start

call message_start ("Karla", "Why don’t you have a lock on your phone? That’s like phone having 101 right here.")
call reply_message ("Eir", "Because it takes too long geez. Sometimes people are lazy aka mme and all I want to do is swipe and there it is. No fuss no muss.")
call message ("Karla", "Christ, how are you an adult?")
call reply_message ("Eir", "I ask myself that every day. One day I’m going to look up and realize I’m thirty and have no idea how that happened to me.")
call message("Karla", "It happens to the best of us.")
call reply_message("Karla", "Anyway i guess it’s a good thing that you don’t lock your phone. Also that in the year of twenty seventeen you have a landline. Like who even has one of those.")
call message("Eir" "It came with the apartment and its connected to my bell")
call reply_message("Karla" "I’m not judging its handy dandy for this exact moment.")
And this is the error I'm getting. I'm not sure what I'm doing wrong.

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 394, in script call
    call reply_message ("Eir", "Because it takes too long geez. Sometimes people are lazy aka mme and all I want to do is swipe and there it is. No fuss no muss.")
  File "game/options.rpy", line 319, in script
    label reply_message(what):
Exception: Too many arguments in call (expected 1, got 2).

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/script.rpy", line 394, in script call
    call reply_message ("Eir", "Because it takes too long geez. Sometimes people are lazy aka mme and all I want to do is swipe and there it is. No fuss no muss.")
  File "game/options.rpy", line 319, in script
    label reply_message(what):
  File "/Applications/renpy-6.99.14.3-sdk/renpy/ast.py", line 803, in execute
    values = apply_arguments(self.parameters, renpy.store._args, renpy.store._kwargs)
  File "/Applications/renpy-6.99.14.3-sdk/renpy/ast.py", line 152, in apply_arguments
    return parameters.apply(args, kwargs, ignore_errors)
  File "/Applications/renpy-6.99.14.3-sdk/renpy/ast.py", line 134, in apply
    raise Exception("Too many arguments in call (expected %d, got %d)." % (len(self.positional), len(args)))
Exception: Too many arguments in call (expected 1, got 2).

Darwin-16.6.0-x86_64-i386-64bit
Ren'Py 7.0.0.196
Hurricane Like Me 0.1
Sat Aug 11 23:03:22 2018

User avatar
littanana
Regular
Posts: 48
Joined: Mon Sep 05, 2016 2:15 pm
Tumblr: girlgaymer
Contact:

Re: Mobile phone text-message system

#25 Post by littanana »

margaretcatter wrote: Sat Aug 11, 2018 11:52 pm Help, I'm trying to do something I thought was a little easy. Below is my little bit of code.

Code: Select all

call phone_start

call message_start ("Karla", "Why don’t you have a lock on your phone? That’s like phone having 101 right here.")
call reply_message ("Eir", "Because it takes too long geez. Sometimes people are lazy aka mme and all I want to do is swipe and there it is. No fuss no muss.")
call message ("Karla", "Christ, how are you an adult?")
call reply_message ("Eir", "I ask myself that every day. One day I’m going to look up and realize I’m thirty and have no idea how that happened to me.")
call message("Karla", "It happens to the best of us.")
call reply_message("Karla", "Anyway i guess it’s a good thing that you don’t lock your phone. Also that in the year of twenty seventeen you have a landline. Like who even has one of those.")
call message("Eir" "It came with the apartment and its connected to my bell")
call reply_message("Karla" "I’m not judging its handy dandy for this exact moment.")
And this is the error I'm getting. I'm not sure what I'm doing wrong.

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 394, in script call
    call reply_message ("Eir", "Because it takes too long geez. Sometimes people are lazy aka mme and all I want to do is swipe and there it is. No fuss no muss.")
  File "game/options.rpy", line 319, in script
    label reply_message(what):
Exception: Too many arguments in call (expected 1, got 2).

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/script.rpy", line 394, in script call
    call reply_message ("Eir", "Because it takes too long geez. Sometimes people are lazy aka mme and all I want to do is swipe and there it is. No fuss no muss.")
  File "game/options.rpy", line 319, in script
    label reply_message(what):
  File "/Applications/renpy-6.99.14.3-sdk/renpy/ast.py", line 803, in execute
    values = apply_arguments(self.parameters, renpy.store._args, renpy.store._kwargs)
  File "/Applications/renpy-6.99.14.3-sdk/renpy/ast.py", line 152, in apply_arguments
    return parameters.apply(args, kwargs, ignore_errors)
  File "/Applications/renpy-6.99.14.3-sdk/renpy/ast.py", line 134, in apply
    raise Exception("Too many arguments in call (expected %d, got %d)." % (len(self.positional), len(args)))
Exception: Too many arguments in call (expected 1, got 2).

Darwin-16.6.0-x86_64-i386-64bit
Ren'Py 7.0.0.196
Hurricane Like Me 0.1
Sat Aug 11 23:03:22 2018
"call reply_message" only takes one parameter, ie only the dialogue. if you want the name to show also use "call message"

kully00000
Newbie
Posts: 7
Joined: Fri Jun 08, 2018 9:00 pm
Deviantart: kelly00000
Contact:

Re: Mobile phone text-message system

#26 Post by kully00000 »

Hi, first of all this is a great feature to have in a game so thank you.
I wanted to ask if and how it would be possible to enlarge sent images through the phone.
Right now when you send images they are small, is there any way to enlarge after you click on them?
Thanks,

User avatar
littanana
Regular
Posts: 48
Joined: Mon Sep 05, 2016 2:15 pm
Tumblr: girlgaymer
Contact:

Re: Mobile phone text-message system

#27 Post by littanana »

kully00000 wrote: Tue Aug 28, 2018 9:33 am Hi, first of all this is a great feature to have in a game so thank you.
I wanted to ask if and how it would be possible to enlarge sent images through the phone.
Right now when you send images they are small, is there any way to enlarge after you click on them?
Thanks,
yeah its possible but i have no idea how you'll have to code it yourself ^^

User avatar
sheetcakeghost
Veteran
Posts: 383
Joined: Sat Sep 19, 2009 9:19 pm
Contact:

Re: Mobile phone text-message system

#28 Post by sheetcakeghost »

This is absolutely flippin' fantastic and will save me SO MUCH time with the texting system in my own game. Sincerely, I was not looking forward to making a separate image for each and every texting option.

ysa27
Newbie
Posts: 5
Joined: Thu Jan 10, 2019 9:28 pm
Deviantart: ysa27
Contact:

Re: Mobile phone text-message system

#29 Post by ysa27 »

Hey there! I'm kinda wonderin' if there's a way to input a full image that isn't a message but a call? Does anyone know how to make it seem like there's a call instead of a message with the same coding from here?

User avatar
XxrenxX
Veteran
Posts: 267
Joined: Tue Oct 02, 2012 2:40 am
Projects: Chasing
Deviantart: bara-ettie
Location: Canada
Contact:

Re: Mobile phone text-message system

#30 Post by XxrenxX »

ysa27 wrote: Tue Apr 09, 2019 8:49 am
It might be easier to just define an image for calls with the names on them and use the show function like you would with sprites since calls can use the regular dialogue box. I'm curious though so I'm playing around with code to see if possible but it's be more code than defining images I think.

Edit=========

finished code

I've also done some minor changes to the call labels for the texting feature which is simple enough of an edit but thought would include in case anyone else wants it.

Code: Select all

label message_start(who, what):
    if who.lower() == "me": #this allows the player to text first
        show screen phone_message3(what)
    if who.lower() == "unknown": #this allows an image text to appear first
        show screen phone_message_image(who, what, img)
    else:
        show screen phone_message(who, what)
    return
if who.lower() == "me":

I have set for only what so that there isn't the "me" text on the screen cause I've never used a cell that says my own name in the text so included that as a personal preference. And it works how intended.

I've also discovered you can jump between the cell and dialogue if you need to.

Code: Select all

call phone_start
call message_start("Human", "Text")
pause #ensures player has to click to continue
"Dialogue will appear without the phone or text disappearing."
call reply_message(" text")
call phone_end

Post Reply

Who is online

Users browsing this forum: No registered users