[solved] My game has to be "auto forward". Codes are not working?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Nanahs
Regular
Posts: 98
Joined: Wed Aug 22, 2018 5:50 pm
Contact:

[solved] My game has to be "auto forward". Codes are not working?

#1 Post by Nanahs » Wed Oct 10, 2018 1:06 pm

So, I'm working on a text based game. A messenger game.

I'm using this one (version1):

viewtopic.php?f=51&t=50153

To be more realistic, I wanted the game to "auto forward" the messages to seem more real when a charater sends you a message.

I tried adding "{w=2.0}{nw}" after the message.

I tried " $ renpy.pause ()"

I tried adding this in the options:

Code: Select all

default preferences.afm_time = 5
default preferences.afm_enable = True 
Absolutely nothing works. Does anyone know what I should do?
I wanted the game to be "auto forward" without having to choose this option on menu. That would make the messeger seem more real.

Thanks :)
Last edited by Nanahs on Thu Oct 11, 2018 8:09 am, edited 1 time in total.

User avatar
IrinaLazareva
Veteran
Posts: 255
Joined: Wed Jun 08, 2016 1:49 pm
Projects: Legacy, Эра Тёмных Небес
Organization: IKG
Location: St.Petersburg, Russia
Contact:

Re: My game has to be "auto forward". Codes are not working?

#2 Post by IrinaLazareva » Wed Oct 10, 2018 2:24 pm

try to replace msg() function in messenger.rpy

Code: Select all

    def msg(txt, who=False, sound=False, p=None):
        store.m_msg.append((who, txt, sound))
        store.yadj.value = store.yadj.range+300
        renpy.restart_interaction()
        if who:
            renpy.play("new_message.mp3", "sound")
        renpy.pause(p)
And then:

Code: Select all

    python:
        msg("Hello?", who=True)     
        msg("Yes, who are you please?", p=3)    
        msg("I'm Bla bla.", who=True)    
        msg("How are you?", p=2)       
        msg("etc......", who=True)   
Where p is time to wait in seconds.

P.S. By the way, be carefuly. My antivirus found bad traces in this project
There is a light at the end of the tunnel, just pray it's not a train.

Nanahs
Regular
Posts: 98
Joined: Wed Aug 22, 2018 5:50 pm
Contact:

Re: My game has to be "auto forward". Codes are not working?

#3 Post by Nanahs » Wed Oct 10, 2018 5:22 pm

IrinaLazareva wrote:
Wed Oct 10, 2018 2:24 pm
try to replace msg() function in messenger.rpy

Code: Select all

    def msg(txt, who=False, sound=False, p=None):
        store.m_msg.append((who, txt, sound))
        store.yadj.value = store.yadj.range+300
        renpy.restart_interaction()
        if who:
            renpy.play("new_message.mp3", "sound")
        renpy.pause(p)
And then:

Code: Select all

    python:
        msg("Hello?", who=True)     
        msg("Yes, who are you please?", p=3)    
        msg("I'm Bla bla.", who=True)    
        msg("How are you?", p=2)       
        msg("etc......", who=True)   
Where p is time to wait in seconds.

P.S. By the way, be carefuly. My antivirus found bad traces in this project
Thank you so much for your help! And also for the warning. I'll give it a look :)

Post Reply

Who is online

Users browsing this forum: solarProtag