telegram messenger (2 version)

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
Blue Mythic
Newbie
Posts: 5
Joined: Sat Oct 28, 2017 11:31 pm
Organization: Blue Mythic
Contact:

Re: telegram messenger (2 version)

#91 Post by Blue Mythic » Mon Sep 30, 2019 11:41 pm

Hi!I love your code so much, but as I'm trying to test the "dialog" option where the player inputs their name, I keep running into this error:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 475, in script
    $ msg (None, name_input=True)
  File "game/script.rpy", line 475, in <module>
    $ msg (None, name_input=True)
  File "game/messenger.rpy", line 203, in msg
    renpy.pause()
  File "game/messenger.rpy", line 329, in execute
    screen messenger():
  File "game/messenger.rpy", line 329, in execute
    screen messenger():
  File "game/messenger.rpy", line 335, in execute
    frame background None xysize (600,975) at move_messenger:
  File "game/messenger.rpy", line 343, in execute
    frame background None xysize (560, 810) align (0.5,0.58):
  File "game/messenger.rpy", line 344, in execute
    viewport id 'vp_msg' mousewheel True  yadjustment yadj:
  File "game/messenger.rpy", line 345, in execute
    vbox spacing 15 xsize 550 xalign 0.4 box_reverse True:
  File "game/messenger.rpy", line 347, in execute
    for message in all_messages:
  File "game/messenger.rpy", line 358, in execute
    if message.audio: # Audio
  File "game/messenger.rpy", line 419, in execute
    hbox spacing 5 xalign message.position:
  File "game/messenger.rpy", line 420, in execute
    hbox spacing -60 xalign message.position:
  File "game/messenger.rpy", line 421, in execute
    frame xalign message.position xmaximum 500 xpadding 20 top_padding 15 bottom_padding bottom background Frame(box, 25, 25):
  File "game/messenger.rpy", line 421, in keywords
    frame xalign message.position xmaximum 500 xpadding 20 top_padding 15 bottom_padding bottom background Frame(box, 25, 25):
NameError: name 'bottom' is not defined

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

Full traceback:
  File "game/script.rpy", line 475, in script
    $ msg (None, name_input=True)
  File "C:\Users\ashwi\Desktop\renpy-7.3.2-sdk\renpy\ast.py", line 912, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "C:\Users\ashwi\Desktop\renpy-7.3.2-sdk\renpy\python.py", line 2004, in py_exec_bytecode
    exec bytecode in globals, locals
  File "game/script.rpy", line 475, in <module>
    $ msg (None, name_input=True)
  File "game/messenger.rpy", line 203, in msg
    renpy.pause()
  File "C:\Users\ashwi\Desktop\renpy-7.3.2-sdk\renpy\exports.py", line 1471, in pause
    rv = renpy.ui.interact(mouse='pause', type='pause', roll_forward=roll_forward)
  File "C:\Users\ashwi\Desktop\renpy-7.3.2-sdk\renpy\ui.py", line 295, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "C:\Users\ashwi\Desktop\renpy-7.3.2-sdk\renpy\display\core.py", line 2699, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "C:\Users\ashwi\Desktop\renpy-7.3.2-sdk\renpy\display\core.py", line 3091, in interact_core
    root_widget.visit_all(lambda i : i.per_interact())
  File "C:\Users\ashwi\Desktop\renpy-7.3.2-sdk\renpy\display\core.py", line 541, in visit_all
    d.visit_all(callback, seen)
  File "C:\Users\ashwi\Desktop\renpy-7.3.2-sdk\renpy\display\core.py", line 541, in visit_all
    d.visit_all(callback, seen)
  File "C:\Users\ashwi\Desktop\renpy-7.3.2-sdk\renpy\display\core.py", line 541, in visit_all
    d.visit_all(callback, seen)
  File "C:\Users\ashwi\Desktop\renpy-7.3.2-sdk\renpy\display\screen.py", line 430, in visit_all
    callback(self)
  File "C:\Users\ashwi\Desktop\renpy-7.3.2-sdk\renpy\display\core.py", line 3091, in <lambda>
    root_widget.visit_all(lambda i : i.per_interact())
  File "C:\Users\ashwi\Desktop\renpy-7.3.2-sdk\renpy\display\screen.py", line 440, in per_interact
    self.update()
  File "C:\Users\ashwi\Desktop\renpy-7.3.2-sdk\renpy\display\screen.py", line 625, in update
    self.screen.function(**self.scope)
  File "game/messenger.rpy", line 329, in execute
    screen messenger():
  File "game/messenger.rpy", line 329, in execute
    screen messenger():
  File "game/messenger.rpy", line 335, in execute
    frame background None xysize (600,975) at move_messenger:
  File "game/messenger.rpy", line 343, in execute
    frame background None xysize (560, 810) align (0.5,0.58):
  File "game/messenger.rpy", line 344, in execute
    viewport id 'vp_msg' mousewheel True  yadjustment yadj:
  File "game/messenger.rpy", line 345, in execute
    vbox spacing 15 xsize 550 xalign 0.4 box_reverse True:
  File "game/messenger.rpy", line 347, in execute
    for message in all_messages:
  File "game/messenger.rpy", line 358, in execute
    if message.audio: # Audio
  File "game/messenger.rpy", line 419, in execute
    hbox spacing 5 xalign message.position:
  File "game/messenger.rpy", line 420, in execute
    hbox spacing -60 xalign message.position:
  File "game/messenger.rpy", line 421, in execute
    frame xalign message.position xmaximum 500 xpadding 20 top_padding 15 bottom_padding bottom background Frame(box, 25, 25):
  File "game/messenger.rpy", line 421, in keywords
    frame xalign message.position xmaximum 500 xpadding 20 top_padding 15 bottom_padding bottom background Frame(box, 25, 25):
  File "<screen language>", line 421, in <module>
