Problem transitioning from screen 15,1 to 0,2

ezr0913

New member
I have a weird problem. When the screen transitions from 15,1 to 0,2 it goes back to the very first screen, 0,0. But when I die, it goes to the screen it's supposed to (0,2) , but then the next screen seems to repeat from the beginning. I have other screens that transition fine going from 15,0 to 0,1 and 15,2 to 0,3. The only screens I'm having trouble with are 15,1 to 0,2. I can't seem to figure out what is different about the screen that is making it go out of sync with the rest of the screens. What could be the problem? And if I start the player on the screen that it is glitching out on, everything seems to work as it should.

(when I die it switches the screen, see water appear, but then half a tower)
trouble.gif

(How the screen is set up)
bad transition.jpg

(The screen its supposed to go to, starting on water running fine)
supposed to be.gif


What could be causing this problem? Any help is much appreciated
 

dale_coop

Moderator
Staff member
How do you go from the 15,1 to the 2,0...? warp tiles?
In that case, maybe your warp script is not correct... (could you share it)?
 

ezr0913

New member
I'm not using any warp tiles. I am just relying on the engine to scroll from 15,1 to 0,2. It has no problem going from 15,0 to 0,1 and 15,2 to 0,3. That's why I'm so confused.

I was never able to get the warp tiles to work for me. It would always send me to 0,0 no matter what settings I chose, But what is even weirder is that I just tried to use a warp tile to make the transition from 15,1 to 0,2 and the warp tile works as it should and the game continues on as it should as well.

So worst case scenario I can use a warp tile to make the transition. But I just don't understand why it goes from 15,0 to 0,1 and 15,2 to 0,3 without any problems, but with 15,1 to 0,2 it has this weird glitch.

I also don't understand why the warp tiles never went to the coordinates I choose, but seem to be working now, but I'm not complaining about that :p
 

ezr0913

New member
So after doing more tests I found out that my warp tile is not working all the time. It only works on certain screens. and for the screens it doesn't work on it sends me to 0,0 again.


I also found out that every other screen at the end will send you back a whole 32 screens... For instance you already know 15,1 is sending me to 0,0... but also 15,3 will go to 0,2...15,5 will go to 0,4 and so on. So there's definitely a pattern happening. and all the screens at the end in between those glitched screens make the transition without any problem 15,0...15,2...15,4...15,6... and so on.

So every screen when 15=x if the Y= an odd number it will glitch out and go back 32 screens. If Y= an even number it will transition fine to the next screen as it's supposed to.

(hopefully this helps explain what is happening a little better)
screens not in sync.jpg



What could be causing these screens to back track? also what could be causing my warp tiles to work only on certain screens, but not others.

anyways here's my warp tile code
Code:
LDA #$00
STA newGameState

 LDA warpMap
 sta currentMap
 clc
 ADC #$01
 STA temp
 GoToScreen warpToScreen, temp, #$02
 LDA #$00
 STA playerToSpawn
 LDX player1_object
 DeactivateCurrentObject
 LDA #$01
 STA loadObjectFlag
 
LDA mapPosX
STA newX
LDA mapPosY
STA newY


Also here's my checkpoint code (to see if anything conflicts with the warp code)
Code:
    CPX player1_object
    BEQ +
    JMP dontDoCheckpoint
 +

    LDA Object_x_hi,x
    CLC
    ADC #$20
    STA continuePositionX
    LDA Object_y_hi,x
    STA continuePositionY
    LDA currentMap
    STA continueMap
    LDA Object_scroll,x
    STA continueScreen
    ;PlaySound #SND_VICTORY
    TriggerScreen continueScreen
    ;ChangeTileAtCollision #$00, #TILE_CHECKPOINT_CLEARED
    dontDoCheckpoint:




Thanks for always helping out dale! <3
 

dale_coop

Moderator
Staff member
Your warp script looks correct...
But it warps you to a incorrect place, like if the Warp out x,y coords were 0,0... or maybe... you could to other small tests like, for example, settings the Warp out x,y coords on EVERY screens of the scrolling section? To see if it helps
(at least, you could to the test with the first section / level)
 

