Sprite Position Bug -- Are other creators seeing this?

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
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Sprite Position Bug -- Are other creators seeing this?

#16 Post by xela »

floor_left_crouching == ??? Sack of potatoes? Pie? A cat?

with moveinbottom


is a Transition, you are not even supposed to get the issue we're discussing here when using it. My guess is that you screwed up when defining whatever "floor_left_crouching" was supposed to be (it's still a guess).
Like what we're doing? Support us at:
Image

User avatar
Rosstin
Veteran
Posts: 368
Joined: Mon Jan 31, 2011 5:43 pm
Completed: Rex Rocket, Kitty Love, King's Ascent
Projects: Road Redemption, Queen At Arms
Organization: Aqualuft Games
Contact:

Re: Sprite Position Bug -- Are other creators seeing this?

#17 Post by Rosstin »

Code: Select all

    $ floor_left_crouching = Position(xpos=left_x, ypos=floor_height_crouching, xanchor='center')    

Code: Select all

    $left_x = 300

Code: Select all

    $ floor_height_crouching = 1900 #height of floor in pixels below top of screen, for a crouching character
Image

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Sprite Position Bug -- Are other creators seeing this?

#18 Post by nyaatrap »

at Position(pos) with Transition is an old way before ATL is introduced. If you want to animate sprits, I'd suggest to do like the following,

Code: Select all

show sprite:
    align (.5, 1.0) #the final position
    xoffset -100 # the starting position
    linear 1.0 xoffset 0 # from left to right move animation
say "text"
show sprite:
    xoffset 0 # reset animation for the case when ATL is terminated.
say "next text"

User avatar
Rosstin
Veteran
Posts: 368
Joined: Mon Jan 31, 2011 5:43 pm
Completed: Rex Rocket, Kitty Love, King's Ascent
Projects: Road Redemption, Queen At Arms
Organization: Aqualuft Games
Contact:

Re: Sprite Position Bug -- Are other creators seeing this?

#19 Post by Rosstin »

So basically you're telling me that... in our script, thousands of instances of 1 line of code should be replaced with 6 lines of code?

Our script is 20,000 lines long and we have thousands of these statements.
Image

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Sprite Position Bug -- Are other creators seeing this?

#20 Post by nyaatrap »

You can define them in ATL (or in pure python) http://www.renpy.org/doc/html/atl.html

User avatar
Rosstin
Veteran
Posts: 368
Joined: Mon Jan 31, 2011 5:43 pm
Completed: Rex Rocket, Kitty Love, King's Ascent
Projects: Road Redemption, Queen At Arms
Organization: Aqualuft Games
Contact:

Re: Sprite Position Bug -- Are other creators seeing this?

#21 Post by Rosstin »

So you're saying that this form....

Code: Select all

show someCharacter at somePosition with someTransition
is no longer supported by Renpy?

And now I should use....

Code: Select all

show someCharacter:
    onScreenPosition
    offScreenPosition
    slowEase
for example?
Image

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Sprite Position Bug -- Are other creators seeing this?

#22 Post by nyaatrap »

It may work, but obsoleted. You may hard to get help on functions few developers are using. I have no idea how to fix the matter in that form.

You can also write them in at clause after dfine them as variables in ATL

Code: Select all

show sprite:
    defined_position
    defined_animation
show sprite at defined_position, defined_animation
Last edited by nyaatrap on Mon Dec 28, 2015 12:42 am, edited 1 time in total.

User avatar
Rosstin
Veteran
Posts: 368
Joined: Mon Jan 31, 2011 5:43 pm
Completed: Rex Rocket, Kitty Love, King's Ascent
Projects: Road Redemption, Queen At Arms
Organization: Aqualuft Games
Contact:

Re: Sprite Position Bug -- Are other creators seeing this?

#23 Post by Rosstin »

So are...

Positions
&
Transitions

also deprecated?

All I want is to write a single-line statement that says....
"someCharacter moves from thisPosition to thatPosition with someTransition"
I'd really like not to have to change all those statements into massive multiline statements.
Image

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

Re: Sprite Position Bug -- Are other creators seeing this?

#24 Post by philat »

I actually can't even replicate this problem.

Code: Select all

image red = Solid("F00", xysize=(600, 400))

label start:
    $ left_x = 300
    $ floor_height_crouching = 100 #height of floor in pixels below top of screen, for a crouching character
    $ floor_left_crouching = Position(xpos=left_x, ypos=floor_height_crouching, xanchor='center')    
    "blah"
    show red at floor_left_crouching with moveinbottom
    "blah blah"
In a clean project does not result in any issues -- if you click through the transition, the image jumps to the end state (xpos 300, ypos 100).

