Moving characters

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
darkrchaos
Regular
Posts: 28
Joined: Wed Jan 28, 2015 6:18 pm
Completed: A Few
Projects: Moe Wars: Crimson Samon
Deviantart: darkrchaos
Contact:

Moving characters

#1 Post by darkrchaos » Fri May 22, 2015 12:02 am

So I have these two characters moving at the same time, then the images are suppose to switch before moving off screen. It's suppose to be like the two girls are running into each other. But the code isn't using the "shocked" images, it's only using the "normal" ones. When the characters hit the middle the "normal" ones move down. the "shock" ones very show up. What going on?

Code: Select all

  
    show karanormal2 at center
    show lillynormal2 at center
    with move
    
    hide karanormal2 
    hide lillynormal2 
    
    show lillyshock2
    show karashock2
    
    hide lillyshock2
    hide karashock2
    with moveoutbottom

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: Moving characters

#2 Post by KomiTsuku » Fri May 22, 2015 12:14 am

Time for a lesson in image attributes! To make this easy, here's how it should look and I'll explain why.

Code: Select all

    show kara normal2 at center
    show lilly normal2 at center
    with move
   
    show lilly shock2
    show kara shock2
   
    hide lilly shock2
    hide kara shock2
    with moveoutbottom
Right now, renpy doesn't know that the normal and shock images are related to each other. By putting the space in there, you're telling it that it is a kara/lilly image. When you call another kar/lillya image, it realizes that it needs to change the current kara/lilly image on screen. There's no need to hide them since it is replacing the kara/lilly image.

User avatar
darkrchaos
Regular
Posts: 28
Joined: Wed Jan 28, 2015 6:18 pm
Completed: A Few
Projects: Moe Wars: Crimson Samon
Deviantart: darkrchaos
Contact:

Re: Moving characters

#3 Post by darkrchaos » Fri May 22, 2015 5:12 pm

Hmm That makes things easier, but the same thing is still happening it's still moving down the "Normal" one not the "Shock" one.

philat
Eileen-Class Veteran
Posts: 1653
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Moving characters

#4 Post by philat » Fri May 22, 2015 6:10 pm

It's because the transition is being applied to all the show/hide statements above it other than the initial show. You could break it up by adding a pause 0.1 after the show shock statements.

User avatar
darkrchaos
Regular
Posts: 28
Joined: Wed Jan 28, 2015 6:18 pm
Completed: A Few
Projects: Moe Wars: Crimson Samon
Deviantart: darkrchaos
Contact:

Re: Moving characters

#5 Post by darkrchaos » Fri May 22, 2015 6:27 pm

That worked thank you :D

Post Reply

Who is online

Users browsing this forum: No registered users