How do I fix my side sprite? [re-opened new problem]

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.
Message
Author
User avatar
Cidz
Veteran
Posts: 458
Joined: Wed Jul 27, 2011 1:50 pm
Completed: The Forgetful Kiwi [NanoReno 2012], Papercut [NanoReno 2013]
Projects: Words Within Our Hearts, Papercut [NanoReno 2013]
Organization: Starlight Melodies
Tumblr: starlightmelodies
Deviantart: cidthekitty
Location: California, USA
Contact:

How do I fix my side sprite? [re-opened new problem]

#1 Post by Cidz »

edit: I have a new problem with the side sprite, and instead of starting a new thread. I'll just reopen this one if that is ok.
(this was previously titled "How do I do a side sprite?" I changed the title, and edited out the original message for this one.)

My side sprite appears twice whenever I use a background image. It doesn't show up twice when I use no BG image.
Here is my code:

Code: Select all

# You can place the script of your game in this file.

# Declare images below this line, using the image statement.
# eg. image eileen happy = "eileen_happy.png"

# Declare characters used by this game.

image bg club = "110-default.jpg"


# The game starts here.
label start:
   
    init:
        $ offScreen = Position(xpos=1, xanchor='left', ypos=0)
    show jinko 01 at offScreen
    #define your character; adding image="sora" means that any time I call the variable 'sora', as in show sora 01, it will also set the side image for that variable.
    define so = Character('Jinko', color="#BBBBBB", image="jinko")
    image jinko 01= "MC-winter-neutral.png"
    image jinko 02= "MC-winter-angry.png"
    image jinko 03= "MC-winter-sad.png"
    image side jinko 01= "MC-winter-neutral.png"
    image side jinko 02= "MC-winter-angry.png"
    image side jinko 03= "MC-winter-sad.png"
   

    scene bg club
    show jinko 01
    so "This would have my 01 pose on screen and side-by."
    show jinko 02
    so "Now I would have 02 pose on both instead."

    return
Here's a screencap to show what I mean:
Attachments
sideprob.jpg
Last edited by Cidz on Wed Dec 12, 2012 6:42 pm, edited 4 times in total.

User avatar
Aedin
Regular
Posts: 137
Joined: Fri Sep 07, 2012 11:53 pm
Contact:

Re: How do I do a side sprite?

#2 Post by Aedin »

When you'redefining your characters, just put the window_left_padding and show_side_image in.

Code: Select all

$ eside = Character('Eileen',
                color="#c8ffc8",
                window_left_padding=160,
                show_side_image=Image("eileen_side.png", xalign=0.0, yalign=1.0))
"There’s no shame in pleasure, Mr. Gray. You see, man just wants to be happy, but society wants him to be good. And when he’s good, man is rarely happy, and when he’s happy he is always good."

User avatar
Cidz
Veteran
Posts: 458
Joined: Wed Jul 27, 2011 1:50 pm
Completed: The Forgetful Kiwi [NanoReno 2012], Papercut [NanoReno 2013]
Projects: Words Within Our Hearts, Papercut [NanoReno 2013]
Organization: Starlight Melodies
Tumblr: starlightmelodies
Deviantart: cidthekitty
Location: California, USA
Contact:

Re: How do I do a side sprite?

#3 Post by Cidz »

How do I show different emotions for the side sprite?

User avatar
KomiTsuku
Eileen-Class Veteran
Posts: 1023
Joined: Mon Sep 22, 2008 11:32 pm
Completed: Dreams of the Skies, Anton's Vacation, Luka, The Halberd and The Tiger, Rising Angels, Pyrite Heart, Rising Angels: Reborn, The Halberd and The Fox, VN Tycoon, RA: Hope
Projects: Rising Angels
Organization: IDHAS Studios
IRC Nick: Komi
itch: idhas
Location: Somewhere
Contact:

Re: How do I do a side sprite?

#4 Post by KomiTsuku »

I was one of the slow adapters to the new age of side-images, but this is the easiest way to do it.

Code: Select all

#define your character; adding image="sora" means that any time I call the variable 'sora', as in show sora 01, it will also set the side image for that variable. 
define so = Character('Sora', color="#BBBBBB", image="sora")
image sora 01= "Sprites/Sora/Sora1.png"
image sora 02= "Sprites/Sora/Sora2.png"
image sora 03= "Sprites/Sora/Sora3.png"
image side sora 01= "Sprites/Sora/Side/Sora1H.png"
image side sora 02= "Sprites/Sora/Side/Sora2H.png"
image side sora 03= "Sprites/Sora/Side/Sora3H.png"
So an example of this would be

Code: Select all

show sora 01
so "This would have my 01 pose on screen and side-by."
show sora 02
so "Now I would have 02 pose on both instead.

User avatar
Alex
Lemma-Class Veteran
Posts: 3098
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: How do I do a side sprite?

#5 Post by Alex »


User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: How do I do a side sprite?

#6 Post by PyTom »