User avatar
Rosstin
Veteran
Posts: 368
Joined: Mon Jan 31, 2011 5:43 pm
Completed: Rex Rocket, Kitty Love, King's Ascent
Projects: Road Redemption, Queen At Arms
Organization: Aqualuft Games
Contact:

Re: Sprite Position Bug -- Are other creators seeing this?

#25 Post by Rosstin »

I zipped up a project that demonstrates the problem for PyTom, I will post it for you guys as well.

https://drive.google.com/open?id=0B-KLE ... GpGd2tfMGM

Just, you know, don't delete it from my Google Drive or anything because I want Tom to see it.

To replicate the bug, just view the short game once, then try to skip through it the second time with CTRL. You should see something weird. Then you can also try using the mousewheel scroll backwards to also trigger it.

The relevant code is all in script.rpy.

I apologize for the file size (100mb), it would take me over an hour to carefully extract all the code referencing the game images.
Image

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Sprite Position Bug -- Are other creators seeing this?

#26 Post by xela »

Rosstin wrote:it would take me over an hour to carefully extract all the code referencing the game images.
Hour is too long (you should need that much to point out the issue) but it's fair, 100MB is not much these days...
Rosstin wrote:I zipped up a project that demonstrates the problem for PyTom
I honestly do not believe that it should become PyTom's problem, you are using outdated tools which are no longer supported.
Rosstin wrote:To replicate the bug, just view the short game once, then try to skip through it the second time with CTRL. You should see something weird. Then you can also try using the mousewheel scroll backwards to also trigger it.
Actually, you can just click lmb right after the game starts and you see the "issue".
Rosstin wrote:The relevant code is all in script.rpy.
My strategy would be to try and preserve written code by redefining all Position classes as Transforms, that is at least worth trying before rewriting the whole script.
Like what we're doing? Support us at:
Image

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Sprite Position Bug -- Are other creators seeing this?

#27 Post by xela »

xela wrote:My strategy would be to try and preserve written code by redefining all Position classes as Transforms, that is at least worth trying before rewriting the whole script.
Yeah, seems to be working well! Try this:

Use mass-renaming option (your code editor should have one) to replace (if fx file) all:

Position

with

Transform

and all:

xanchor='center'

with

anchor=(0.5, 1.0)

It should work great then and you will have to change another line anywhere in the code (replacing took me 4 secs once I knew what to replace).

===>>
Could you add:

Code: Select all

image mmvertpan:
    "gui/newUI/mmvertpan.png"
    subpixel True
    xanchor 0.0
    yanchor 0.0
    xalign 0.0
    yalign 1.0
    ease 20.0 yalign 0.0
It's none of my business and unrelated to the the issue at hand but it'll help lessen (or remove completely) small (but really annoying) skips when the background is "panning".

==========>>>
I hope this will fix the issue for good, seems to have done the trick for me at least (and try to avoid using outdated code in the future)...
Like what we're doing? Support us at:
Image

User avatar
Rosstin
Veteran
Posts: 368
Joined: Mon Jan 31, 2011 5:43 pm
Completed: Rex Rocket, Kitty Love, King's Ascent
Projects: Road Redemption, Queen At Arms
Organization: Aqualuft Games
Contact:

Re: Sprite Position Bug -- Are other creators seeing this?

#28 Post by Rosstin »

Thank you so much! I'll try this out.

Alright, let's do this. Crossing my fingers.
Image

User avatar
Rosstin
Veteran
Posts: 368
Joined: Mon Jan 31, 2011 5:43 pm
Completed: Rex Rocket, Kitty Love, King's Ascent
Projects: Road Redemption, Queen At Arms
Organization: Aqualuft Games
Contact:

Re: Sprite Position Bug -- Are other creators seeing this?

#29 Post by Rosstin »

OMG I THINK THAT DID IT

YOU SAVED MY LIFE T_T

It looks like this has f---ed up a handful of things in the screen animation but probably things we can fix on an ad-hoc basis.
Image

User avatar
Rosstin
Veteran
Posts: 368
Joined: Mon Jan 31, 2011 5:43 pm
Completed: Rex Rocket, Kitty Love, King's Ascent
Projects: Road Redemption, Queen At Arms
Organization: Aqualuft Games
Contact:

Re: Sprite Position Bug -- Are other creators seeing this?

#30 Post by Rosstin »

OK, so these new positions work great with our Full Sprites (all the main characters)

Our custom positions no longer work with our Half Sprites (the NPC characters)

That's a way smaller problem than we had before. I just have to review all these scenes in which we manipulate the Half Sprites and redo them. Most of our scenes feature the Full Sprites so this isn't THAT much work.
Image

Post Reply

Who is online

Users browsing this forum: Google [Bot]