NameError: name 'bottom' is not defined

Windows-8-6.2.9200
Ren'Py 7.3.2.320
Area 51 1.3
Mon Sep 30 22:39:17 2019
Do you know what the problem is?

User avatar
sDextra
Regular
Posts: 34
Joined: Fri Oct 12, 2018 2:06 am
Organization: Event Horizon Games
Github: sDextra
Location: Kazakhstan
Contact:

Re: telegram messenger (2 version)

#92 Post by sDextra » Tue Oct 01, 2019 2:17 am

Blue Mythic wrote:
Mon Sep 30, 2019 11:41 pm
Hi!I love your code so much, but as I'm trying to test the "dialog" option where the player inputs their name, I keep running into this error:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 475, in script
    $ msg (None, name_input=True)
  File "game/script.rpy", line 475, in <module>
    $ msg (None, name_input=True)
  File "game/messenger.rpy", line 203, in msg
    renpy.pause()
  File "game/messenger.rpy", line 329, in execute
    screen messenger():
  File "game/messenger.rpy", line 329, in execute
    screen messenger():
  File "game/messenger.rpy", line 335, in execute
    frame background None xysize (600,975) at move_messenger:
  File "game/messenger.rpy", line 343, in execute
    frame background None xysize (560, 810) align (0.5,0.58):
  File "game/messenger.rpy", line 344, in execute
    viewport id 'vp_msg' mousewheel True  yadjustment yadj:
  File "game/messenger.rpy", line 345, in execute
    vbox spacing 15 xsize 550 xalign 0.4 box_reverse True:
  File "game/messenger.rpy", line 347, in execute
    for message in all_messages:
  File "game/messenger.rpy", line 358, in execute
    if message.audio: # Audio
  File "game/messenger.rpy", line 419, in execute
    hbox spacing 5 xalign message.position:
  File "game/messenger.rpy", line 420, in execute
    hbox spacing -60 xalign message.position:
  File "game/messenger.rpy", line 421, in execute
    frame xalign message.position xmaximum 500 xpadding 20 top_padding 15 bottom_padding bottom background Frame(box, 25, 25):
  File "game/messenger.rpy", line 421, in keywords
    frame xalign message.position xmaximum 500 xpadding 20 top_padding 15 bottom_padding bottom background Frame(box, 25, 25):
