Tutorial Ren'Py How to limit the self-voicing in games you play.

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,960
16,196
Ren'Py self-voicing is a really interesting feature, too often neglected by games authors. This lead to a situation where it's often unusable, because every element of the User Interface will be voiced.
But by chance it's possible to solve this issue in a relative easy way.

Ren'Py self-voicing rely on an attribute named alt, that will tell Ren'Py what text should be voiced. While it was initially intended for the graphic elements ("start button" by example for an image with wrote "start" on it), it is also used for pure text elements.
Therefore, to remove the "parasite texts" from the self-voicing feature, you just need to give them an empty value for the alt attribute: alt "".

Where it become interesting, is that this attribute can be defined directly in the style. This mean that it will automatically apply to all the elements using this style.
By default, Ren'Py apply the style named "text" to all the... text displayed in a screen, therefore with a basic file of two lines, you can exclude the text from the self voicing, this for most of the games. Here's how to do:
  1. Create a file named "zz-silent.rpy" ;
  2. With any text editor, write this inside it:
    Code:
    style text:
    alt ""
  3. Save the file and keep a copy in a safe place.
Once this is done, you just need to copy the file in the "[path to the game]/game" directory ; the one where there's the "rpa"/"rpy"/"rpyc" files. And you'll have a cleaner self voiced game.


Now, there's one issue, this just cover the default style. But games sometimes use their own styles. No panic, you can easily find the name of those styles, this without the need to some technical knowledge.
When the game is playing, and you found a text that is included in the self-voicing:
  1. Place the mouse cursor hover the text ;
  2. Press SHIFT + i ;
  3. You'll see a screen that will looks like this:
    style inspector.jpg
  4. Search the line with the faulty text, here it's "Context 0" ;
  5. Look the third column, to get the name of the style used, here "AONlabelTracker_text" ;

Now that you have the name of the style, you can easily update the copy of "zz-silent.rpy" file you use for this game.
Open it with a text editor, and mimic the two lines already present. In my example the final file would looks like this:
Code:
style text:
   alt ""

# My Game
style AONlabelTracker_text:
   alt ""
If you're playing a game still in progress, you can also add this new style in the original copy of your "zz-silent.rpy" file. Ren'Py will not complain if you update a style that it don't know.
Just add a comment before the new styles (the # My game in the example above), with the name of the game using this style. It will help you remember what style apply to what game.

And it's all, you can now enjoy Ren'Py self voicing with less parasite texts. I hope this will help you.

Edit: Few typos (there's surely stil) and a format error.
 
Last edited:

miketyson7584

New Member
Feb 17, 2018
8
2
```
I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


File "game/zz-silent.rpy", line 1: style statement expects a non-empty block.
style text:
^

i m getting this error what should i do??
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,960
16,196
File "game/zz-silent.rpy", line 1: style statement expects a non-empty block.
style text:
^

i m getting this error what should i do??
Not forgoting the folliwing alt "", leading space included.
 

miketyson7584

New Member
Feb 17, 2018
8
2
its giving error :
i have done as u said
style text:
alt ""

its giving error Screenshot (269).png

i dont know anything about this stuff .
 
Nov 7, 2017
474
954
I've been looking for a way to get the self-voicing (I love this text-to-speech feature that reads for me that I use a lot in Ren'Py games and I wish this feature was in Unity and Unreal Engine games too) to read only the dialogue of the story and where the characters and the narrator are speaking in a Ren'Py game but not to read everything like all of the other text on menus and game stats. I find it pretty annoying that it reads everything before it gets to the dialogue. I'm glad there's a work around for this. Thank you posting this and it definitely works while I have one issue with it though. I can't open up the menu where you just press SHIFT + I , it doesn't work at least when I'm playing "Lab Rats 2 - Reformulate" but I can get it open with "WTM Academy" though.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,960
16,196
I can't open up the menu where you just press SHIFT + I , it doesn't work at least when I'm playing "Lab Rats 2 - Reformulate" but I can get it open with "WTM Academy" though.
From memory it need the developer mode to be enabled for it to works. And some games don't marry well with it.
 
  • Like
Reactions: Dark Lord Nova
Nov 7, 2017
474
954
From memory it need the developer mode to be enabled for it to works. And some games don't marry well with it.
Okay that explained it. I don't think I really need to open it for Lab Rats 2 since it does mostly the job while still might not ignored all the text I want but that's okay. I tried it on another game and it worked fine besides completely working in WTM Academy. Thanks again though! :)
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,960
16,196
Do you know how to enable Voice Assistant & Auto Forward [Simultaneously] in renpy?
Well, normally by enabling both.
I know that for voiced dialog lines, the auto forward will not be faster than the voice. I assume that it should works the same with the Voice Assistant, but I don't guaranty it.
 

MATAFAKA

Newbie
Mar 7, 2019
97
23
Enabling Self voice and auto-forward same time it does not work. I try customer script to enable it and failure.
Can you look it code and help me little bit.

Code:
init python:
    
    def enable_auto_and_voicing():
        renpy.preferences.afm_enable = True  
        renpy.self_voicing = True           


    def toggle_auto_and_voicing():
    
        renpy.preferences.afm_enable = not renpy.preferences.afm_enable
        
   
        renpy.self_voicing = not renpy.self_voicing

    config.keymap['toggle_auto_voicing'] = [ 'x' ]  # Press 'x' to toggle
I have add this in options.rpy.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,960
16,196
Enabling Self voice and auto-forward same time it does not work.
I just tried with two games, one with the 7.3.5 version of Ren'Py, one with the 8.2.1 version, and with both Self voicing works without problem with the auto-forward.

Edit:
Focused on the issue and forgot to look correctly to the code...

And well, it was an error, because it's totally broken. Neither renpy.preferences.afm_enable nor renpy.self_voicing exist.

The correct code should be:
Code:
init python:
   
    def enable_auto_and_voicing():
        _preferences.afm_enable = True 
        _preference.self_voicing = True          

    def toggle_auto_and_voicing():
         _preferences.afm_enable = not _preferences.afm_enable
        _preferences.self_voicing = not _preferences.self_voicing
 
Last edited: