Main Character Side Image: How to Code This?

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
Obscura
Eileen-Class Veteran
Posts: 1430
Joined: Fri Mar 09, 2012 6:58 pm
Projects: Coming Out On Top
Location: United States
Contact:

Main Character Side Image: How to Code This?

#1 Post by Obscura » Sun Apr 01, 2012 10:39 pm

Looking at the threads at making side images has me somewhat confused.

I want side images for my main character (Mark). I've been able to do this by putting this in script.rpy:

Code: Select all

define m = Character("Mark", image="mark")
image side mark normal = "mark_side_normal.png"
image side mark happy = "mark_side_happy.png."
These side images will only show up when Mark speaks.
Note: There is no corresponding image on the main screen (to avoid redundancy.)

To accomodate room for the side image, I've changed this in options.rpy:

Code: Select all

style.window.left_padding = 20
to

Code: Select all

style.window.left_padding = 150
The problem is I don't want that padding when other characters are speaking or during normal narration. The other characters will not have a side image so the big empty space looks awkward.

How can I code my game so the padding returns to normal when other characters are speaking? Or in other words, how do I have specialized window padding that occurs only when the main character speaks?

Thanks. Any advice appreciated.
Coming Out On Top - An Adult Gay Dating Sim
website

User avatar
Obscura
Eileen-Class Veteran
Posts: 1430
Joined: Fri Mar 09, 2012 6:58 pm
Projects: Coming Out On Top
Location: United States
Contact:

Re: Main Character Side Image: How to Code This?

#2 Post by Obscura » Mon Apr 02, 2012 4:56 am

All righty...I think this is what I'm supposed to do:
http://www.renpy.org/wiki/renpy/doc/FAQ ... y_speak.3F

I have to put init: right above this, and then use "eside" or whatever I've labeled this action every time I want to use the side image.

As you can see, I don't know crap about programming!
Coming Out On Top - An Adult Gay Dating Sim
website

User avatar
Raindrops
Regular
Posts: 40
Joined: Fri Jan 27, 2012 4:18 pm
Projects: My Secret Spring (Co-writer & Proofreader), [Secret]
Contact:

Re: Main Character Side Image: How to Code This?

#3 Post by Raindrops » Mon Apr 02, 2012 1:36 pm

If you just want the padding to appear for the main character, in the part where you're defining the character put something like this:

Code: Select all

define m = Character("Mark", image="mark", window_left_padding=150)
Just adjust the number after the window_left_padding to your needs :)
TOPofBB
All my life, my heart has yearned for a thing I cannot name.
- Andre Breton

User avatar
Obscura
Eileen-Class Veteran
Posts: 1430
Joined: Fri Mar 09, 2012 6:58 pm
Projects: Coming Out On Top
Location: United States
Contact:

Re: Main Character Side Image: How to Code This?

#4 Post by Obscura » Mon Apr 02, 2012 5:46 pm

Raindrops wrote:If you just want the padding to appear for the main character, in the part where you're defining the character put something like this:

Code: Select all

define m = Character("Mark", image="mark", window_left_padding=150)
Just adjust the number after the window_left_padding to your needs :)
Oh my gosh Raindrops, thanks! I guess that was simpler than I assumed it owuld be. :roll:

Just so I get this straight, when I use the code above, what am I telling Renpy to do? Is it this?--->

1) That every time I use the letter 'm', that I want it to put up the text 'Mark' in the dialogue box
2) use any images associated with the word 'mark' in the dialogue box
3) and put the left padding on the window at 150

Is this right?

Do I define the images like this?

image side mark normal = "mark_side_normal.png"

and call them up like this?

m normal "I am so confused!!!" or like this?
m side normal "I am so confused!!!"

I am getting error messages either way. :cry:
Coming Out On Top - An Adult Gay Dating Sim
website

User avatar
sciencewarrior
Veteran
Posts: 356
Joined: Tue Aug 12, 2008 12:02 pm
Projects: Valentine Square (writer) Spiral Destiny (programmer)
Location: The treacherous Brazilian Rainforest
Contact:

Re: Main Character Side Image: How to Code This?

#5 Post by sciencewarrior » Mon Apr 02, 2012 6:00 pm

It should be the first one. What's the error message?
Keep your script in your Dropbox folder.
It allows you to share files with your team, keeps backups of previous versions, and is ridiculously easy to use.

User avatar
Obscura
Eileen-Class Veteran
Posts: 1430
Joined: Fri Mar 09, 2012 6:58 pm
Projects: Coming Out On Top
Location: United States
Contact:

Re: Main Character Side Image: How to Code This?

#6 Post by Obscura » Mon Apr 02, 2012 6:12 pm

OMG, I left a '.' after the '.png.'

I only realized this after pulling my hair out. Thanks for your help!

I'm going to go back and bang my head against my desk some more.
Coming Out On Top - An Adult Gay Dating Sim
website

Post Reply

Who is online

Users browsing this forum: Google [Bot]