NameError: name 'bottom' is not defined

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

Full traceback:
  File "game/script.rpy", line 475, in script
    $ msg (None, name_input=True)
  File "C:\Users\ashwi\Desktop\renpy-7.3.2-sdk\renpy\ast.py", line 912, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "C:\Users\ashwi\Desktop\renpy-7.3.2-sdk\renpy\python.py", line 2004, in py_exec_bytecode
    exec bytecode in globals, locals
  File "game/script.rpy", line 475, in <module>
    $ msg (None, name_input=True)
  File "game/messenger.rpy", line 203, in msg
    renpy.pause()
  File "C:\Users\ashwi\Desktop\renpy-7.3.2-sdk\renpy\exports.py", line 1471, in pause
    rv = renpy.ui.interact(mouse='pause', type='pause', roll_forward=roll_forward)
  File "C:\Users\ashwi\Desktop\renpy-7.3.2-sdk\renpy\ui.py", line 295, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "C:\Users\ashwi\Desktop\renpy-7.3.2-sdk\renpy\display\core.py", line 2699, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "C:\Users\ashwi\Desktop\renpy-7.3.2-sdk\renpy\display\core.py", line 3091, in interact_core
    root_widget.visit_all(lambda i : i.per_interact())
  File "C:\Users\ashwi\Desktop\renpy-7.3.2-sdk\renpy\display\core.py", line 541, in visit_all
    d.visit_all(callback, seen)
  File "C:\Users\ashwi\Desktop\renpy-7.3.2-sdk\renpy\display\core.py", line 541, in visit_all
    d.visit_all(callback, seen)
  File "C:\Users\ashwi\Desktop\renpy-7.3.2-sdk\renpy\display\core.py", line 541, in visit_all
    d.visit_all(callback, seen)
  File "C:\Users\ashwi\Desktop\renpy-7.3.2-sdk\renpy\display\screen.py", line 430, in visit_all
    callback(self)
  File "C:\Users\ashwi\Desktop\renpy-7.3.2-sdk\renpy\display\core.py", line 3091, in <lambda>
    root_widget.visit_all(lambda i : i.per_interact())
  File "C:\Users\ashwi\Desktop\renpy-7.3.2-sdk\renpy\display\screen.py", line 440, in per_interact
    self.update()
  File "C:\Users\ashwi\Desktop\renpy-7.3.2-sdk\renpy\display\screen.py", line 625, in update
    self.screen.function(**self.scope)
  File "game/messenger.rpy", line 329, in execute
    screen messenger():
  File "game/messenger.rpy", line 329, in execute
    screen messenger():
  File "game/messenger.rpy", line 335, in execute
    frame background None xysize (600,975) at move_messenger:
  File "game/messenger.rpy", line 343, in execute
    frame background None xysize (560, 810) align (0.5,0.58):
  File "game/messenger.rpy", line 344, in execute
    viewport id 'vp_msg' mousewheel True  yadjustment yadj:
  File "game/messenger.rpy", line 345, in execute
    vbox spacing 15 xsize 550 xalign 0.4 box_reverse True:
  File "game/messenger.rpy", line 347, in execute
    for message in all_messages:
  File "game/messenger.rpy", line 358, in execute
    if message.audio: # Audio
  File "game/messenger.rpy", line 419, in execute
    hbox spacing 5 xalign message.position:
  File "game/messenger.rpy", line 420, in execute
    hbox spacing -60 xalign message.position:
  File "game/messenger.rpy", line 421, in execute
    frame xalign message.position xmaximum 500 xpadding 20 top_padding 15 bottom_padding bottom background Frame(box, 25, 25):
  File "game/messenger.rpy", line 421, in keywords
    frame xalign message.position xmaximum 500 xpadding 20 top_padding 15 bottom_padding bottom background Frame(box, 25, 25):
  File "<screen language>", line 421, in <module>
