Screen Fade Bug

ok, thx, there is a bit of a visual bug for me, in sector 1, if you hit the trigger for sector 3, it fades out, and then it fades back showing sector one for just a few moments before switching to sector 3, but it doesn’t happen the other way around, after going to sector 3 for the first time, I went back to sector 1 then back to sector 3 a few times, and the same thing happened.

is it possible to make it fade after the scene change occurs?

Did you look at the new change scene code? Try and change it and see what happens.

I added it, but the screen fades back before the scene change, or at least, it might’ve glitched out

I also made an edit so that the only person who can activate the trigger is Qiste, as without it the only enemy added(Alphadels) and the laser pistol shots can also activate it.

Just keep persevering until you discover what is going on. I’m not available to help I’m afraid.

I fixed the part with other entities touching it, now I am working on the spawn position that you go to when a scene trigger is happening, which I also just did, but it is still fading out too fast, I might put the fade out in the same section as the position set.

I increased the fade-in time to 2.0 and the fade-out time to 2.5 and it the transition happens right before the fade-in fully happens, maybe like 2-3 frames before the screen is fully black, making the fade out clean

Perhaps changing scenes just begins an opacity lerp of some element covering the camera, then when the lerp reaches 1 change scenes and reverse the lerp timer, when 0 is reached disable it or somethin

The issue was that you need to wait until the change scene has completed before completing the transition ie fading out. I update the fork.

    this.app.scenes.changeScene(this.scene, async function(err, entity) {
        if (!err) {
            // success
            await window.sceneTransition.complete();
        } else {
            // error
        }
    }); 

ok, thx, but, when I was double checking where that will go, Which I believe to be change scenes script, you deleted everything under change scene.

so just a conformation, it is the script “change scene” right?

Just replace the call to this.app.scenes.chaneScene and the subsequent call to sceneTransition.complete() with the code snippet above.

um, I did that, added it, saved it, then it deleted everything, then deleted all of the transition script, and it is not undoing

and it is not letting me paste the transition back, what happened?

and when I downloaded the transition script, then deleted the old transition script, and put in the downloaded one in it’s place, it reset both, without the new check screen change part.

after resetting the transition script, it allowed me to paste the scene change script adjustment. that was strange

Okay, so I’m adding a tilemap script to the project now. It is going to read a set of 402x402 (The main tileset is 400x400, but some of the floor tiles touch the edges of the set, so I am adding an extra row and column of tiles on each side to add walls, so I don’t have to add more checks to the edges of the rooms) and find a set of 26x24 tiles around the camera. To reduce lag, I have the tiles separated into 14 groups that run on a 15-frame loop. Group 1 moves on frame 1, group 2 on frame 2, so on and so forth. Frame 15 doesn’t have a group, so none of them adjust on frame 15.

The problem is that the black cover might fade away before the tiles reach the player’s position, then the player would see it loading, since it takes 15 frames to make all the tiles move 24 tiles vertically, in order to go from their default position, to making a full row of 26 tiles at row 414 to 416 (if the camera is at the position of 402 tiles high, the tiles would need to go up to around 414 tp 416 tiles high, which would take around 269 to 273 frames to reach it, so I think a good wait time is 280 frames would be good, even I’m planning on making it run at 40 FPS right now, which would be taking 7 seconds to run, so it’s a bit long). The reason that I only calculated with y is because the x tile length is 26, 2 tiles bigger than the y tile length, and the full tilemap is 402x402, making it so that the tiles would reach its final x position before the final y position.

Any way to make sure that the fade out is delayed until all the tiles reach their final location?