Page 8 of 9

Re: telegram messenger (2 version)

Posted: Wed Mar 04, 2020 3:46 pm
by verysunshine
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?
I have the same question.

Re: telegram messenger (2 version)

Posted: Thu Mar 05, 2020 1:10 am
by sDextra
verysunshine wrote: Wed Mar 04, 2020 3:46 pm
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?
I have the same question.
I've already answered that question.
sDextra wrote: 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)
    ...

Re: telegram messenger (2 version)

Posted: Thu Mar 05, 2020 2:46 pm
by verysunshine
sDextra wrote: Thu Mar 05, 2020 1:10 am
verysunshine wrote: Wed Mar 04, 2020 3:46 pm
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?
I have the same question.
I've already answered that question.
sDextra wrote: 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)
    ...
Oh, sorry. I was actually thinking of switching conversations by clicking a button.

Re: telegram messenger (2 version)

Posted: Thu Mar 05, 2020 3:58 pm
by sDextra
verysunshine wrote: Thu Mar 05, 2020 2:46 pm
sDextra wrote: Thu Mar 05, 2020 1:10 am
verysunshine wrote: Wed Mar 04, 2020 3:46 pm

I have the same question.
I've already answered that question.
sDextra wrote: Fri Oct 04, 2019 10:28 am

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)
    ...
Oh, sorry. I was actually thinking of switching conversations by clicking a button.
textbutton "Poe" action Function(switch_dialogue, name='Poe', dialogue=dialogue_one)
textbutton "sDextra" action Function(switch_dialogue, name='sDextra', dialogue=dialogue_two)

Re: telegram messenger (2 version)

Posted: Wed Apr 22, 2020 2:30 pm
by Snek
Hi there! Love this thing, it's fantastic!

I was wondering, is there a way to re-arrange everything in such format:

<time> <nickname>: message

Basically for group chat/private chat always have time and nickname in front, kinda like IRC.

Also sent you a message, Dextra. Thank you for your hard work!

Re: telegram messenger (2 version)

Posted: Thu Apr 30, 2020 5:29 am
by creativechaos
Hi,
First of all thanks for your work.

I tried to put the messenger on a icon. so when you click in the game on a icon (in this case mobile phone icon) the messenger shows up. No matter what i did i miserable failed.
Would you be so kind and show me how to do it?

Thanks in advanced

Re: telegram messenger (2 version)

Posted: Thu Apr 30, 2020 7:16 am
by sDextra
creativechaos wrote: Thu Apr 30, 2020 5:29 am Hi,
First of all thanks for your work.

I tried to put the messenger on a icon. so when you click in the game on a icon (in this case mobile phone icon) the messenger shows up. No matter what i did i miserable failed.
Would you be so kind and show me how to do it?

Thanks in advanced
Can u show me your code with that?

Re: telegram messenger (2 version)

Posted: Thu Apr 30, 2020 8:23 am
by creativechaos
It have set the imagebutton

Code: Select all

imagebutton:
            top_margin .01
            right_margin .01
            xalign 1.0 ypos 0.2
            focus_mask True
            idle "mobile-icon-idle"
            hover "mobile-icon-hover"
            action Jump("groupchat_or_dialogue")
But i get this error:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 15140, in script
    $ show_messenger()
  File "game/script.rpy", line 15140, in <module>
    $ show_messenger()
  File "game/messenger.rpy", line 51, in show_messenger
    renpy.pause(1.0, hard=True)
  File "game/messenger.rpy", line 340, in execute
    screen messenger():
  File "game/messenger.rpy", line 340, in execute
    screen messenger():
  File "game/messenger.rpy", line 341, in execute
    if under_messenger:
  File "game/messenger.rpy", line 342, in execute
    add '#00000090' at blackout
  File "game/messenger.rpy", line 342, in keywords
    add '#00000090' at blackout
NameError: name 'blackout' is not defined
I want to use the option group or dialogue. I am completly lost at the moment

Re: telegram messenger (2 version)