NameError: name 'bottom' is not defined

Windows-8-6.2.9200
Ren'Py 7.3.2.320
Area 51 1.3
Mon Sep 30 22:39:17 2019
Do you know what the problem is?
Hmm, "Error: name 'bottom' is not defined".
Can you send (PM) me your project? I'll try to solve it.

User avatar
Sayumi101
Veteran
Posts: 207
Joined: Fri Apr 11, 2014 1:56 am
Completed: Closing Spaces, Pastel Rain, Straight Up: Sister-zoned!, Run 'N Gun
Projects: Hunta-H ~Romancing Idols~
Deviantart: Sayumi101
itch: sayumi101
Location: India
Contact:

Re: telegram messenger (2 version)

#93 Post by Sayumi101 » Fri Oct 04, 2019 9:31 am

Hello!
So I tried the code and it's working like an absolute dream!! :D

I just had a question. Would it be possible to text two different people with two different histories in play? Not a group chat but two separate chat threads?
ImageImageImageImage

User avatar
sDextra
Regular
Posts: 34
Joined: Fri Oct 12, 2018 2:06 am
Organization: Event Horizon Games
Github: sDextra
Location: Kazakhstan
Contact:

Re: telegram messenger (2 version)

#94 Post by sDextra » Fri Oct 04, 2019 10:28 am

Sayumi101 wrote:
Fri Oct 04, 2019 9:31 am
Hello!
So I tried the code and it's working like an absolute dream!! :D

I just had a question. Would it be possible to text two different people with two different histories in play? Not a group chat but two separate chat threads?
Yeah, of course.
You just need to add a new function in messenger.rpy:

Code: Select all

init python:
	# ...
	def switch_dialogue(name='sDextra', dialogue=store.messages):
        	store.interlocutor_name = name
        	store.messages = dialogue
Update messenger.rpy on GitHub.

Usage example:

Code: Select all

$ dialogue_one = [] #Poe
$ dialogue_two = [] #sDextra

$ switch_dialogue(name='Poe', dialogue=dialogue_one)
$ msg ("Hi. This is the first dialogue.", who=1)
pause
$ switch_dialogue(name='sDextra', dialogue=dialogue_two)
$ msg ("This is the second dialogue.", who=1)
pause
$ switch_dialogue(name='Poe', dialogue=dialogue_one)
    ...

User avatar
Sayumi101
Veteran
Posts: 207
Joined: Fri Apr 11, 2014 1:56 am
Completed: Closing Spaces, Pastel Rain, Straight Up: Sister-zoned!, Run 'N Gun
Projects: Hunta-H ~Romancing Idols~
Deviantart: Sayumi101
itch: sayumi101
Location: India
Contact:

Re: telegram messenger (2 version)

#95 Post by Sayumi101 » Fri Oct 04, 2019 10:47 am

Thank you so much for the prompt response!
And this is working perfectly!
:D
ImageImageImageImage

User avatar
richycapy
Regular
Posts: 35
Joined: Mon May 27, 2019 8:53 pm
Organization: EN Productions
Location: Mexico
Contact:

Re: telegram messenger (2 version)

#96 Post by richycapy » Sat Oct 19, 2019 3:10 pm

WOW!!! THIS IS AMAZING!!
One of the best scripts I have seen!! Cheers for the programmers

Having said that, I found some bugs with it, some are simple to fix and some I just dont know how hahaha

First, there is no "other" image, guessing by the images of the preview, this image is the three little dots in the top corner right, this have a simple solution:
Create the image and define it: I used the "arrow.png" image inside images>messenger folder, erase the arrow, create the 3 dots, and save it as "other.png"
Then, in the image.rpy, I added this lines:
image other_idle = 'images/messenger/other.png'
image other_hover = color_brightness('images/messenger/other.png')

