Error with string Substitution inside a voice tag?

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
Jo'ogn
Veteran
Posts: 398
Joined: Sat Jul 12, 2008 1:31 pm
Projects: Kassiopeia [iVN]
Location: Deutschland
Contact:

Error with string Substitution inside a voice tag?

#1 Post by Jo'ogn » Sat May 23, 2015 5:50 am

Renpy complains about an error in a voice line where I queue two files of which one uses string substitution. I assume it once worked (some years and renpy versions ago). Now I just can't see the error? Esp. since the traceback indicates a correct substition ("Spieler" German for player, is the player's chosen name. "Daniel" in this case.). All the files are there in that path. Any help is appreciated.

I don't know why the traceback also shows a voice line (voice "vfx.Spieler/Sp.B0101.v.ogg") that hasn't been reached yet...

Code: Select all

voice ["vfx.Doris/Do.B0101.p.ogg","vfx.Doris/Do.B0101.p.%s.ogg"%(Spieler)]

Do "Aber dafür bin ich doch da, %(Spieler)s."
voice "vfx.Doris/Do.B0101.pb.ogg"
extend " War es wirklich so schlimm?"
voice "vfx.Spieler/Sp.B0101.v.ogg"
Sp "Ich werd's überleben, ich brauch nur etwas Schlaf."

Code: Select all

While running game code:
  File "game/B0.rpy", line 646, in script
    voice "vfx.Spieler/Sp.B0101.v.ogg"
IOError: Couldn't find file '['vfx.Doris/Do.B0101.p.ogg', 'vfx.Doris/Do.B0101.p.Daniel.ogg']'.

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/B0.rpy", line 646, in script
    voice "vfx.Spieler/Sp.B0101.v.ogg"
  File "E:\Renpy\renpy-6.18.3-sdk\renpy\ast.py", line 593, in execute
    renpy.exports.say(who, what, interact=self.interact)
  File "E:\Renpy\renpy-6.18.3-sdk\renpy\exports.py", line 999, in say
    who(what, interact=interact)
  File "E:\Renpy\renpy-6.18.3-sdk\renpy\character.py", line 826, in __call__
    self.do_display(who, what, cb_args=self.cb_args, **display_args)
  File "E:\Renpy\renpy-6.18.3-sdk\renpy\character.py", line 688, in do_display
    **display_args)
  File "E:\Renpy\renpy-6.18.3-sdk\renpy\character.py", line 491, in display_say
    rv = renpy.ui.interact(mouse='say', type=type, roll_forward=roll_forward)
  File "E:\Renpy\renpy-6.18.3-sdk\renpy\ui.py", line 247, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "E:\Renpy\renpy-6.18.3-sdk\renpy\display\core.py", line 2149, in interact
    repeat, rv = self.interact_core(preloads=preloads, **kwargs)
  File "E:\Renpy\renpy-6.18.3-sdk\renpy\display\core.py", line 2428, in interact_core
    renpy.audio.audio.interact()
  File "E:\Renpy\renpy-6.18.3-sdk\renpy\audio\audio.py", line 946, in interact
    periodic()
  File "E:\Renpy\renpy-6.18.3-sdk\renpy\audio\audio.py", line 880, in periodic
    c.periodic()
  File "E:\Renpy\renpy-6.18.3-sdk\renpy\audio\audio.py", line 349, in periodic
    topf = load(self.file_prefix + topq.filename + self.file_suffix)
  File "E:\Renpy\renpy-6.18.3-sdk\renpy\audio\audio.py", line 83, in load
    rv = renpy.loader.load(fn)
  File "E:\Renpy\renpy-6.18.3-sdk\renpy\loader.py", line 438, in load
    raise IOError("Couldn't find file '%s'." % name)
IOError: Couldn't find file '['vfx.Doris/Do.B0101.p.ogg', 'vfx.Doris/Do.B0101.p.Daniel.ogg']'.

Windows-7-6.1.7601-SP1
Ren'Py 6.18.3.761
Audio Plays: [original] The White Feathers Directive - [Star Wars] Through Flame and Shadow
Ren'Py: Kassiopeia [very interactive VN] work in progress - looking for proof reader english

User avatar
PyTom
Ren'Py Creator
Posts: 15469
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Error with string Substitution inside a voice tag?

#2 Post by PyTom » Sat May 23, 2015 7:58 am

Can you throw together a replication of this problem?
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
PyTom
Ren'Py Creator
Posts: 15469
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Error with string Substitution inside a voice tag?

#3 Post by PyTom » Sat May 23, 2015 8:00 am

Actually, never mind - I think the problem is simply that voice isn't specced to take a list of sound files - it only takes a single file.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]