[SOLVED] side character image on the right expressions?

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
kersplode
Regular
Posts: 67
Joined: Sat Aug 20, 2011 9:13 pm
Projects: Keep On Creepin' On
Contact:

[SOLVED] side character image on the right expressions?

#1 Post by kersplode »

hey there! i'm super new to ren'py and i want to change the position of my main character in the text box. the only way i've managed to successfully get my character on the right side of the textbox is by entering

Code: Select all

define l = Character('Lillian',
                window_right_padding=170,
                show_side_image=Image("lillian.png", xalign=1.0, yalign=1.0))
but that way i can't change her expression. i've tried all sorts of ways to change this, like how someone else said i could by changing the properties of the images when i define them

Code: Select all

image side lillian = Image("lillian.png", xalign=1.0, yalign=1.0)
image side lillian frown = Image("lillianfrown.png", xalign=1.0, yalign=1.0)
and the character herself as

Code: Select all

define l = Character('Lillian', image="lillian")
but that just makes her show up on the left again. is there any way i can make her show up on the right and only have to type things like

Code: Select all

l "hey there."
l frown "don't talk to me."
to have her display different expressions? thank you in advance!
Last edited by kersplode on Fri Jun 27, 2014 11:31 am, edited 1 time in total.

User avatar
kisa
Veteran
Posts: 384
Joined: Sat Aug 27, 2011 7:08 pm
Completed: Brother Rose, Dogs Alone
Projects: So many projects, I can't name them.
Deviantart: tsubasafan135
Skype: Discord: Kisaofbishies#6680
itch: kisa
Contact:

Re: side character image on the right expressions?

#2 Post by kisa »

I (a newbie who is still experimenting) kind of did that in a test game I'm doing by defining multiple characters of the same person...
So, it would be:

Define lnor = (insert character text)
Define lmad = (insert other character text with different code)
I'm offering commissions!
viewtopic.php?f=62&t=41656

User avatar
ArachneJericho
Regular
Posts: 196
Joined: Sun Jun 22, 2014 2:04 am
Projects: Kaguya Hime
Tumblr: mousedeerproductions
Location: Seattle, WA, USA
Contact:

Re: side character image on the right expressions?

#3 Post by ArachneJericho »

Much easier way is to edit screens.rpy.

Locate these lines:

Code: Select all

    # If there's a side image, display it above the text.
    if side_image:
        add side_image
    else:
        add SideImage() xalign 0.0 yalign 1.0
turn that xalign 0.0 into an xalign 1.0

User avatar
yuucie
Regular
Posts: 164
Joined: Sun Jun 22, 2014 4:04 am
Completed: NaNoReNo[2015] Those Without Names
Tumblr: an-na-ko
Location: Toronto, Canada
Contact:

Re: side character image on the right expressions?

#4 Post by yuucie »

uhm, I haven't experimented with side images yet, but it sounds like you labeled her expressions as "side lillian" and then her actual image as "1". So now there are two characters, one named side lillian and one named 1. Nevermind, those doesn't matter LOL. Try changing:

Code: Select all

image 1 frown = Image("lillianfrown.png", xalign=1.0, yalign=1.0)
then when you're changing her expressions:

Code: Select all

show 1 frown
 
1 "Don't talk to me"
I hope that works, I have no idea if side images work differently from characters!

User avatar
Chaotic
Regular
Posts: 30
Joined: Fri Feb 22, 2013 7:32 pm
Location: England, UK
Contact:

Re: side character image on the right expressions?

#5 Post by Chaotic »

Here's an example of me having a side image with different expressions:

Code: Select all

$ m = Character("Me", image = "m", window_left_padding = 150, window_background = Frame("ui/m.png", 0, 0))
image side m blush = im.Scale("char/m/blush.png", 150, 364)
image side m happy = im.Scale("char/m/happy.png", 150, 364)
image side m mad = im.Scale("char/m/mad.png", 150, 364)
image side m norm = im.Scale("char/m/norm.png", 150, 364)
image side m sad = im.Scale("char/m/sad.png", 150, 364)
image side m smile = im.Scale("char/m/smile.png", 150, 364)
If you ignore the "im.Scale" (that's for scaling purposes in order to make it smaller), what I've done is put

Code: Select all

 ...image = "m",...
in the Character line to allocate anything with m to be the MC.

Code: Select all

image side m ...
means it's a side image (which you want) for the character m, which is the MC. Everything after the "image side m ..." is the word I want to use for the corresponding expression.

With this done, showing the different expressioned character in the script.rpy is simple. Where you would normally put "m" (or in your case "l") in the beginning before typing the sentence, put "m" and the word used for the expression.
e.g.

Code: Select all

 
e "Yeah just waiting for Ash before we head into town."
"My heart drooped a little as he said this. Ash? Was this the mysterious person that Freddie had been talking about before?"
m sad "Ah cool."
"I knew that he didn't know about my feelings, but I couldn't help but be a little upset at him; was it not obvious enough to him that I might have a little thing for him? Evidently not since he continued talking like normal."
e "You seen Fred?"
m norm "Ah he went to the library to return some books. I'm waiting for him out here before we walk home."
e "Cool cool. So...you're probably staying for dinner right?"
m "Mmm. Probably."
"m sad" shows the sad expression and "m norm" the normal expression. The reason I've got "m" saying "Mmm. Probably." afterwards is because "m norm" is remembered (like variables) so it continues showing "m norm" until you change the expression, say, back to "m sad" by putting "m sad" instead of "m"

...I've probably confused you more (lol) but if anything needs clearing up just ask :)

User avatar
kersplode
Regular
Posts: 67
Joined: Sat Aug 20, 2011 9:13 pm
Projects: Keep On Creepin' On
Contact:

Re: side character image on the right expressions?

#6 Post by kersplode »

ArachneJericho wrote:Much easier way is to edit screens.rpy.

Locate these lines:

Code: Select all

    # If there's a side image, display it above the text.
    if side_image:
        add side_image
    else:
        add SideImage() xalign 0.0 yalign 1.0
turn that xalign 0.0 into an xalign 1.0
thank you! this one worked the best. then i just put

Code: Select all

define l = Character('Lillian', image="lillian",
                window_right_padding=180)
for the character and did all the rest as

Code: Select all

image side lillian frown = "lillianfrown.png"
image side lillian smile = "lilliansmile.png"
etc. was easiest this way. can someone mark this topic as solved? i'm not sure how to...

User avatar
chocoberrie
Veteran
Posts: 254
Joined: Wed Jun 19, 2013 10:34 pm
Projects: Marshmallow Days
Contact:

Re: side character image on the right expressions?

#7 Post by chocoberrie »

can someone mark this topic as solved? i'm not sure how to...
Edit your original post at the top of the thread by clicking the "Edit" button. Then you can put "[SOLVED]" or something similar in the title. :)

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Ocelot, snotwurm