Choice Menu Voice Over

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
wyverngem
Miko-Class Veteran
Posts: 613
Joined: Mon Oct 03, 2011 7:27 pm
Completed: Simple as Snow, Lady Luck's Due,
Projects: Aether Skies, Of the Waterfall
Tumblr: casting-dreams
itch: castingdreams
Location: USA
Contact:

Choice Menu Voice Over

#1 Post by wyverngem » Tue Jan 21, 2020 9:22 pm

I feel as if I'm missing this somwhere, but is there a way to add a voice overs to the menu choices in Renpy? Would the self-voicing talk over it? I decided that my narrator is going to have a voice, but can't seem to wrap my head around adding the files to the menu choices.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 2977
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: Choice Menu Voice Over

#2 Post by Imperf3kt » Tue Jan 21, 2020 10:02 pm

self voicing does read menus and choices, but I think you can just play a sound file before the menu and add a hover_sound to your options. How, I'm not sure.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
Free Android GUI - Updated occasionally

User avatar
wyverngem
Miko-Class Veteran
Posts: 613
Joined: Mon Oct 03, 2011 7:27 pm
Completed: Simple as Snow, Lady Luck's Due,
Projects: Aether Skies, Of the Waterfall
Tumblr: casting-dreams
itch: castingdreams
Location: USA
Contact:

Re: Choice Menu Voice Over

#3 Post by wyverngem » Wed Jan 22, 2020 9:53 am

So I figured out a way to do this. What I had to do was add a enumerate n to keep track of how many choices I had starting at one. I then created a menu_voice_slot string that contained the appropriate menu choice ID that I used as a variable within the screen action Play().

The game will still error out if the file doesn't exist. Is there a way to check for the file so I can add a conditional instead of getting the error? Also haven't checked to see if there's overlap in the self-voicing as it's on my brother's PC.

Here's what we're working with. I'm open for better ways to do this.

Code: Select all

define e = Character("Eileen")
default choice_id = 1
label start:
    scene background
    e "You've created a new Ren'Py game."
    $ choice_id = 1
    menu:
        "Choice 1":
            "Game continues."
        "Choice 2":
            "Game continues."
        "Choice 3":
            "Game continues."
    e "Once you add a story, pictures, and music, you can release it to the world!"
    return

## Modified Choice screen ###############################################################
##
## This screen is used to display the in-game choices presented by the menu
## statement.

##Wyverngem's Modification Notes
## Enumertae the items we have starting at one to change the value on n. Then
## create a menu_voice_slot string that contains the appropriate menu choice ID.
## Use that menu_voice_slot as the variable in the Play() hovered action within
## the textbutton.
## 
## The game will error out if the file does not exist. Don't know how to check for
## the missing file to prevent this.
##
## Not tested for Self-voicing compatibility

screen choice(items):
    style_prefix "choice"

    vbox:
        for n, i in enumerate(items, 1):
            $ menu_voice_slot = "audio/choice" + str(choice_id) + "_" + str(n) + ".ogg"
            #$ menu_voice_slot = menu_voice[n]
            textbutton i.caption:
                action i.action
                hovered Play('voice', menu_voice_slot)

Post Reply

Who is online

Users browsing this forum: No registered users