Second bug:
Look for all this: "messenger/box.png" and replace them with "images/messenger/box.png" in all files,
Same thing goes for "messenger/back.png", replace them with "images/messenger/back.png"
And "messenger/box_two.png" with "images/messenger/box_two.png"

And third bug (this one, I cant fix, dont know how)

When you press on the three little dots, I get this error:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 114, in script
    $ msg ("Hi, nothing much. Are you still here?")
  File "game/script.rpy", line 114, in <module>
    $ msg ("Hi, nothing much. Are you still here?")
  File "game/messenger.rpy", line 207, in msg
    renpy.pause()
  File "game/messenger.rpy", line 491, in execute
    screen sc_theme():
  File "game/messenger.rpy", line 491, in execute
    screen sc_theme():
  File "game/messenger.rpy", line 493, in execute
    frame  xysize (300,500) align .83,.5:
  File "game/messenger.rpy", line 495, in execute
    vbox align .5,.9:
  File "game/messenger.rpy", line 496, in execute
    textbutton 'default' action Function(set_color_theme, 1.0,1.0,1.0), Hide('sc_theme') # (1.0,1.0,1.0) == RGB (red,green,blue)
  File "game/messenger.rpy", line 496, in keywords
    textbutton 'default' action Function(set_color_theme, 1.0,1.0,1.0), Hide('sc_theme') # (1.0,1.0,1.0) == RGB (red,green,blue)
NameError: name 'set_color_theme' is not defined

Darwin-18.7.0-x86_64-i386-64bit
Ren'Py 7.1.3.1092
Messenger 1.3
Sat Oct 19 14:09:12 2019
Once again, thanks for this amazing script!!! :D

User avatar
richycapy
Regular
Posts: 35
Joined: Mon May 27, 2019 8:53 pm
Organization: EN Productions
Location: Mexico
Contact:

Re: telegram messenger (2 version)

#97 Post by richycapy » Sat Oct 19, 2019 3:45 pm

Also, I created I new theme for the messenger, a white one, is a mixture of iMessenger and Tinder (to avoid legal issues) but I cant seem to find how the change the color of the name in the top...
Image

User avatar
sDextra
Regular
Posts: 34
Joined: Fri Oct 12, 2018 2:06 am
Organization: Event Horizon Games
Github: sDextra
Location: Kazakhstan
Contact:

Re: telegram messenger (2 version)

#98 Post by sDextra » Sat Oct 19, 2019 5:00 pm

richycapy wrote:
Sat Oct 19, 2019 3:10 pm
WOW!!! THIS IS AMAZING!!
One of the best scripts I have seen!! Cheers for the programmers

Having said that, I found some bugs with it, some are simple to fix and some I just dont know how hahaha

First, there is no "other" image, guessing by the images of the preview, this image is the three little dots in the top corner right, this have a simple solution:
Create the image and define it: I used the "arrow.png" image inside images>messenger folder, erase the arrow, create the 3 dots, and save it as "other.png"
Then, in the image.rpy, I added this lines:
image other_idle = 'images/messenger/other.png'
image other_hover = color_brightness('images/messenger/other.png')

Second bug:
Look for all this: "messenger/box.png" and replace them with "images/messenger/box.png" in all files,
Same thing goes for "messenger/back.png", replace them with "images/messenger/back.png"
And "messenger/box_two.png" with "images/messenger/box_two.png"

And third bug (this one, I cant fix, dont know how)

When you press on the three little dots, I get this error:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 114, in script
    $ msg ("Hi, nothing much. Are you still here?")
  File "game/script.rpy", line 114, in <module>
    $ msg ("Hi, nothing much. Are you still here?")
  File "game/messenger.rpy", line 207, in msg
    renpy.pause()
  File "game/messenger.rpy", line 491, in execute
    screen sc_theme():
  File "game/messenger.rpy", line 491, in execute
    screen sc_theme():
  File "game/messenger.rpy", line 493, in execute
    frame  xysize (300,500) align .83,.5:
  File "game/messenger.rpy", line 495, in execute
    vbox align .5,.9:
  File "game/messenger.rpy", line 496, in execute
    textbutton 'default' action Function(set_color_theme, 1.0,1.0,1.0), Hide('sc_theme') # (1.0,1.0,1.0) == RGB (red,green,blue)
  File "game/messenger.rpy", line 496, in keywords
    textbutton 'default' action Function(set_color_theme, 1.0,1.0,1.0), Hide('sc_theme') # (1.0,1.0,1.0) == RGB (red,green,blue)
