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.
I am trying to switch text boxes depending on certain in-game conditions. For example, a character's dialogue box changes depending on where he is on the screen.
Well, I don't know exactly how you're trying to implement anything but your current code combines a name (speech_) with a string ("bubble") in a way that probably throws up an error.
If what you're trying to do is eventually have screen be "screen_center" or "screen_left", etc., then it should probably be
but now I'm getting an error saying "Keyword can't be an expression." or something like that. THe idea is that bubble is a variable which can have string values like "center", "right", etc.
Any suggestions on how I get that dynamic filename to work?
define hLeft = Character(None, window.background = "art/gui/Dialogue_Left.png")
define hRight = Character(None, window.background = "art/gui/Dialogue_Right.png")
define hCenter = Character(None, window.background = "art/gui/Dialogue_Center.png")
init -1 python:
def h(what, bubble="center", **kwargs):
if bubble == "left":
hLeft(what, **kwargs)
elif bubble == "right":
hRight(what, **kwargs)
elif bubble == "center":
hCenter(what, **kwargs)
label start:
$h("This text will show up using the left bubble.", "left")
$h("This text will show up using the right bubble.", "right")
$h("This text will show up using the center bubble.", "center)
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)