Ren'Py Is there a way to toggle auto-forward?

my5tyfixx

Member
Dec 20, 2017
140
109
hey f95ers!!

guys for quite a while now iam busy with a problem concerning auto-fw in ren´py based vn games. most of the times it wasn´t relevant enough to act asap but here and there iam confronted with it on and on...besides a general issue comes along with it so the time has come to solve it hrhr. first i wanna refer to the general issue i mentioned. so the majority of games based on ren´py has the typically standard layout on screen and there are always the same several buttons displayed below the text box. like - save/load, prefs etc..and most important auto - options which can be used while playing. on the other hand are those ren´py based games which are the opposite. they just don´t have the typically standard layout format and no single line shows up with buttons to click on. the row of commands simply does not exist ingame (options text speed & auto-fw time in the prefs are still showing and changeable hm!?).
the same issue descrbed (lemme name this cluster of buttons from now on the command line) sometimes happens too if u load a quick save & afterwards try to click on back whilst auto-fw is still active and running!! the command line which was accessable before immediately disappears as a consequence. this might be the best explanation i can give ya folks °___^ my probs attending to it follow shortly:


A) look up the title of this thread. in addition to my request it is essential to use only a single key which will be assigned to this function seperately (thus and to avoid any missinterpretation later plz let us use the f-key only for examples. tu!). to add i suck at programming/mods. 100%!!
B) the next question relates onto is a consequence of troubleshooting the problem in point A. it affects every issue i referred to in my 'intro passage' of the text. so when the keybinding is a success and 'f' can be used to toggle auto-fw on/off does this solution as well apply to I) games without a command-line in general and/or II) those other cases i talked about in which the command-line disappears somehow ingame?? In other words is it possible to play a game without it just by binding a key to toggle auto-fw if gaming??


the reason behind my request is that i really hate to play any ren´py games without using those functions but by just clicking through it, a 100 to 1000 times...its senseless and stressful cuz why are such core features implement to a software if u cannot use it at all hm....seriously!? worst case: command line on screen disappears magically in a blink of an eye and you hit a key by accident or try to enter any menu. auto-fw text is danzo -- faps ruined, moods smashed & imaginations shattered into pieces!! muhahahaha jk. anyways, fuck dis!!!

C) so if u can help me here i need a step by step manual. an idiots safety version plz^^ searched the web allready to solve it and found this thread . the ren´py creator himself is posting there to help out...but its just confusing for ppl like me. nowhere is said which of the rpy.files has to be changed exactly in the process! also there are different solutions given which variate more or less in the code so iam unsure which one is the best 4 me concerning the emphasized problems. words like init python, ui.keymaps and modding code in general gets me sort of mind-boggled. i tried to search keywords (e.g. preferences) in almost every rpy file i opened changing the parameters by the code given . it all ends up crashing on gamestart or otherwise the changes made aren´t applied as intended and with no effect at all if testing..ahhhhhhhh senpai

lemmasoft forum link:
You don't have permission to view the spoiler content. Log in or register now.
i found another thread here in our forum which sadly is not helpful. link:
You don't have permission to view the spoiler content. Log in or register now.

help appreciated, tx in advance!! greez my5tii
 

recreation

pure evil!
Respected User
Game Developer
Jun 10, 2018
6,326
22,756
in screens.rpy look for "Quick Menu Screens"
under the textbuttons add:
Python:
            textbutton _("Auto") action Preference("auto-forward", "toggle") #Show Auto-forward button
            key "f" action Preference("auto-forward", "toggle") #Auto-forward text by pressing f on the keybord
watch the indentation ;)
 

my5tyfixx

Member
Dec 20, 2017
140
109
recreation maaaa man. iam at work now so i cannot check it out yet. later when iam at home i will give it a try. my first impression was like 'come on bro it isn´t that simple as you telling me here..' :rolleyes::D

well if iam wrong on it you are definetly one of my superheros without a doubt and besides iam going to write your name down in my book of the coolest dudes 4 sure sir! point. hrhrhr :cool::cool:
 
  • Like
