[SOLVED] Sprites changes place on its own

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
chesarty
Regular
Posts: 116
Joined: Sat Aug 25, 2018 3:07 am
Completed: 0
Contact:

[SOLVED] Sprites changes place on its own

#1 Post by chesarty »

So, I'm at a scene where I need the sprite to disappear for one frame, since I have a cutscene there.

show atticus casual happy at bounce
A "Thank you so, so much, %(player_name)s!"
hide atticus casual happy
#scene building shelf
"You help Atticus to build the figurine shelf. It's definitely easier with two people - you manage to mount the shelf into the wall and Atticus places all of his figurines in."
show atticus casual happy at bounce
A "Yay yay yay! It looks so cute! Thank you!"


However, when I replace the sprite after the cutscene, it suddenly jumps to the top left of the screen.
wtf 1.png
wtf 2.png
wtf 3.png
Why is that & is there an easy way to fix it? I tried looking into sprite positioning but didn't understand what I was supposed to do and where to place the code lmao.
Last edited by chesarty on Wed Aug 29, 2018 11:08 am, edited 1 time in total.

User avatar
chesarty
Regular
Posts: 116
Joined: Sat Aug 25, 2018 3:07 am
Completed: 0
Contact:

Re: Sprites changes place on its own

#2 Post by chesarty »

Update; instead of using the hide command I never replaced the sprite, and instead just placed the background on top of the sprite. It still changes its place.

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Sprites changes place on its own

#3 Post by trooper6 »

What is bounce? May we see the code for that?
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
chesarty
Regular
Posts: 116
Joined: Sat Aug 25, 2018 3:07 am
Completed: 0
Contact:

Re: Sprites changes place on its own

#4 Post by chesarty »

trooper6 wrote: Wed Aug 29, 2018 8:10 am What is bounce? May we see the code for that?
Basically just a transformation where the sprite bounces a bit when it changes. Here's the code;

transform bounce:
pause .15
yoffset 0
easein .175 yoffset -10
easeout .175 yoffset 0
easein .175 yoffset -4
easeout .175 yoffset 0
yoffset 0
pass


It makes no difference, though. I already tried it with and without the bounce, it jumps into the top left corner either way.

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Sprites changes place on its own

#5 Post by trooper6 »

Note: you should put code inside of [ code][ /code] tags to preserve the spacing. (Take out the extra space).

Do you do the bounce every time a sprite speaks?

For the moment try

Code: Select all

show atticus casual happy at right
without the bounce, but with a position specified. See what happens when you do that.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
chesarty
Regular
Posts: 116
Joined: Sat Aug 25, 2018 3:07 am
Completed: 0
Contact:

Re: Sprites changes place on its own

#6 Post by chesarty »

trooper6 wrote: Wed Aug 29, 2018 8:19 am Note: you should put code inside of [ code][ /code] tags to preserve the spacing. (Take out the extra space).

Do you do the bounce every time a sprite speaks?

For the moment try

Code: Select all

show atticus casual happy at right
without the bounce, but with a position specified. See what happens when you do that.
I used "at center" at the end of the command and I managed to place it correctly. Still kind of sad I can't add the bounce with that, though. I don't use it every single time, usually just when Atticus gets happy since he's a very "bouncy" character.

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Sprites changes place on its own

#7 Post by trooper6 »

You can do both

try

Code: Select all

show atticus casual happy at center, bounce
Note: I rewrote your transform to look like this because I didn't see what the pass was doing there:

Code: Select all

transform bounce:
    pause .15
    yoffset 0
    easein .175 yoffset -10
    easeout .175 yoffset 0
    easein .175 yoffset -4
    easeout .175 yoffset 0
    yoffset 0
And one more note.

For your text interpolation you can use RenPy's interpolation like so:

Code: Select all

A "Thank you so, so much, [player_name]"
And last note:
You should not name Atticus "A", you should name him "a". It is Python convention to name variables with lowercase, reserving uppercase for class definitions.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
chesarty
Regular
Posts: 116
Joined: Sat Aug 25, 2018 3:07 am
Completed: 0
Contact:

Re: Sprites changes place on its own

#8 Post by chesarty »

trooper6 wrote: Wed Aug 29, 2018 9:54 am You can do both

try

Code: Select all

show atticus casual happy at center, bounce
Note: I rewrote your transform to look like this because I didn't see what the pass was doing there:

Code: Select all

transform bounce:
    pause .15
    yoffset 0
    easein .175 yoffset -10
    easeout .175 yoffset 0
    easein .175 yoffset -4
    easeout .175 yoffset 0
    yoffset 0
And one more note.

For your text interpolation you can use RenPy's interpolation like so:

Code: Select all

A "Thank you so, so much, [player_name]"
And last note:
You should not name Atticus "A", you should name him "a". It is Python convention to name variables with lowercase, reserving uppercase for class definitions.
Thanks! I added the "pass" at the end of my bounce since on another forum post I read that you ca make it stop by doing that lol. + I have multiple characters whose names start with A so I'm using capital A for Atticus and a for Alan. So far i hasn't given me any sort of issues and I'm 1000 lines into the code so I doubt I'll be changing it up anytime soom.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot], Semrush [Bot]