NameError: name 'set_color_theme' is not defined

Darwin-18.7.0-x86_64-i386-64bit
Ren'Py 7.1.3.1092
Messenger 1.3
Sat Oct 19 14:09:12 2019
Once again, thanks for this amazing script!!! :D
Thank you.
Sorry about that, my fault, I have not changed 'images.rpy' and did not upload new images on GitHub.
This is the solution to all bugs.
Now it is fixed.

Also, I created I new theme for the messenger, a white one, is a mixture of iMessenger and Tinder (to avoid legal issues) but I cant seem to find how the change the color of the name in the top...
Now I have added a new variable for this:

Code: Select all

#script.rpy
    $ interlocutor_name = "sDextra" # interlocutor's name
    $ interlocutor_name_color = '#c4c4c4' # interlocutor's name color

#messenger.rpy
screen messenger():
    ...
        ...
            ...
                text "%s"%(interlocutor_name) style 'txt_base' color interlocutor_name_color size 32 xalign 0.25 xanchor 0.0 yalign 0.025
 
Messenger on GitHub
Just in case, I attached the project files:
Attachments
messenger-emulator.zip
project files
(8.21 MiB) Downloaded 3 times

User avatar
richycapy
Regular
Posts: 35
Joined: Mon May 27, 2019 8:53 pm
Organization: EN Productions
Location: Mexico
Contact:

Re: telegram messenger (2 version)

#99 Post by richycapy » Wed Oct 23, 2019 5:51 pm

Hi

Im trying to implement the script on my game, but when I run the $show_messenger()

I get this error:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/historias.rpy", line 1046, in script
    $ show_messenger()
  File "game/historias.rpy", line 1046, in <module>
    $ show_messenger()
  File "game/messenger.rpy", line 51, in show_messenger
    renpy.pause(1.0, hard=True)
Exception: Invalid key specifier anykey

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

Full traceback:
  File "game/historias.rpy", line 1046, in script
    $ show_messenger()
  File "/Users/richycapy/Documents/RenPy/renpy/ast.py", line 881, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "/Users/richycapy/Documents/RenPy/renpy/python.py", line 1913, in py_exec_bytecode
    exec bytecode in globals, locals
  File "game/historias.rpy", line 1046, in <module>
    $ show_messenger()
  File "game/messenger.rpy", line 51, in show_messenger
    renpy.pause(1.0, hard=True)
  File "/Users/richycapy/Documents/RenPy/renpy/exports.py", line 1360, in pause
    rv = renpy.ui.interact(mouse='pause', type='pause', roll_forward=roll_forward)
  File "/Users/richycapy/Documents/RenPy/renpy/ui.py", line 289, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "/Users/richycapy/Documents/RenPy/renpy/display/core.py", line 2672, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "/Users/richycapy/Documents/RenPy/renpy/display/core.py", line 3477, in interact_core
    rv = root_widget.event(ev, x, y, 0)
  File "/Users/richycapy/Documents/RenPy/renpy/display/layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "/Users/richycapy/Documents/RenPy/renpy/display/layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "/Users/richycapy/Documents/RenPy/renpy/display/layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "/Users/richycapy/Documents/RenPy/renpy/display/screen.py", line 697, in event
    rv = self.child.event(ev, x, y, st)
  File "/Users/richycapy/Documents/RenPy/renpy/display/layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "/Users/richycapy/Documents/RenPy/renpy/display/behavior.py", line 435, in event
    if map_event(ev, name):
  File "/Users/richycapy/Documents/RenPy/renpy/display/behavior.py", line 221, in map_event
    check_code = eval("lambda ev : " + compile_event(keysym, True), globals())
  File "/Users/richycapy/Documents/RenPy/renpy/display/behavior.py", line 131, in compile_event
    raise Exception("Invalid key specifier %s" % key)