Reactions: recreation

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,607
2,254
In my case, I got fed up of playing games that didn't include an "auto" button, or had disabled the whole shortcuts bar.

My solution was to add config.keymap['toggle_afm'].append("alt_K_PAGEUP") to the gui.rpy file.

Edit: Added an override .rpy file which adds this automatically (as well as setting the default sound volumes, default text speed, switching on the dev console and developer modes and defaulting games to full screen.) My override file is attached and works with most games without having to edit the original. Obviously you may not like my preferred text speed or full screen or something... in which case, just remove those lines.

Most* games have a gui.rpy file that starts like:
Python:
init python:
    gui.init(1920, 1080)
*Works 99% of the time. I think I've come across ONE game where it didn't work for some reason and one other game that had removed the gui.rpy file completely.

I change it to:
Python:
init python:
    gui.init(1920, 1080)
    config.keymap['toggle_afm'].append("alt_K_PAGEUP")
In my case, I'm using ALT+PAGEUP as my toggle keys. And doing it this way means I don't need to worry about whether the quick-menu bar is shown or not. I just press my key and it toggles auto-forward on or off.

You might have to use UnRen to get access to the gui.rpy file, so you can edit it.
I'm sure @recreation 's solution works too.
 
Last edited:

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,862
16,002
You might have to use UnRen to get access to the gui.rpy file, so you can edit it.
Or you can do it without the need to edit a file :
[myShortcut.rpy]
Python:
init python:
    config.overlay_screens.append( "myQM" )

style mQMtb is empty:
    bottom_margin 10
    hover_bottom_margin 0

style mQMtb_text is empty:
    bold True
    color "#FFF"
    size 15
    hover_size 25
    outlines [ ( 1, "#000", 0, 0 ) ]

screen myQM:
    zorder 1000

    drag:
        drag_offscreen False
        yalign 1.0
        xalign 0.0
        drag_handle (0, 0, 1.0, 1.0)

        frame style "default":
            xsize 50
            vbox:
                textbutton "Back" style "mQMtb" action Rollback()
                null height 5
                textbutton "Auto" style "mQMtb" action Preference("auto-forward", "toggle")
                null height 5
                if config.console is True:
                    textbutton "Console" style "mQMtb" action Function( store._console.enter )
It's a dirty code, but it works fine and it's transparent for Ren'py ; as long as the game don't mess with the overlays.
 

my5tyfixx

Member
Dec 20, 2017
140
109
well folks first of all i appreciate your help a lot. still i had not enough time to test every solution given and to add ofc it did not solve the probs i mentioned anyways. cuz iam really short in time now i just can give ya a simple recap at least. an advanced version of it follows within the next days (including pics which will make the troubleshooting much more easier to help me out)..

a) using recreations "Quick Menu Screens" method (game: a better tomorrow v0.10) changing the screens.rpy file failed! when pressing the f-key after the changes are added it appears to be that 'f' is just a copy of the alt_enter shortcut which allows u to switch between window/full mode. that´s it..

b) using flavors method by changing the gui.rpy file (game: the tyrant) ended in a fail too. using the binding keys assumptioned iam not able to toggle auto forward on/off pressing them

c) could not give aons solution a try yet

