I'm still a total noob when it comes to Ren'py, so I'm sort of hesitant to post this, but what the heck! Maybe it will help.
This is sort of a piggyback off of Keinart's suggestion.
screens.rpy:
I tried to modify the say screen to have Groose's portrait show up for any character, and what's cool about this is that you can have more than one side image per character. For example, one of the characters from my wip game has a relationship bar that changes depending on a numeric variable, but I also wanted the main character's side image to appear when he was speaking; all I had to do was set
"show_side_image=" to the mc's portrait and
"image=" to the relationship meter when defining the character.
There might be some unnecessary code, but so far I've had no problems with it. It's taken almost directly from Alex's post
here.
Code: Select all
screen say:
# Defaults for side_image and two_window
default side_image = None
default two_window = False
default side_xalign = 0.0 # default values, so you don't need to change all the characters
default side_yalign = 1.0
# Decide if we want to use the one-window or two-window variant.
if not two_window:
# The one window variant.
window:
id "window"
has vbox:
style "say_vbox"
if who:
text who id "who"
text what id "what"
else:
# The two window variant.
vbox:
style "say_two_window_vbox"
if who:
window:
style "say_who_window"
text who:
id "who"
window:
id "window"
has vbox:
style "say_vbox"
text what id "what"
# If there's a side image, display it above the text.
if side_image:
add "Groose" xalign -0.10 yalign -0.50
add SideImage() xalign side_xalign yalign side_yalign
else:
add SideImage() xalign side_xalign yalign side_yalign #xalign 0.0 yalign 1.0
# Use the quick menu.
use quick_menu
# Use the quick menu.
use quick_menu
script.rpy:
Here, the variable "grooseemo" determines the side image for Groose, but of course you can change the name of the variable to anything you want. The images for him are all named "groose_
something", with 'something' being the emotion I want him to have. Any time I want to change his portrait, all I have to do is type out something like
$grooseemo = INSERTEMOTIONHERE.
I also tested the side image appearing for both narration ("x") and other characters ("NotGroose") - both seem to work just fine.
Code: Select all
init:
$ x = Character("",
image = "Groose",
window_left_padding = 200)
$ g = Character("Groose",
image = "Groose",
window_left_padding = 200)
$ n = Character("Notgroose",
image = "Groose",
window_left_padding = 200)
image side Groose = "Groose_portrait"
image Groose_portrait:
"images/Groose/groose_%s.png"%grooseemo
# The game starts here.
label start:
$grooseemo = "neutral"
x "Here is some narration text . . ."
g "Now I'm talking as Groose."
n "And I'm talking as a person who is not Groose."
$grooseemo = "angry"
g "NOW I'M ANGRY!"
$grooseemo = "sad"
g "NOW I'M SAD!"
Again, I have like zero idea what I'm doing, but if you're aiming to do what I think you are then this may do for now? I'm sorry that it's sort of a workaround rather than a simple solution.
EDIT: I just noticed one of your images is something like "groosehair", so I thought I'd let you know that you can also use this method to layer different parts of the side image if you use a LiveComposite. You can even have the side image blink and have lip flaps if you want. Here's part of my code I'm working on for the customizable main character's side image in my game:
Code: Select all
init python:
def draw_character(st, at):
return LiveComposite(
(600, 1850),
(0, 0), "images/characters/Player/Skintone/base/%s.png"%skintone ,
(0, 0), "images/characters/Player/Skintone/eyelids/%s.png"%skintone ,
(0, 0), WhileSpeaking("draw_character", "mc_mouth", "mc_mouth_rest"),
(0, 0), "mc_blink"
),.1
#--MAIN IMAGES-----------------------------------------------------------------#
init:
image character:
DynamicDisplayable(draw_character)
image character2:
DynamicDisplayable(draw_character)
zoom .75
#--EYES------------------------------------------------------------------------#
image mc_blink:
"images/characters/Player/Eyes/"+ eye_emo +"/%s.png" % (eyecolor)
4.25
"images/characters/Player/Eyes/closed.png"
.25
repeat
#--MOUTH------------------------------------------------------------------------#
image mc_mouth_rest:
"images/characters/Player/Mouth/"+ mouth_emo +"/%s/1.png" % (skintone)
image mc_mouth:
"images/characters/Player/Mouth/"+ mouth_emo +"/%s/1.png" % (skintone)
0.14
"images/characters/Player/Mouth/"+ mouth_emo +"/%s/2.png" % (skintone)
0.08
"images/characters/Player/Mouth/"+ mouth_emo +"/%s//3.png" % (skintone)
0.14
repeat
example image folder
example screenshots