Exception: Invalid key specifier anykey

Darwin-18.7.0-x86_64-i386-64bit
Ren'Py 7.1.3.1092
High School Days 0.01
Wed Oct 23 16:50:15 2019

User avatar
sDextra
Regular
Posts: 34
Joined: Fri Oct 12, 2018 2:06 am
Organization: Event Horizon Games
Github: sDextra
Location: Kazakhstan
Contact:

Re: telegram messenger (2 version)

#100 Post by sDextra » Wed Oct 23, 2019 6:01 pm

richycapy wrote:
Wed Oct 23, 2019 5:51 pm
Hi

Im trying to implement the script on my game, but when I run the $show_messenger()

I get this error:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/historias.rpy", line 1046, in script
    $ show_messenger()
  File "game/historias.rpy", line 1046, in <module>
    $ show_messenger()
  File "game/messenger.rpy", line 51, in show_messenger
    renpy.pause(1.0, hard=True)
Exception: Invalid key specifier anykey

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

Full traceback:
  File "game/historias.rpy", line 1046, in script
    $ show_messenger()
  File "/Users/richycapy/Documents/RenPy/renpy/ast.py", line 881, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "/Users/richycapy/Documents/RenPy/renpy/python.py", line 1913, in py_exec_bytecode
    exec bytecode in globals, locals
  File "game/historias.rpy", line 1046, in <module>
    $ show_messenger()
  File "game/messenger.rpy", line 51, in show_messenger
    renpy.pause(1.0, hard=True)
  File "/Users/richycapy/Documents/RenPy/renpy/exports.py", line 1360, in pause
    rv = renpy.ui.interact(mouse='pause', type='pause', roll_forward=roll_forward)
  File "/Users/richycapy/Documents/RenPy/renpy/ui.py", line 289, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "/Users/richycapy/Documents/RenPy/renpy/display/core.py", line 2672, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "/Users/richycapy/Documents/RenPy/renpy/display/core.py", line 3477, in interact_core
    rv = root_widget.event(ev, x, y, 0)
  File "/Users/richycapy/Documents/RenPy/renpy/display/layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "/Users/richycapy/Documents/RenPy/renpy/display/layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "/Users/richycapy/Documents/RenPy/renpy/display/layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "/Users/richycapy/Documents/RenPy/renpy/display/screen.py", line 697, in event
    rv = self.child.event(ev, x, y, st)
  File "/Users/richycapy/Documents/RenPy/renpy/display/layout.py", line 998, in event
    rv = i.event(ev, x - xo, y - yo, cst)
  File "/Users/richycapy/Documents/RenPy/renpy/display/behavior.py", line 435, in event
    if map_event(ev, name):
  File "/Users/richycapy/Documents/RenPy/renpy/display/behavior.py", line 221, in map_event
    check_code = eval("lambda ev : " + compile_event(keysym, True), globals())
  File "/Users/richycapy/Documents/RenPy/renpy/display/behavior.py", line 131, in compile_event
    raise Exception("Invalid key specifier %s" % key)
Exception: Invalid key specifier anykey

Darwin-18.7.0-x86_64-i386-64bit
Ren'Py 7.1.3.1092
High School Days 0.01
Wed Oct 23 16:50:15 2019
I see, the error in the line:
key 'anykey' action NullAction()
You must add this code to the script:

Code: Select all

init python:
    config.keymap = dict(
        anykey = ['K_q', 'K_w', 'K_e', 'K_r', 'K_t', 'K_y', 'K_u', 'K_i', 'K_o', 'K_p', 
                    'K_a', 'K_s', 'K_d', 'K_f', 'K_g', 'K_h', 'K_j', 'K_k', 'K_l', 
                    'K_z', 'K_x', 'K_c', 'K_v', 'K_b', 'K_n', 'K_m' ]
        )
