sDextra wrote: ↑Thu Jan 10, 2019 1:48 pm
Nanahs wrote: ↑Thu Jan 10, 2019 1:36 pm
Oh, ok. Got it. Thamk you!
But now how I show the image inside the message?
Because the messages are working this way, like the older code like:
Code: Select all
python:
msg("Hello Anna!!", who=1)
But in the new code it's like this (image and sound):
Code: Select all
$ msg (None, audio="opening", who=1)
$ msg (None, pic="crow", who=1)
Code: Select all
python:
msg("Hello Anna!!", who=1)
==
Just try it in your version:
Code: Select all
python:
msg (None, pic='your_pic', who=1)
Path to the image: 'images/messenger/pic/*your_pic*.jpg'
Thank you! It worked with the image.
Only two things are not working.
I'm getting embarrassed from making so many questions. Sorry
The audio didn't work:
Code: Select all
python:
msg (None, audio="birds", who=1)
I got this error:
Code: Select all
While running game code:
File "game/script.rpy", line 487, in script
python:
File "game/script.rpy", line 488, in <module>
msg (None, audio="birds", who=1)
TypeError: msg() got an unexpected keyword argument 'audio'
I have an "audio" folder and the "birds.mp3" inside it.
PS: I changed "audio" to "sound". The audio player shows up. But when I click to play, it keeps telling me it could find "birds" file even though it's there.
I also this. To make the message go "automatic", without the person clicking on the screen. I added "p" in "renpy.pause(p)".
It was really good, cause I could use "p=3" for short messages, "p=6" for biggers messages, etc. Control how long the other character was "typing" and then automatically send it.
So the message would be:
Code: Select all
python:
msg("Hello Anna!", p=3, who=1)
And I did the same thing in this new code:
Code: Select all
def msg(txt, who=False, sound=False, pic=False, hm=False):
if message_time:
h,m = message_time
hm = hm if hm else '%s:%s'%(h,m)
time_update()
hm = get_current_time() if message_time_current else hm
store.m_msg.append((who, txt, sound, pic, hm))
store.yadj.value = store.yadj.range+300
renpy.restart_interaction()
if who:
renpy.play("new_message.mp3", "sound")
renpy.pause(p)
But I keep getting the error "global name 'p' is not defined". Why is it not defined if I added it "renpy.pause(p)". It worked in the other code
![Question :?:](./images/smilies/icon_question.gif)