Posted: Thu Apr 30, 2020 9:17 am
by sDextra
creativechaos wrote: Thu Apr 30, 2020 8:23 am It have set the imagebutton

Code: Select all

imagebutton:
            top_margin .01
            right_margin .01
            xalign 1.0 ypos 0.2
            focus_mask True
            idle "mobile-icon-idle"
            hover "mobile-icon-hover"
            action Jump("groupchat_or_dialogue")
But i get this error:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 15140, in script
    $ show_messenger()
  File "game/script.rpy", line 15140, in <module>
    $ show_messenger()
  File "game/messenger.rpy", line 51, in show_messenger
    renpy.pause(1.0, hard=True)
  File "game/messenger.rpy", line 340, in execute
    screen messenger():
  File "game/messenger.rpy", line 340, in execute
    screen messenger():
  File "game/messenger.rpy", line 341, in execute
    if under_messenger:
  File "game/messenger.rpy", line 342, in execute
    add '#00000090' at blackout
  File "game/messenger.rpy", line 342, in keywords
    add '#00000090' at blackout
NameError: name 'blackout' is not defined
I want to use the option group or dialogue. I am completly lost at the moment
But this code works fine for me.
Probably a mistake elsewhere.
Check your script 'images.rpy'

Code: Select all

    transform blackout():
        alpha 1
        on show:
            alpha 0
            easein .5 alpha 1
        on hide:
            easeout .5 alpha 0
Can I see the full script of the screen?

Re: telegram messenger (2 version)

Posted: Thu Apr 30, 2020 11:15 am
by creativechaos
Here the complete error script.

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 15140, in script
    $ show_messenger()
  File "game/script.rpy", line 15140, in <module>
    $ show_messenger()
  File "game/messenger.rpy", line 51, in show_messenger
    renpy.pause(1.0, hard=True)
  File "game/messenger.rpy", line 340, in execute
    screen messenger():
  File "game/messenger.rpy", line 340, in execute
    screen messenger():
  File "game/messenger.rpy", line 341, in execute
    if under_messenger:
  File "game/messenger.rpy", line 342, in execute
    add '#00000090' at blackout
  File "game/messenger.rpy", line 342, in keywords
    add '#00000090' at blackout
NameError: name 'blackout' is not defined

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

Full traceback:
  File "game/script.rpy", line 15140, in script
    $ show_messenger()
  File "F:\Progs\renpy-7.3.5-sdk\renpy\ast.py", line 914, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "F:\Progs\renpy-7.3.5-sdk\renpy\python.py", line 2028, in py_exec_bytecode
    exec bytecode in globals, locals
  File "game/script.rpy", line 15140, in <module>
    $ show_messenger()
  File "game/messenger.rpy", line 51, in show_messenger
    renpy.pause(1.0, hard=True)
  File "F:\Progs\renpy-7.3.5-sdk\renpy\exports.py", line 1480, in pause
    rv = renpy.ui.interact(mouse='pause', type='pause', roll_forward=roll_forward)
  File "F:\Progs\renpy-7.3.5-sdk\renpy\ui.py", line 297, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "F:\Progs\renpy-7.3.5-sdk\renpy\display\core.py", line 2702, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "F:\Progs\renpy-7.3.5-sdk\renpy\display\core.py", line 3094, in interact_core
    root_widget.visit_all(lambda i : i.per_interact())
  File "F:\Progs\renpy-7.3.5-sdk\renpy\display\core.py", line 541, in visit_all
    d.visit_all(callback, seen)
  File "F:\Progs\renpy-7.3.5-sdk\renpy\display\core.py", line 541, in visit_all
    d.visit_all(callback, seen)
  File "F:\Progs\renpy-7.3.5-sdk\renpy\display\core.py", line 541, in visit_all
    d.visit_all(callback, seen)
  File "F:\Progs\renpy-7.3.5-sdk\renpy\display\screen.py", line 430, in visit_all
    callback(self)
  File "F:\Progs\renpy-7.3.5-sdk\renpy\display\core.py", line 3094, in <lambda>
    root_widget.visit_all(lambda i : i.per_interact())
  File "F:\Progs\renpy-7.3.5-sdk\renpy\display\screen.py", line 440, in per_interact
    self.update()
  File "F:\Progs\renpy-7.3.5-sdk\renpy\display\screen.py", line 625, in update
    self.screen.function(**self.scope)
  File "game/messenger.rpy", line 340, in execute
    screen messenger():
  File "game/messenger.rpy", line 340, in execute
    screen messenger():
  File "game/messenger.rpy", line 341, in execute
    if under_messenger:
  File "game/messenger.rpy", line 342, in execute
    add '#00000090' at blackout
  File "game/messenger.rpy", line 342, in keywords
    add '#00000090' at blackout
  File "<screen language>", line 342, in <module>
