• To improve security, we will soon start forcing password resets for any account that uses a weak password on the next login. If you have a weak password or a defunct email, please update it now to prevent future disruption.

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
Respected User
Donor
Jun 10, 2017
10,202
14,939
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
Respected User
Donor
Jun 10, 2017
10,202
14,939
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
412
802
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
Respected User
Donor
Jun 10, 2017
10,202
14,939
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.