Creating a button for self-voicing

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
User avatar
Kinmoku
Miko-Class Veteran
Posts: 529
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: Love IRL, Memories
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

Creating a button for self-voicing

#1 Post by Kinmoku » Fri May 14, 2021 6:22 am

Hi all,

I need to remove the key binding (v) for self voicing, as there's a moment in my game where the player needs to press v for another reason...
So instead of removing the accessibility feature, is it possible to create a button in preferences where the player can switch this on if they want? I'm probably being dumb here, but I've no idea what the action would be and I can't seem to find anything in the doc or on the forums.

Thanks in advance :)

User avatar
midgethetree
Regular
Posts: 25
Joined: Wed Dec 30, 2020 3:51 pm
Completed: Appetité Amor, The Mother of Pearls
Projects: Anise Flowers, When Everyone's Watching
Github: midgethetree
itch: midge-the-tree
Contact:

Re: Creating a button for self-voicing

#2 Post by midgethetree » Fri May 14, 2021 3:31 pm

Something like

Code: Select all

label _("Self-Voicing")

textbutton _("Off"):
    action Preference("self voicing", "disable")
    alt _("self voicing off")

textbutton _("Text-to-speech"):
    action Preference("self voicing", "enable")

textbutton _("Clipboard"):
    action Preference("clipboard voicing", "enable")
will do the trick, or just

Code: Select all

textbutton _("Self-Voicing"):
    action Preference("self voicing", "toggle")
if you really just want one button and don't care about clipboard voicing (which allows Renpy's text-to-speech to be used with the player's preferred third-party screenreader, as I understand it).

That said, just adding a button in your settings menu is not enough to make up for removing the "v" keybinding. I remember reading an article from a blind person who plays visual novels, and they said if they don't hear anything after opening a Ren'Py game and pressing "v" they assume the VN doesn't support text-to-speech at all and give up on it. TTS is not a common game feature outside of Ren'Py games, so it's easy to assume there isn't any button for it in the settings menu, and even if they somehow know there is a button (and not everyone carefully reads everything about a game before downloading, so it's hard to guarantee they do know) they might not want/be able to get a sighted person to help them navigate to that button.

Is it really important that the keybinding for that moment be "v"? Would it work if you could have "v" turn on/off self-voicing except for in that moment?

Post Reply

Who is online

Users browsing this forum: henne, henvu50, Imperf3kt