NameError: name 'blackout' is not defined

Windows-8-6.2.9200
Ren'Py 7.3.5.606
Lets Start 1.0
Thu Apr 30 17:05:19 2020

Re: telegram messenger (2 version)

Posted: Thu Apr 30, 2020 11:26 am
by sDextra
creativechaos wrote: Thu Apr 30, 2020 11:15 am Here the complete error script.

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 15140, in script
    $ show_messenger()
  File "game/script.rpy", line 15140, in <module>
    $ show_messenger()
  File "game/messenger.rpy", line 51, in show_messenger
    renpy.pause(1.0, hard=True)
  File "game/messenger.rpy", line 340, in execute
    screen messenger():
  File "game/messenger.rpy", line 340, in execute
    screen messenger():
  File "game/messenger.rpy", line 341, in execute
    if under_messenger:
  File "game/messenger.rpy", line 342, in execute
    add '#00000090' at blackout
  File "game/messenger.rpy", line 342, in keywords
    add '#00000090' at blackout
NameError: name 'blackout' is not defined

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

Full traceback:
  File "game/script.rpy", line 15140, in script
    $ show_messenger()
  File "F:\Progs\renpy-7.3.5-sdk\renpy\ast.py", line 914, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "F:\Progs\renpy-7.3.5-sdk\renpy\python.py", line 2028, in py_exec_bytecode
    exec bytecode in globals, locals
  File "game/script.rpy", line 15140, in <module>
    $ show_messenger()
  File "game/messenger.rpy", line 51, in show_messenger
    renpy.pause(1.0, hard=True)
  File "F:\Progs\renpy-7.3.5-sdk\renpy\exports.py", line 1480, in pause
    rv = renpy.ui.interact(mouse='pause', type='pause', roll_forward=roll_forward)
  File "F:\Progs\renpy-7.3.5-sdk\renpy\ui.py", line 297, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "F:\Progs\renpy-7.3.5-sdk\renpy\display\core.py", line 2702, in interact
    repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, **kwargs)
  File "F:\Progs\renpy-7.3.5-sdk\renpy\display\core.py", line 3094, in interact_core
    root_widget.visit_all(lambda i : i.per_interact())
  File "F:\Progs\renpy-7.3.5-sdk\renpy\display\core.py", line 541, in visit_all
    d.visit_all(callback, seen)
  File "F:\Progs\renpy-7.3.5-sdk\renpy\display\core.py", line 541, in visit_all
    d.visit_all(callback, seen)
  File "F:\Progs\renpy-7.3.5-sdk\renpy\display\core.py", line 541, in visit_all
    d.visit_all(callback, seen)
  File "F:\Progs\renpy-7.3.5-sdk\renpy\display\screen.py", line 430, in visit_all
    callback(self)
  File "F:\Progs\renpy-7.3.5-sdk\renpy\display\core.py", line 3094, in <lambda>
    root_widget.visit_all(lambda i : i.per_interact())
  File "F:\Progs\renpy-7.3.5-sdk\renpy\display\screen.py", line 440, in per_interact
    self.update()
  File "F:\Progs\renpy-7.3.5-sdk\renpy\display\screen.py", line 625, in update
    self.screen.function(**self.scope)
  File "game/messenger.rpy", line 340, in execute
    screen messenger():
  File "game/messenger.rpy", line 340, in execute
    screen messenger():
  File "game/messenger.rpy", line 341, in execute
    if under_messenger:
  File "game/messenger.rpy", line 342, in execute
    add '#00000090' at blackout
  File "game/messenger.rpy", line 342, in keywords
    add '#00000090' at blackout
  File "<screen language>", line 342, in <module>
