Making voicing code less visible/shorter?

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
SundownKid
Lemma-Class Veteran
Posts: 2299
Joined: Mon Feb 06, 2012 9:50 pm
Completed: Icebound, Selenon Rising Ep. 1-2
Projects: Selenon Rising Ep. 3-4
Organization: Fastermind Games
Deviantart: sundownkid
Location: NYC
Contact:

Making voicing code less visible/shorter?

#1 Post by SundownKid »

I am adding voice acting to parts of my game, and I have the labeling down pact, but I am wondering if there was a way to make the formatting less intrusive. Right now I have to put:

Code: Select all

play voice "blabla.ogg"
c "Character says something"
Before every line, and it's kind of distracting when writing is concerned. Is there a way to streamline this or make the commands less visible?

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Making voicing code less visible/shorter?

#2 Post by nyaatrap »

something like

Code: Select all

$voice(track1)
can be implemented using ren'py.music.play()
I don't know better way than this ._.

SundownKid
Lemma-Class Veteran
Posts: 2299
Joined: Mon Feb 06, 2012 9:50 pm
Completed: Icebound, Selenon Rising Ep. 1-2
Projects: Selenon Rising Ep. 3-4
Organization: Fastermind Games
Deviantart: sundownkid
Location: NYC
Contact:

Re: Making voicing code less visible/shorter?

#3 Post by SundownKid »

What I really wish there was was a command like

Code: Select all

begin voice block "voice/part1_%s.ogg"
p "I am person 1"
d "I am person 2"
end voice block
Which would automatically find the number of separate lines between the beginning and end, and play numbered voice files in sequence (with the string being the number). That would eliminate much of the grunt work of placing "play voice" commands before every sentence.

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Making voicing code less visible/shorter?

#4 Post by Alex »

You could make a function that returns voice and character words, like

Code: Select all

init python:
    def my_func(x, y, z):
        renpy.music.play(x, "voice")
        renpy.say(y, z)

label start:
    $ my_func ("track1.ogg", e, "Hello, it's me - Eileen")
    $ my_func ("track2.ogg", None, "test-test")
http://www.renpy.org/wiki/renpy/doc/reference/Audio

SundownKid
Lemma-Class Veteran
Posts: 2299
Joined: Mon Feb 06, 2012 9:50 pm
Completed: Icebound, Selenon Rising Ep. 1-2
Projects: Selenon Rising Ep. 3-4
Organization: Fastermind Games
Deviantart: sundownkid
Location: NYC
Contact:

Re: Making voicing code less visible/shorter?

#5 Post by SundownKid »

I don't see how doing that would streamline the process, though, it's still the same amount of extra cruft if not moreso. I was looking for a way to do it without using any filenames. Maybe there could be something that uses the music queue?

Post Reply

Who is online

Users browsing this forum: Google [Bot]