KomiTsuku's method is the current best practice.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
Cidz
Veteran
Posts: 458
Joined: Wed Jul 27, 2011 1:50 pm
Completed: The Forgetful Kiwi [NanoReno 2012], Papercut [NanoReno 2013]
Projects: Words Within Our Hearts, Papercut [NanoReno 2013]
Organization: Starlight Melodies
Tumblr: starlightmelodies
Deviantart: cidthekitty
Location: California, USA
Contact:

Re: How do I do a side sprite?

#7 Post by Cidz »

KomiTsuki's method is indeed the easiest, and it works...sort of.
However, the MC is behind the textbox and in the middle like the picture below.

And, I'm not sure how to fix it.
I tried looking at conditional switch, but it just looked really confusing to me. I'm not really too familiar with renpy, so I'm still kind of a newb.
Attachments
jinkoside.jpg

User avatar
KomiTsuku
Eileen-Class Veteran
Posts: 1023
Joined: Mon Sep 22, 2008 11:32 pm
Completed: Dreams of the Skies, Anton's Vacation, Luka, The Halberd and The Tiger, Rising Angels, Pyrite Heart, Rising Angels: Reborn, The Halberd and The Fox, VN Tycoon, RA: Hope
Projects: Rising Angels
Organization: IDHAS Studios
IRC Nick: Komi
itch: idhas
Location: Somewhere
Contact:

Re: How do I do a side sprite?

#8 Post by KomiTsuku »

Could you post the code you used to define the images and character? I think you defined the main image with the side one.

User avatar
Cidz
Veteran
Posts: 458
Joined: Wed Jul 27, 2011 1:50 pm
Completed: The Forgetful Kiwi [NanoReno 2012], Papercut [NanoReno 2013]
Projects: Words Within Our Hearts, Papercut [NanoReno 2013]
Organization: Starlight Melodies
Tumblr: starlightmelodies
Deviantart: cidthekitty
Location: California, USA
Contact:

Re: How do I do a side sprite?

#9 Post by Cidz »

Oh, sure.

Code: Select all

# You can place the script of your game in this file.

# Declare images below this line, using the image statement.
# eg. image eileen happy = "eileen_happy.png"

# Declare characters used by this game.
#define j = Character('Jinko', color="#c8ffc8")


# The game starts here.
label start:
    
    
    #define your character; adding image="sora" means that any time I call the variable 'sora', as in show sora 01, it will also set the side image for that variable.
    define so = Character('Jinko', color="#BBBBBB", image="Jinko")
    image Jinko 01= "MC-winter-neutral.png"
    image Jinko 02= "MC-winter-angry.png"
    image Jinko 03= "MC-winter-sad.png"
    image Jinko sora 01= "MC-winter-smile.png"
    image Jinko sora 02= "MC-winter-annoyed.png"
    image Jinko sora 03= "MC-winter-suprise.png"
    
    show Jinko 01
    so "This would have my 01 pose on screen and side-by."
    show Jinko 02
    so "Now I would have 02 pose on both instead."

    return

User avatar
KomiTsuku
Eileen-Class Veteran
Posts: 1023
Joined: Mon Sep 22, 2008 11:32 pm
Completed: Dreams of the Skies, Anton's Vacation, Luka, The Halberd and The Tiger, Rising Angels, Pyrite Heart, Rising Angels: Reborn, The Halberd and The Fox, VN Tycoon, RA: Hope
Projects: Rising Angels
Organization: IDHAS Studios
IRC Nick: Komi
itch: idhas
Location: Somewhere
Contact:

Re: How do I do a side sprite?

#10 Post by KomiTsuku »

I see the problem.
image Jinko 01= "MC-winter-neutral.png"
image Jinko 02= "MC-winter-angry.png"
image Jinko 03= "MC-winter-sad.png"
image Jinko sora 01= "MC-winter-smile.png"
image Jinko sora 02= "MC-winter-annoyed.png"
image Jinko sora 03= "MC-winter-suprise.png"
should be

define so = Character('Jinko', color="#BBBBBB", image="jinko")
image jinko 01= "MC-winter-neutral.png"
image jinko 02= "MC-winter-angry.png"
image jinko 03= "MC-winter-sad.png"
image side jinko 01= "the side-by version of neutral"
image side jinko 02= "the side-by version of angry"
image side jinko 03= "the side-by version of sad"
Edit: I discovered today that caps in variables don't matter in ren'py. Goes against everything I learned in programming class.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: How do I do a side sprite?

#11 Post by PyTom »

Edit: I discovered today that caps in variables don't matter in ren'py. Goes against everything I learned in programming class.
Yes they do.

Before using the SideImage, you need to fix the positioning, either in screens.rpy or in the side images themselves.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
KomiTsuku
Eileen-Class Veteran
Posts: 1023
Joined: Mon Sep 22, 2008 11:32 pm
Completed: Dreams of the Skies, Anton's Vacation, Luka, The Halberd and The Tiger, Rising Angels, Pyrite Heart, Rising Angels: Reborn, The Halberd and The Fox, VN Tycoon, RA: Hope
Projects: Rising Angels
Organization: IDHAS Studios
IRC Nick: Komi
itch: idhas
Location: Somewhere
Contact:

