Can someone help me with 'Side Images' please!!!

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
piratequeen
Newbie
Posts: 20
Joined: Mon Oct 14, 2013 2:06 am
Projects: Absolute Brightness: The Afterglow of Love
Tumblr: divinetacos
Deviantart: divinechihaya
Contact:

Can someone help me with 'Side Images' please!!!

#1 Post by piratequeen » Fri Oct 18, 2013 12:51 am

So I've been really, really stumped.

I can get the side image to appear.
But I would like to change the picture at certain times.

For example:

She's happy, so its a side image of her smiling.
But then I would like to change it so she's crying.

But I have no clue at all of how to do that.
I've tried many things. And searched a lot. Can't find nothing!

The code im using right now (just for her being happy):

Code: Select all

define n = Character('[player_name]', color="#c8ffc8", window_left_padding=227, image="naomi")
image side naomi = "side naomi normal.png"
So to sum it up, can someone PLEASE help me.
I want to change the side image, but not delete that one.

So she can be happy at one point, then crying the next. as a side image.
Please please please help!!! hours i've been stumped :( :( :oops:

User avatar
feathersnake
Regular
Posts: 104
Joined: Fri Apr 13, 2012 8:05 pm
Completed: A Rose by Any Other Name
Projects: Color, You've Got Mail!
Organization: Olfix Productions
Tumblr: olfix
Deviantart: olfix
Contact:

Re: Can someone help me with 'Side Images' please!!!

#2 Post by feathersnake » Fri Oct 18, 2013 1:42 am

Forgive me if I get this wrong, but hopefully I can help. Using the code you've provided already for the example:

Code: Select all

define n = Character('[player_name]', color="#c8ffc8", window_left_padding=227, image="naomi")
image side naomi = "side naomi normal.png"
Define the rest of the images you plan to use for her as well if you haven't already. i.e. images like this with whatever names you have for them:

Code: Select all

image side naomi cry = "side naomi cry.png"
image side naomi nervous = "side naomi nervous.png"
Then when you're down in the game script, just put the correct emotion from the side images you've named, (cry, nervous, or whatever word(s) you've used after "image side naomi"), in the correct place after your defined name (in this case "n"):

Code: Select all

n "I'm feeling happy."
n cry "Now I'm crying..."
n "I'm okay again."
Good luck! Let me know if it's still not working for you. :)
Olfix Productions:
Tumblr | itch.io
Complete Projects:
A Rose by Any Other Name
In-progress:
Color | You've Got Mail!

User avatar
piratequeen
Newbie
Posts: 20
Joined: Mon Oct 14, 2013 2:06 am
Projects: Absolute Brightness: The Afterglow of Love
Tumblr: divinetacos
Deviantart: divinechihaya
Contact:

Re: Can someone help me with 'Side Images' please!!!

#3 Post by piratequeen » Fri Oct 18, 2013 2:27 am

Thanks >:D

Got it! Works.

User avatar
Donmai
Eileen-Class Veteran
Posts: 1892
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question
Projects: Slumberland
Location: Brazil
Contact:

Re: Can someone help me with 'Side Images' please!!!

#4 Post by Donmai » Fri Oct 18, 2013 9:15 am

Another way is to use condition switch in your character declaration and use a variable to change the side images.
Create a variable in your init block:

Code: Select all

init:
    $ mood = 0
We will decide that, for example, 0=neutral, 1=happy and 2=sad.
Define your images:

Code: Select all

image naomi neutral = "naomi neutral.png"
image naomi happy = "naomi happy.png"
image naomi sad = "naomi sad.png"
then we will declare the character as follows:

Code: Select all

$ n = Character('Naomi', color='#aa4933', show_side_image=ConditionSwitch('mood==0', 'naomi neutral', 'mood==1', 'naomi happy', 'mood==2', 'naomi sad', xalign=0, yalign=1.0), window_left_padding=120) #adjust the left padding for your character size
now we can use it this way:

Code: Select all

$ mood = 1
n "I'm feeling happy."
$ mood = 2
n "Now I'm crying..."
$ mood = 0
n "I'm okay again."
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

User avatar
Rosstin2
Veteran
Posts: 253
Joined: Thu Jan 09, 2014 12:42 pm
Completed: King's Ascent, Kitty Love
Projects: Queen At Arms, Rex Rocket
Organization: Aqualuft Games
Contact:

Re: Can someone help me with 'Side Images' please!!!

#5 Post by Rosstin2 » Sat Jan 11, 2014 5:15 pm

Tagged b/c I'm struggling with this too.
Image

User avatar
JitterySlob
Newbie
Posts: 8
Joined: Wed Apr 13, 2016 4:37 pm
Contact:

Re: Can someone help me with 'Side Images' please!!!

#6 Post by JitterySlob » Thu Sep 01, 2016 6:53 am

Hi,I've been trying to follow this post for my own game but I keep running into a problem

ethier my character won't change expressions,or it will tell me, AttributeError: NoneType object has no attribute 'set_transition'. Which I think has to do with the init somehow?

Code: Select all

# Declare images below this line, using the image statement.
image side NTest_frown = "NTest_frown.png"
image side  NTest_smile = "NTest_smile.png"

# Declare characters used by this game.
define n = Character('Nia', color="#c8ffc8", window_left_padding=160, image="NTest_frown")
$ n = Character('Nia', color='#aa4933', show_side_image=ConditionSwitch('mood==0', 'NTest_smile', 'mood==1', 'NTest_frown', xalign=0, yalign=1.0), window_left_padding=160)

# The game starts here.
label start:
init:
   $ mood = 1  
   n "sad"
   $ mood = 0
   n "smile"
return
I tried modifying it for my game,but I guess I missed something,could someone tell me what I need to fix please?

Post Reply

Who is online

Users browsing this forum: No registered users