[SOLVED] Sprites changes place on its own
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.
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.
[SOLVED] Sprites changes place on its own
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.
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.
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.
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.
Re: Sprites changes place on its own
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.
- 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
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
*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
Re: Sprites changes place on its own
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.
- 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
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
without the bounce, but with a position specified. See what happens when you do that.
Do you do the bounce every time a sprite speaks?
For the moment try
Code: Select all
show atticus casual happy at right
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
*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
Re: Sprites changes place on its own
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.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
without the bounce, but with a position specified. See what happens when you do that.Code: Select all
show atticus casual happy at right
- 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
You can do both
try
Note: I rewrote your transform to look like this because I didn't see what the pass was doing there:
And one more note.
For your text interpolation you can use RenPy's interpolation like so:
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.
try
Code: Select all
show atticus casual happy at center, bounce
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
For your text interpolation you can use RenPy's interpolation like so:
Code: Select all
A "Thank you so, so much, [player_name]"
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
*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
Re: Sprites changes place on its own
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.trooper6 wrote: ↑Wed Aug 29, 2018 9:54 am You can do both
try
Note: I rewrote your transform to look like this because I didn't see what the pass was doing there:Code: Select all
show atticus casual happy at center, bounce
And one more note.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
For your text interpolation you can use RenPy's interpolation like so:
And last note:Code: Select all
A "Thank you so, so much, [player_name]"
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.
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot], Semrush [Bot]