Re: How do I do a side sprite?

#12 Post by KomiTsuku »

PyTom wrote:
Edit: I discovered today that caps in variables don't matter in ren'py. Goes against everything I learned in programming class.
Yes they do.

Before using the SideImage, you need to fix the positioning, either in screens.rpy or in the side images themselves.
That's what I thought... Then how did I... I think I might have broken the time-space continuum again.

User avatar
Cidz
Veteran
Posts: 458
Joined: Wed Jul 27, 2011 1:50 pm
Completed: The Forgetful Kiwi [NanoReno 2012], Papercut [NanoReno 2013]
Projects: Words Within Our Hearts, Papercut [NanoReno 2013]
Organization: Starlight Melodies
Tumblr: starlightmelodies
Deviantart: cidthekitty
Location: California, USA
Contact:

Re: How do I do a side sprite?

#13 Post by Cidz »

Hmm... so I got the side image to show, but the problem is I can't really get it to show w/o the other one in the middle showing.
Or, if I can get the side image to show, it doesn't change expressions.

http://i.imgur.com/QqN33.jpg
http://i.imgur.com/d53hl.jpg

here is the code

Code: Select all

# The game starts here.
label start:
    
    
    #define your character; adding image="sora" means that any time I call the variable 'sora', as in show sora 01, it will also set the side image for that variable.
    define so = Character('Jinko', color="#BBBBBB", image="jinko")
#    image jinko 01= "MC-winter-neutral.png"
#    image jinko 02= "MC-winter-angry.png"
#    image jinko 03= "MC-winter-sad.png"
    image side jinko 01= "MC-winter-neutral.png"
    image side jinko 02= "MC-winter-angry.png"
    image side jinko 03= "MC-winter-sad.png"
    
    show jinko 01
    so "This would have my 01 pose on screen and side-by."
    show jinko 02
    so "Now I would have 02 pose on both instead."

    return
that one is when it shows up but the screen is black, i get an undefined jinko 01 undefined jinko 02 image.
if i uncomment the image jinko 01,02,etc...then it shows both.
if i comment image jinko but not image side jinko, it shows it like it did at first with it behind the textbox and in the middle (same if i comment side jinko but uncomment image jinko)

Also, how do I postition the side image in the screen file?
(seriously, how did I do this before? if only I had a good memory, or kept it on a notepad file, or something >_< )

User avatar
KomiTsuku
Eileen-Class Veteran
Posts: 1023
Joined: Mon Sep 22, 2008 11:32 pm
Completed: Dreams of the Skies, Anton's Vacation, Luka, The Halberd and The Tiger, Rising Angels, Pyrite Heart, Rising Angels: Reborn, The Halberd and The Fox, VN Tycoon, RA: Hope
Projects: Rising Angels
Organization: IDHAS Studios
IRC Nick: Komi
itch: idhas
Location: Somewhere
Contact:

Re: How do I do a side sprite?

#14 Post by KomiTsuku »

The side image is tied to the shown image. So if you do

Code: Select all

show jinko 01
then the game is going to pull image side jinko 01. You would change the image by simply showing another center image, such as

Code: Select all

show jinko 02
The side-by will change with it. If you just want the side-by to show by itself, I set a location off screen for the primary image. I normally do this when I am not showing the main character, but still want him to have a side-by. Example...

Code: Select all

init:
    $ offScreen = Position(xpos=1, xanchor='left', ypos=0)
...
show jinko 01 at offScreen
The reason it gives you an undefined jinko 01 is because by commenting out that line, you removed the jinko 01 image from the game. You are trying to show something that doesn't exist.

As for positioning the side-by itself, I don't remember off-hand. I do remember that you can change the text position in the options.rpy file. Should be...

Code: Select all

    # style.window.left_padding = 6
    # style.window.right_padding = 6
    # style.window.top_padding = 6
    # style.window.bottom_padding = 6
Just uncomment the left padding and increase it.

User avatar
Cidz
Veteran
Posts: 458
Joined: Wed Jul 27, 2011 1:50 pm
Completed: The Forgetful Kiwi [NanoReno 2012], Papercut [NanoReno 2013]
Projects: Words Within Our Hearts, Papercut [NanoReno 2013]
Organization: Starlight Melodies
Tumblr: starlightmelodies
Deviantart: cidthekitty
Location: California, USA
Contact:

Re: How do I do a side sprite?

#15 Post by Cidz »

Oh yay! It works! Now I have the side image w/o the image in the middle.
Thank you sooooo much! I'm going to be sure and back up my files from now on, incase I accidently loose them again. >_<

Post Reply

Who is online

Users browsing this forum: Semrush [Bot]