Character sprite images not changing

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
Zeekee
Regular
Posts: 67
Joined: Wed Jul 23, 2014 10:17 pm
Projects: No One But You, The Anomaly
Organization: Annexe Interactive
Skype: ytmnd111
Soundcloud: zomgaarh
Location: USAF Academy, CO
Contact:

Character sprite images not changing

#1 Post by Zeekee »

SO, I ran into this issue once I started implementing character sprites in-game: I set it up so that the characters talking sprite is showing when they are talking and with their mouth closed when they are not, but, for some reason, they dont transition after the second or third line of dialogue. Does anyone know what I could be doing wrong? Also, does anyone know how I can set the default 'right' and 'left' locations for sprites so my code doesn't look so ugly? Thanks :)

An excerpt from the script:

Code: Select all

    show ross_tk at right:
        xalign 0.7
    show lydia_sm at left:
        xalign 0.2
    r "I was just working on a little project of my own and lost track of time. Sorry man."
    show ross_sm at right:
        xalign 0.7
    show lydia_sm at left:
        xalign 0.2
    t "Ah, it doesn't matter. You guys good to go?"
    show ross_sm at right:
        xalign 0.7
    show lydia_tk at left:
        xalign 0.2
    l "You know it. I don't go anywhere without my baby."
    show ross_tk at right:
        xalign 0.7
    show lydia_sm at left:
        xalign 0.2
    r "Do you really have to ask? We've been planning this for a week."
"When people sometimes misquote me, I don't know if they understand what I'm saying."
-Tommy Wiseau

User avatar
Zetsubou
Miko-Class Veteran
Posts: 522
Joined: Wed Mar 05, 2014 1:00 am
Completed: See my signature
Github: koroshiya
itch: zetsuboushita
Contact:

Re: Character sprite images not changing

#2 Post by Zetsubou »

Code: Select all

transform right():
    xalign 0.7
transform left():
    xalign 0.2

label start:

    show ross_tk at right
    show lydia_sm at left
    r "I was just working on a little project of my own and lost track of time. Sorry man."

    show ross_sm at right
    t "Ah, it doesn't matter. You guys good to go?"

    show lydia_tk at left
    l "You know it. I don't go anywhere without my baby."

    show ross_tk at right
    show lydia_sm at left
    r "Do you really have to ask? We've been planning this for a week."
If you define your images differently, you can further simplify this.

Code: Select all

transform right():
    xalign 0.7
transform left():
    xalign 0.2

label start:

    show ross tk at right
    show lydia sm at left
    r "I was just working on a little project of my own and lost track of time. Sorry man."

    show ross sm
    t "Ah, it doesn't matter. You guys good to go?"

    show lydia tk
    l "You know it. I don't go anywhere without my baby."

    show ross tk
    show lydia sm
    r "Do you really have to ask? We've been planning this for a week."
For further explanation, you should read through the documentation a bit. Specifically: https://www.renpy.org/doc/html/displayi ... -statement
Finished games
-My games: Sickness, Wander No More, Max Massacre, Humanity Must Perish, Tomboys Need Love Too, Sable's Grimoire, My Heart Grows Fonder, Man And Elf, A Dragon's Treasure, An Adventurer's Gallantry
-Commissions: No One But You, Written In The Sky, Diamond Rose, To Libertad, Catch Canvas, Love Ribbon, Happy Campers, Wolf Tails

Working on:
Sable's Grimoire 2

https://zetsubou.games

User avatar
Zeekee
Regular
Posts: 67
Joined: Wed Jul 23, 2014 10:17 pm
Projects: No One But You, The Anomaly
Organization: Annexe Interactive
Skype: ytmnd111
Soundcloud: zomgaarh
Location: USAF Academy, CO
Contact:

Re: Character sprite images not changing

#3 Post by Zeekee »

Okay, so after implementing that fix you gave me (which worked, btw!) I ran into another issue. The character sprites are no longer grounded to the bottom edge of the screen. Using yalign grounds them to the top of the screen. I could always just use yalign (through some trial and error) but the sprites are different sizes. Would that matter at all?
"When people sometimes misquote me, I don't know if they understand what I'm saying."
-Tommy Wiseau

User avatar
Zetsubou
Miko-Class Veteran
Posts: 522
Joined: Wed Mar 05, 2014 1:00 am
Completed: See my signature
Github: koroshiya
itch: zetsuboushita
Contact:

Re: Character sprite images not changing

#4 Post by Zetsubou »

Code: Select all

I could always just use yalign (through some trial and error) but the sprites are different sizes. Would that matter at all?
Depends on the value you use.
I believe you want "yalign 1.0".
(The .0 is necessary)
Finished games
-My games: Sickness, Wander No More, Max Massacre, Humanity Must Perish, Tomboys Need Love Too, Sable's Grimoire, My Heart Grows Fonder, Man And Elf, A Dragon's Treasure, An Adventurer's Gallantry
-Commissions: No One But You, Written In The Sky, Diamond Rose, To Libertad, Catch Canvas, Love Ribbon, Happy Campers, Wolf Tails

Working on:
Sable's Grimoire 2

https://zetsubou.games

User avatar
Zeekee
Regular
Posts: 67
Joined: Wed Jul 23, 2014 10:17 pm
Projects: No One But You, The Anomaly
Organization: Annexe Interactive
Skype: ytmnd111
Soundcloud: zomgaarh
Location: USAF Academy, CO
Contact:

Re: Character sprite images not changing

#5 Post by Zeekee »

The yalign didn't work. I've been spending hours on this and I can't seem to figure out how to ground them properly...
"When people sometimes misquote me, I don't know if they understand what I'm saying."
-Tommy Wiseau

User avatar
curry nochi rice
Miko-Class Veteran
Posts: 746
Joined: Sat Mar 27, 2010 3:12 am
Projects: Delicatessen, Whom to Notice, Start of Something, Love Sorcery
Organization: Circle Cosine
IRC Nick: Curry
Skype: after.curry.rice
itch: project-rothera
Contact:

Re: Character sprite images not changing

#6 Post by curry nochi rice »

Zeekee wrote:The yalign didn't work. I've been spending hours on this and I can't seem to figure out how to ground them properly...
you might want to fix the transform itself, like yanchor 1.0
Personal (R-13) | Now at IndieDB | Circle Cosine's itch.io
I wanna be done.

User avatar
xavimat
Eileen-Class Veteran
Posts: 1461
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Discord: xavimat
Contact:

Re: Character sprite images not changing

#7 Post by xavimat »

As curry noche rice says, fis the transform, but you can do it with yalign 1.0:

Code: Select all

transform right:
    xalign 0.7 yalign 1.0
transform left():
    xalign 0.2 yalign 1.0
yanchor is not necessary because is included in yalign
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

Post Reply

Who is online

Users browsing this forum: Google [Bot]