ezr0913

New member
Good advice!

So I came to a conclusion about the warp tiles. It doesn't seem to matter what the warp out coordinates are on the screen that has the warp tiles on it. What does matter is the screen the player spawns at is set to. For instance... If I were to set the warp out coordinates to screen 0,4 on the screen I placed the player starting location, but set the coordinates to 0,5 on a different screen that the warp tiles are actually on. When I go through the warp tiles it would send me to 0,4 instead of 0,5.

This also happens with checkpoints. So the warp tile would send me to whatever the warp out location is on the screen that has the checkpoint, but that is ONLY if I die and spawn via the checkpoint location. If I were to just pass the checkpoint and not die and respawn with the checkpoint, the warp tile will go to the last "warp out location" the player has spawned at.

It's pretty hard to explain, but I hope I explained properly.

So in short... The warp tiles don't send me to the "warp out location" that is set to that screen that the warp tiles are located. It will send me to the "warp out location" on the screen I originally spawned at.
 

dale_coop

Moderator
Staff member
Yep, because on scrolling screens, most of the screen informations are read from the FIRST screen of the scrolling segment (for example, monster group, the color palettes... and so, the warp in and out x,y coords).
 

ezr0913

New member
Yeah I figured all that out when you told me to experiment with the warp tiles. All of a sudden everything clicked for me haha. I'm able to get the warp tiles working all the time now... but I'm still having a problem with the screen going back to 0,0 even after the warp. But it's not at the same spot. It's at the screen 0,4 now. The weird thing is that it will work when I place my player right next to the warp, but if I were to place my player at the start of the game or start of the level and run it through it will warp me back to 0,0 for some odd reason.

(This is what happens if I start at the beginning of the game or level)
SF.gif

(This is what happens when I place my starting point right before the warp)
s22.gif


And I have tried several different screens other than 0,4 to continue on with the game, but the same thing still happens no matter what screen I choose.
 

dale_coop

Moderator
Staff member
Hmmm... A small test you could try:
WarpToScreen.asm script that is in your "GameEngineData\Routines\Basic\ModuleScripts\HurtWinLoseDeath\" folder, and comment out the lines 13, 14, 15, like that:
2020-05-30-11-20-08-Z-NESmaker-4-1-5-raftronaut-20200322-Game-Engine-Data-Routines-Basic-Module-Script.png

(this script was not correct I think... those 3 lines were unnecessary and could cause issues)
 

ezr0913

New member
Nope.. Unfortunately it does the same thing. It keeps wanting to send me back to screen 0,0 :(

Is there a quick and easy way I can monitor the warp out coordinates via HUD so I can see if it changes at any point during the game?

Also you think the "handle scrolling" or "handle right bounds" scrips could be the issue? The reason from the start why I needed to use the warp tiles was to circumvent those screens that would send me back to screen 0,0 just from scrolling through it. Maybe the warp tiles are working as they should, but something in the scrolling script is reverting me back to 0,0 even after I make the warp.
 

ezr0913

New member
So I have no idea what I did different from this morning and tonight, but the game seems to be working now! This morning, after I changed the code it would work only sometimes. But I just ran through the game 5 out 5 times and not a single problem so far, so I'm pretty confident that everything is working properly...I hope lol :) I think changing that warp to screen script was the right thing to do. Thanks again Dale! You are a lifesaver! :D
 

vanderblade

Active member
I noticed this issue with the screens ezr pointed out using the scrolling shooter module as well. My work around was to stop scrolling at those end screens. That way, players can manually fly right and appear as intended at the start of the next row.

If this fix of Dale's works, however, that's great. I'll try it out as well.
 

vanderblade

Active member
FYI: As far as I can tell, the basic shooter module doesn't even use the WarpToScreen.asm by default. It does use WarpToNewScreen.

In any case, the changes I made to WarpToScreen didn't have any impact on the bug ezr pointed out. Back to my work around noted above.
 
Top Bottom