If you've ever noticed a visual bug where the black "quest curtain" jumps or glitches on the screen when you open a new quest window immediately after closing one, this tutorial is for you. This issue is caused by an animation conflict, and here’s how to fix it.
1. The Problem: Identifying the Glitch
The bug is easy to replicate:
1. Open any quest that uses the black curtain effect (e.g., from an NPC shop).
2. Close it.
3. Immediately (within a second) open another quest that also uses the curtain.
You will notice the black bars "jump" or stutter on the screen instead of smoothly animating in. This happens because the "close" animation (moving the bars off-screen) hasn't finished before the "open" animation (moving them on-screen) is triggered. The new animation starts from a mid-transition position, causing the visual glitch.
2. The Cause: Animation State Conflict
The root of the problem lies in uiQuest.py. The `QuestCurtain` class manages the curtain's animations. When a new quest is opened, the curtain is told to start its "fade in" animation. However, if the previous "fade out" animation is still running, the curtain's position is not reset, leading to a conflict.
3. The Solution: Resetting the Curtain's Position
To fix this, we need to ensure that the curtain's position is always reset to its default "off-screen" state before any new animation begins. This guarantees a smooth and consistent transition every time.
The fix involves adding a few lines to uiQuest.py to force-set the curtain's position upon initialization and closure.
File to Edit:
Code:
root/uiQuest.pyExplanation of the changes:
- In the `__init__` method: We add two lines to immediately place the top and bottom bars just outside the visible screen area. This ensures that every new instance of the curtain starts from a clean, "hidden" state.
- In the `Close` method: We add an extra line to do the same, guaranteeing that when a quest window is closed, the curtain is instantly moved off-screen, preventing any animation conflicts with the next quest.
I hope this helps!
"Huge thanks to @Dintisor for pointing me in the right direction. It saved me a lot of time because I couldn't figure out which file was the problem, even in debug mode. This allowed me to find the correct file and work on a fix. Thanks a lot!"
The bug::
![[FIX] Visual Glitch in Quest Curtain Animation - Mesaj 1 - Imagine 1 [FIX] Visual Glitch in Quest Curtain Animation - Mesaj 1 - Imagine 1](https://i.imgur.com/WwS5Sa2.jpeg)

la acest mesaj și conținutul se va afișa automat.