How to have default sprites automatically show/hide when a specific character is talking?

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
EMPLOYEE 472
Newbie
Posts: 1
Joined: Wed Jun 08, 2022 12:42 am
Projects: Danganronpa: Greenlit
Tumblr: employee-472
Location: Chicago, USA
Discord: EMPLOYEE 472#7457
Contact:

How to have default sprites automatically show/hide when a specific character is talking?

#1 Post by EMPLOYEE 472 »

Hello!! :D Fairly new and bad at coding, wasn't finding exactly what I was looking for when looking through old posts.

I am writing a story with an ensemble of characters that often have group discussions, and it seems overly tedious to write the code for showing and hiding sprites since its usually only for a couple lines of dialogue at a time (and it's especially daunting with like 20k words worth so far -_-). When defining letters as characters, I put image=[imagename], but they don't show up automatically. Here are some sample lines from the define code if it matters, all characters have the same format but different colors and images n stuff.

Code: Select all

define k = Character("Komang Utama", color="#C4135D" , image="komang", what_slow_cps=70, what_slow_abortable=False)
define y = Character("Yuri Kita", color="#AD0174" ,image="yuri", what_slow_cps=70, what_slow_abortable=False)
define e = Character("Eliana Torres", color="#FAE599" ,image="eliana", what_slow_cps=70, what_slow_abortable=False)
Basically I am looking to (by default) have a character's default sprite show up automatically when they are speaking, and to disappear when somebody else is speaking, so I wouldn't have to keep rewriting show and hide codes between dialogue.
(also it may be complicated but if anybody knows how to make an automatic exception for the main character define k = Character("Komang Utama") that would be awesome :D)

Thank you in advance and I'm sorry if this has already been asked!

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot], Silac