In my project the code is in options.rpy

User avatar
richycapy
Regular
Posts: 35
Joined: Mon May 27, 2019 8:53 pm
Organization: EN Productions
Location: Mexico
Contact:

Re: telegram messenger (2 version)

#101 Post by richycapy » Wed Oct 23, 2019 7:03 pm

Sorry,

Yes... I miss that.. now its working, however, is there a way to make it smaller?

Look how it looks on my game:
Image

My game is 1280 x 720 :shock:
sDextra wrote:
Wed Oct 23, 2019 6:01 pm

I see, the error in the line:
key 'anykey' action NullAction()
You must add this code to the script:

Code: Select all

init python:
    config.keymap = dict(
        anykey = ['K_q', 'K_w', 'K_e', 'K_r', 'K_t', 'K_y', 'K_u', 'K_i', 'K_o', 'K_p', 
                    'K_a', 'K_s', 'K_d', 'K_f', 'K_g', 'K_h', 'K_j', 'K_k', 'K_l', 
                    'K_z', 'K_x', 'K_c', 'K_v', 'K_b', 'K_n', 'K_m' ]
        )
In my project the code is in options.rpy

User avatar
sDextra
Regular
Posts: 34
Joined: Fri Oct 12, 2018 2:06 am
Organization: Event Horizon Games
Github: sDextra
Location: Kazakhstan
Contact:

Re: telegram messenger (2 version)

#102 Post by sDextra » Wed Oct 23, 2019 7:39 pm

richycapy wrote:
Wed Oct 23, 2019 7:03 pm
Sorry,

Yes... I miss that.. now its working, however, is there a way to make it smaller?

Look how it looks on my game:
Image

My game is 1280 x 720 :shock:
sDextra wrote:
Wed Oct 23, 2019 6:01 pm

I see, the error in the line:
key 'anykey' action NullAction()
You must add this code to the script:

Code: Select all

init python:
    config.keymap = dict(
        anykey = ['K_q', 'K_w', 'K_e', 'K_r', 'K_t', 'K_y', 'K_u', 'K_i', 'K_o', 'K_p', 
                    'K_a', 'K_s', 'K_d', 'K_f', 'K_g', 'K_h', 'K_j', 'K_k', 'K_l', 
                    'K_z', 'K_x', 'K_c', 'K_v', 'K_b', 'K_n', 'K_m' ]
        )
In my project the code is in options.rpy
It is possible, but not so easy.
Firstly, you need to re-save the all messenger images in accordance with your resolution. Just multiplying the required size by 0.666.
For example, the main HUD has a size of 600x975, you need to reduce its size to 400x649.
Secondly, change the xysize of almost all elements inside the screen messenger() in the messenger.rpy.
I think that by trial and error you can adjust the required size.

User avatar
richycapy
Regular
Posts: 35
Joined: Mon May 27, 2019 8:53 pm
Organization: EN Productions
Location: Mexico
Contact:

Re: telegram messenger (2 version)

#103 Post by richycapy » Wed Oct 23, 2019 8:41 pm

Thanks for the help!

Your script is amazing... In the future I might need some additions, like the ability to send message to your contacts instead of waiting for them to contact you, but I'll send you a message to ask for a price when Im in that part of development on my game! :D

Once again, thanks for this amazing script!!

User avatar
Andredron
Veteran
Posts: 340
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Re: telegram messenger (2 version)

#104 Post by Andredron » Tue Nov 12, 2019 12:45 am

Someone asked to make a page of the social network, edit it and it's ready http://renpyfordummies.blogspot.com/2019/11/vk.html?m=1
I know, I'm writing terribly in English.

I'm writing a Renpy textbook (in Russian). https://yadi.sk/d/ZX_DonP63USRru Update 22.06.18

Honest Critique

Post Reply

Who is online

Users browsing this forum: No registered users