Drag n' Drop glitches when calling something animated

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Post Reply
Message
Author
User avatar
FamuFamu
Regular
Posts: 111
Joined: Thu Oct 11, 2012 4:52 pm
Contact:

Drag n' Drop glitches when calling something animated

#1 Post by FamuFamu »

I left another report concerning drag n' drop, but I encountered a different issue.

This one seems to come up when something is being dragged and a timer or something using ATL goes off, resulting in the drag (And in many cases the game itself) freezing. The following examples happened on a screen brought using the call command and a game with built distributions (I had a few instances of errors showing up only after building them, mostly regarding blank spaces after the filenames. "background.png " wouldn't show as an error until the distributions were built).

This was the code for the draggable:

Code: Select all

init python:
    
    
    def var_a_add(drags, drop):
        
        if not drop:
            
            drags[0].snap(952, 329, delay=0)
            return
            
        else:
            store.var_a += 1
                
            drags[0].snap(952, 329, delay=0)

            renpy.restart_interaction()

            return
It was simple, when added to the dragged function of the draggable, if dropped into a droppable it added +1 to $ var_a (Otherwise, it wouldn't add anything) returning to it's place afterwards.

I tried adding an effect to it when dropped into the droppable, first I used a simple screen

Code: Select all


screen effects:

    timer 0.2 action Hide("effects")

    add "flash"

"flash" was an already declared animation that went like:

Code: Select all


image flash:

    add "1.png"

    pause 0.1

    add "2.png"

    pause 0.1

I added it to the draggable code by using:

Code: Select all

init python:
    
    
    def var_a_add(drags, drop):
        
        if not drop:
            
            drags[0].snap(952, 329, delay=0)
            return
            
        else:
            store.var_a += 1
                
            drags[0].snap(952, 329, delay=0)

            renpy.restart_interaction()

            renpy.show_screen("effects")

            return
At first it works as intended, showing the effect with no problem. However, if the dragged is used afterwards again quickly, the draggable (And sometimes the whole game) freezes and has to be reloaded. I tried moving show_screen just before restart_interaction (Which was needed in the game one way or the other) but the problem remained.

Thinking it was because of the screen's timer, I changed a bit the code of the "flash" image so it went to alpha 0 after the animation ended and then I changed the draggable code to:

Code: Select all

init python:
    
    
    def var_a_add(drags, drop):
        
        if not drop:
            
            drags[0].snap(952, 329, delay=0)
            return
            
        else:
            store.var_a += 1
                
            drags[0].snap(952, 329, delay=0)

            renpy.restart_interaction()

            ui.add("flash")

            return
I repeated the process of putting ui.add before restart_interaction, but either way, the problem remained.

What's more, I had a keyboard key programmed to use the same animation in the effects screen for testing purposes, if the key was pressed when the object was being dragged, the animation would play and the drag would be frozen in place afterwards (As with the other cases, sometimes freezing the whole game with it).

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

Re: Drag n' Drop glitches when calling something animated

#2 Post by xela »

***Kind of a bump!

After applying the latest fix for Drag/Drop, the issue with draggroup messing up positioning is gone! However several issues reported such as the one above and:

- Drags sometimes snap from pos(0, 0) instead of coordinates where they were left off with a mouse if you repeatedly move the same drag fast enough.
- Same behavior if drag has a hovered function like Tooltip will freeze the entire screen in the same manner as described above. It should be noted that this:
the draggable (And sometimes the whole game) freezes and has to be reloaded
isn't exactly true, screen freezes, game seems to continue to work. If there is a leybind that can hide the screen/jump elsewhere or open preferences screen, game will work fine after that. Although that may not be a case at all times, just the freezes I was able to achieve.
- Tooltip will not fall back to default after drag is released/unhovered.

Otherwise, with the new fix, it's working a lot better and now that I figured out that the screen doesn't freeze without hovered, I can remove the "Please Do not play with Drag&Drop warning from my game" :)
Like what we're doing? Support us at:
Image

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Drag n' Drop glitches when calling something animated

#3 Post by PyTom »

Lets reset for a second, and wait for 6.18 PR1 to come out. Then you can tell me if you can repeat any of the problems there - it's hard to completely isolate fixes and backport them.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

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

Re: Drag n' Drop glitches when calling something animated

#4 Post by xela »

Roger, roger! :)
Like what we're doing? Support us at:
Image

User avatar
FamuFamu
Regular
Posts: 111
Joined: Thu Oct 11, 2012 4:52 pm
Contact:

Re: Drag n' Drop glitches when calling something animated

#5 Post by FamuFamu »

PyTom wrote:Lets reset for a second, and wait for 6.18 PR1 to come out. Then you can tell me if you can repeat any of the problems there - it's hard to completely isolate fixes and backport them.
Alright, I will surely report if the problem persists after that comes

Post Reply

Who is online

Users browsing this forum: No registered users