in the end have a very significant q to flavors line 'You might have to use UnRen to get access to the gui.rpy file, so you can edit it' - just to get it clear once and 4 all here friends...is it a recommendation only or thee prog needed to change game related code and rpy-file?? might be a big point now cuz i used the standard win wordpad to apply any made changes in the past. MAYBE THAT`S the issue then!
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,607
2,254
b) using flavors method by changing the gui.rpy file (game: the tyrant) ended in a fail too. using the binding keys assumptioned iam not able to toggle auto forward on/off pressing them
Odd.
The Tyrant is one of the many games I've added that code to myself... and it worked just fine.

have a very significant q to flavors line 'You might have to use UnRen to get access to the gui.rpy file, so you can edit it' - just to get it clear once and 4 all here friends...is it a recommendation only or thee prog needed to change game related code and rpy-file??
UnRen is just a recommendation.

A lot of games compress all their source code into a .rpa file. It's like a .zip file elsewhere, in that it contains all the files the game uses.

Not all games use .rpa files. So not all games need to be unpacked.

In addition, RenPy also uses .rpyc files, which are internal compiled versions of the RenPy source code held in the .rpy file. A game can be distributed with only the .rpyc files... and UnRen includes an option to convert the .rpyc file back into an .rpy file - so you can edit them.

Basically, if you can see a gui.rpy file... you don't need UnRen.
If you can only see .rpyc files... you can use UnRen to recreate the .rpy files.
If you can only see .rpa files... you can use UnRen to unpack the .rpa files.

But there are other programs that can do the same job. I personally have never found a reason to look beyond UnRen, but I'm sure someone else could offer a list of other programs that would do the job just as well, if not better.

As far as editing the source .rpy files... generally speaking... RenPy will complain if you mess it up. The most common mistake is to add <TAB> characters into the source. RenPy checks for that before doing almost anything else. Trust me, you couldn't miss it if you did something wrong.

Personally, I use the . It includes things I find helpful, like automatically converting <TAB> characters into <SPACE>*n characters and in inbuilt spell checker I can override to spell check in US English, rather than my native language. If you're using something else... then as long as you don't end up screwing up the formatting (and RenPy will generally tell you if you have)... then it's fine too.

As to why using my changes in The Tyrant haven't worked for you... I can only guess.
Perhaps you are using a laptop and pressing the ALT key and the Page-Up key together isn't generating the same keyboard response codes (PageUp can sometimes be a FN key press on laptops).
Perhaps you have misunderstood what ALT and/or PAGEUP are on a keyboard. Press and hold ALT, then press PAGEUP.
Perhaps you've mistyped the command (the key name is case sensitive.).

I've just tried both these in The Tyrant... and both these (plus my original suggestion)... all work for me...

Python:
init -2 python:
    gui.init(1920, 1080)
    config.keymap['toggle_afm'].append("#")
Python:
init -2 python:
    gui.init(1920, 1080)
    config.keymap['toggle_afm'].append("K_F8")
The first uses the hash/gate key. The second uses the F8 function key. Hell, if you really want to simplify things, just use "f" as recreation first suggested.

Python:
init -2 python:
    gui.init(1920, 1080)
    config.keymap['toggle_afm'].append("f")
(Tested this to be working too).

Just keep in mind, that since The Tyrant has hidden the quickbar completely... your only visual indication that the toggle is working properly is when things auto advance. One of the advantages that Anne's solution offers is an onscreen indicator of what's going on.
Plus if you click anywhere to advance... it's very easy to untoggle autoforward without noticing.

I'd suggest starting a conversation with someone and then pressing whatever key or combination of keys you've picked... and seeing if things progress automatically.
If you can see the toggle working, but then autofoward stops working... just press the toggle key again. Chances are you pressed something or clicked somewhere that cause the auto forward toggle to become reset (like hiding the UI or clicking the background).
 

my5tyfixx

Member
Dec 20, 2017
140
109
well 79flavors 1st of all i wanna tuvm sir for your immensive help and the time you put in answering my q´s!! i rly try undercover into deep relating the ren´py code and the stuff with using UnRen like the various basic situations you state out. i guess i worked the last 2 couple of hours with trial and error on the solutions were made above...

iam happy to tell that i first solve teh prob with your gui.rpy suggestion in the tyrant. ofc iam just a braindead noob as it comes out after reading this: 'Perhaps you have misunderstood what ALT and/or PAGEUP are on a keyboard. Press and hold ALT, then press PAGEUP' - 4 real!? yes 4 real bro o_O:ROFLMAO:
still i have some other questions which came up facing the auto-toggle fw issues closer and besides my own purpose to just understand it lil better in general. but this is 4 some other day to add up here cuz i have to leave now..

to sum up i definetly can see a light in the shadows somehow guys hrhr!! peace yo ;)
 

abhi1180

Active Member
Sep 12, 2018
525
419
Odd.
The Tyrant is one of the many games I've added that code to myself... and it worked just fine.


UnRen is just a recommendation.

A lot of games compress all their source code into a .rpa file. It's like a .zip file elsewhere, in that it contains all the files the game uses.

Not all games use .rpa files. So not all games need to be unpacked.

In addition, RenPy also uses .rpyc files, which are internal compiled versions of the RenPy source code held in the .rpy file. A game can be distributed with only the .rpyc files... and UnRen includes an option to convert the .rpyc file back into an .rpy file - so you can edit them.

Basically, if you can see a gui.rpy file... you don't need UnRen.
If you can only see .rpyc files... you can use UnRen to recreate the .rpy files.
If you can only see .rpa files... you can use UnRen to unpack the .rpa files.

But there are other programs that can do the same job. I personally have never found a reason to look beyond UnRen, but I'm sure someone else could offer a list of other programs that would do the job just as well, if not better.

As far as editing the source .rpy files... generally speaking... RenPy will complain if you mess it up. The most common mistake is to add <TAB> characters into the source. RenPy checks for that before doing almost anything else. Trust me, you couldn't miss it if you did something wrong.

Personally, I use the . It includes things I find helpful, like automatically converting <TAB> characters into <SPACE>*n characters and in inbuilt spell checker I can override to spell check in US English, rather than my native language. If you're using something else... then as long as you don't end up screwing up the formatting (and RenPy will generally tell you if you have)... then it's fine too.

As to why using my changes in The Tyrant haven't worked for you... I can only guess.
Perhaps you are using a laptop and pressing the ALT key and the Page-Up key together isn't generating the same keyboard response codes (PageUp can sometimes be a FN key press on laptops).
Perhaps you have misunderstood what ALT and/or PAGEUP are on a keyboard. Press and hold ALT, then press PAGEUP.
Perhaps you've mistyped the command (the key name is case sensitive.).

I've just tried both these in The Tyrant... and both these (plus my original suggestion)... all work for me...

Python:
init -2 python:
    gui.init(1920, 1080)
    config.keymap['toggle_afm'].append("#")
Python:
init -2 python:
    gui.init(1920, 1080)
    config.keymap['toggle_afm'].append("K_F8")
The first uses the hash/gate key. The second uses the F8 function key. Hell, if you really want to simplify things, just use "f" as recreation first suggested.

Python:
init -2 python:
    gui.init(1920, 1080)
    config.keymap['toggle_afm'].append("f")
(Tested this to be working too).

Just keep in mind, that since The Tyrant has hidden the quickbar completely... your only visual indication that the toggle is working properly is when things auto advance. One of the advantages that Anne's solution offers is an onscreen indicator of what's going on.
Plus if you click anywhere to advance... it's very easy to untoggle autoforward without noticing.

I'd suggest starting a conversation with someone and then pressing whatever key or combination of keys you've picked... and seeing if things progress automatically.
If you can see the toggle working, but then autofoward stops working... just press the toggle key again. Chances are you pressed something or clicked somewhere that cause the auto forward toggle to become reset (like hiding the UI or clicking the background).
I tried your method but every time it says parsing script fail. What to do please help?
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,607
2,254
I tried your method but every time it says parsing script fail. What to do please help?
Difficult to know.
It could be as simple as using an editor which doesn't convert tabs to spaces. However...

I'm going to guess that you added the code I've suggested somewhere else than I intended.

In the case of The Tyrant, the only line I added was the config.keymap['toggle_afm'].append("alt_K_PAGEUP"), the other lines like gui.init(1920, 1080) were already there and I quoted them as a way of putting the code in the same place I did.

However, just in case... I'll be clearer. You need to edit the gui.rpy file, after using UnRen to unpack the RPA file and convert the RPYC files back into their RPY source code.

If you're done all this already... then I'm really not sure.

I haven't played the Tyrant since 0.6, but I've just downloaded the latest (0.75p1) and done exactly what I've described above and it works for me.
 

abhi1180

Active Member
Sep 12, 2018
525
419
Difficult to know.
It could be as simple as using an editor which doesn't convert tabs to spaces. However...

I'm going to guess that you added the code I've suggested somewhere else than I intended.

In the case of The Tyrant, the only line I added was the config.keymap['toggle_afm'].append("alt_K_PAGEUP"), the other lines like gui.init(1920, 1080) were already there and I quoted them as a way of putting the code in the same place I did.

However, just in case... I'll be clearer. You need to edit the gui.rpy file, after using UnRen to unpack the RPA file and convert the RPYC files back into their RPY source code.

If you're done all this already... then I'm really not sure.

I haven't played the Tyrant since 0.6, but I've just downloaded the latest (0.75p1) and done exactly what I've described above and it works for me.
"convert the RPYC files back into thier RPY source code" Not getting this do i have to do this or unren will do it.
 

abhi1180

Active Member
Sep 12, 2018
525
419
Difficult to know.
It could be as simple as using an editor which doesn't convert tabs to spaces. However...

I'm going to guess that you added the code I've suggested somewhere else than I intended.

In the case of The Tyrant, the only line I added was the config.keymap['toggle_afm'].append("alt_K_PAGEUP"), the other lines like gui.init(1920, 1080) were already there and I quoted them as a way of putting the code in the same place I did.

However, just in case... I'll be clearer. You need to edit the gui.rpy file, after using UnRen to unpack the RPA file and convert the RPYC files back into their RPY source code.

If you're done all this already... then I'm really not sure.

I haven't played the Tyrant since 0.6, but I've just downloaded the latest (0.75p1) and done exactly what I've described above and it works for me.
File "game/gui.rpy", line 12: invalid syntax
gui.init(1920, 1080)config.keymap['toggle_afm'].append("f") it shows like this...
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,862
16,002
File "game/gui.rpy", line 12: invalid syntax
gui.init(1920, 1080)config.keymap['toggle_afm'].append("f") it shows like this...
Well, they should be two different lines.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,862
16,002
How it should be coded then? Please tell me as iam not able to identify the error...
Exactly like shown on 79flavors ' message:
Code:
init -2 python:
    gui.init(1920, 1080)
    config.keymap['toggle_afm'].append("f")
 

abhi1180

Active Member
Sep 12, 2018
525
419
Difficult to know.
It could be as simple as using an editor which doesn't convert tabs to spaces. However...

I'm going to guess that you added the code I've suggested somewhere else than I intended.

In the case of The Tyrant, the only line I added was the config.keymap['toggle_afm'].append("alt_K_PAGEUP"), the other lines like gui.init(1920, 1080) were already there and I quoted them as a way of putting the code in the same place I did.

However, just in case... I'll be clearer. You need to edit the gui.rpy file, after using UnRen to unpack the RPA file and convert the RPYC files back into their RPY source code.

If you're done all this already... then I'm really not sure.

I haven't played the Tyrant since 0.6, but I've just downloaded the latest (0.75p1) and done exactly what I've described above and it works for me.
please send me your gui.rpy edited file it will help me for sure thnx ....
 

drKlauz

Newbie
Jul 5, 2018
40
24
Why do you want to unrpa/unrpyc/edit gui at all? Just put rpy patch in game directory, game should pick it up automatically. Or am i missing something?
 

abhi1180

Active Member
Sep 12, 2018
525
419
Why do you want to unrpa/unrpyc/edit gui at all? Just put rpy patch in game directory, game should pick it up automatically. Or am i missing something?
I tried 79 flovours method in which you have to edit this file to toggle auto forward but no matter what it always says parsing script fail or syntax error that is why i posted like that...