NameError: name 'blackout' is not defined

Windows-8-6.2.9200
Ren'Py 7.3.5.606
Lets Start 1.0
Thu Apr 30 17:05:19 2020
Sorry, I'm talking about your script with the button.
Full version of this screen:

Code: Select all

imagebutton:
            top_margin .01
            right_margin .01
            xalign 1.0 ypos 0.2
            focus_mask True
            idle "mobile-icon-idle"
            hover "mobile-icon-hover"
            action Jump("groupchat_or_dialogue")

Re: telegram messenger (2 version)

Posted: Sat May 02, 2020 7:19 am
by creativechaos

Code: Select all

  screen mc_room_map:
    imagemap:

        vbox:
            textbutton "{b}[clock.time]{/b}"
            textbutton "{b}[clock.weekday]{/b} {b}[clock.day]{/b}"
        hbox:
            imagebutton:
                top_margin .01
                left_margin .15
                xalign 0.0 ypos 0
                focus_mask True
                idle "time-icon-idle"
                hover "time-icon-hover"
                action Function(clock.advance)

        imagebutton:
            top_margin .01
            right_margin .01
            xalign 1.0 ypos 0
            focus_mask True
            idle "map-icon-idle"
            hover "map-icon-hover"
            action Jump("morrison_navigation")

        imagebutton:
            top_margin .01
            right_margin .01
            xalign 1.0 ypos 0.2
            focus_mask True
            idle "mobile-icon-idle"
            hover "mobile-icon-hover"
            action Jump("lb_groupchat")
You mean this?

Re: telegram messenger (2 version)

Posted: Sat May 02, 2020 8:38 am
by sDextra
creativechaos wrote: Sat May 02, 2020 7:19 am

Code: Select all

  screen mc_room_map:
    imagemap:

        vbox:
            textbutton "{b}[clock.time]{/b}"
            textbutton "{b}[clock.weekday]{/b} {b}[clock.day]{/b}"
        hbox:
            imagebutton:
                top_margin .01
                left_margin .15
                xalign 0.0 ypos 0
                focus_mask True
                idle "time-icon-idle"
                hover "time-icon-hover"
                action Function(clock.advance)

        imagebutton:
            top_margin .01
            right_margin .01
            xalign 1.0 ypos 0
            focus_mask True
            idle "map-icon-idle"
            hover "map-icon-hover"
            action Jump("morrison_navigation")

        imagebutton:
            top_margin .01
            right_margin .01
            xalign 1.0 ypos 0.2
            focus_mask True
            idle "mobile-icon-idle"
            hover "mobile-icon-hover"
            action Jump("lb_groupchat")
You mean this?
Can u send me your project via PM? I'll try to fix the error.
There may be an error in the incorrect call of the screen.

Re: telegram messenger

Posted: Wed May 20, 2020 8:21 pm
by rayminator
Nanahs wrote: Thu Aug 30, 2018 6:25 pm
Andredron wrote: Mon Aug 27, 2018 6:23 pm
Nanahs wrote: Mon Aug 27, 2018 5:44 pm Thank you so much Andredom! If I use the codes, I'll give you credit :)

Please do not need to publish me, he's an author Valentin Bez'chanuk, he's just busy, that would personally write in the forum
Hello! Silly question, but how can I place the phone in the middle of the screen?
Whenever I try to do that I get an error message.
open sms.rpy

find and change

Code: Select all

# положение окна с смс
    sms_xalign, sms_yalign = .75, .25

Re: telegram messenger (2 version)

Posted: Sun Aug 09, 2020 10:56 am
by Dr_arell
i was breaking my head a few months ago trying to achieve something like this, and i came up with a very decent result, but this one seems better, ill give it a try thank you.