auto scroll module, Action-Anim-End WARP TO

Raftronaut

Member
I was having some trouble with the animated-end "Warp to" script bundled with 4.1.5, it was causing all sorts of input errors when the warp function engaged the cutscenes I had been working out. I posted my problem on the Facebook forums. Dale Coop assisted with the following script modfication, I simply replaced the script I had in my routines>basic>system>TimerEndScripts>Timer_WarpToNewScreen:

Code:
;;warp to new screen
LDA warpMap
STA currentMap
CLC
ADC #$01
STA temp
GoToScreen warpToScreen, temp, #$02
LDA navFlag
ORA #%00000010
STA navFlag

LDX player1_object
; ChangeObjectState #$00, #$10

DeactivateCurrentObject
LDA #$01
STA loadObjectFlag

This script caused the music to reset between screen loads even if the song was the same. Dale then advised me to comment out the following lines:

Code:
LDA navFlag
ORA #%00000010
STA navFlag

This fix worked like a charm. now I have a new problem, as the warp is only allowing me to warp into screens vertical to my starting point. If I try to warp to a screen on the right or left the screen freezes.

Since this is a vertically scrolling shooter, i wold prefer my cutscenes to flow horizontally so I can preserve as much space for level design.

Any solutions for this?
 

dale_coop

Moderator
Staff member
Hmm...
1st check: Is your game still freezing if you don't set the "hide hud" flag on your cutscenes? (just to find where the freeze's coming from)
2nd check: Is your game still freezing if you set a different song to each cutscenes screen? (again, just to find where the freeze's coming from)
 

Raftronaut

Member
OK

I confirmed that both Hide HUD and Same Song was selected when freezes occur. I changed the song for the problem screen and the freeze still occurred.

I unchecked Hide hud from the problem screen and the warp-to transition worked. I went back and set the song back to the same and re tested. It works fine. So the problem only seems to occur when warping East/West when the HIDE HUD box is checked.

Any solutions? I would post the script here, but am not sure what I would be looking for. Unless it is a correction needed to the previously mentioned WarpToNewScreen script.
 

Raftronaut

Member
I've tested it thoroughly and can only find the error warping east/west when using the HIDE HUD screen flag.
This is certainly where the freeze is occurring.
 

dale_coop

Moderator
Staff member
OK, I see.
Make your that, on your cutscene screens... you have a tile at the exact spot where your sprite zero should be (It could be just a sprite 0 detection issue). maybe your bottom right corner of the HUD area (just make sure you put a tile not black, there).
Else, if it doesn't fix your issue, could you share screenshots of your cutscene screens?
 

Raftronaut

Member
Dale, I am not sure how to post video files, I captured an .Avi from from Fceux, but I am not sure how to share on the forums. I am not sure if a screen shot alone would help
 

dale_coop

Moderator
Staff member
if you have a google account you could post it on youtube (no public) and share the link here... or just share the videos via a sharing service like send.firefox.com or wetransfer.com any other online service like that.

It might be an issue with your HUD area, maybe your sprite 0, ... so any screenshots about how your screens look like would help me/us to visualize.
 

dale_coop

Moderator
Staff member
Yeah, ok... your screen is definitly not correct.
Try putting a tile (not black) at the bottom right corner of your hud area (ON your cutscene screens). It might help to fix the issue.

Like this:
2019-06-16-23-44-11-NES-MAKER-4-1-5-Version-0x159-Cat-Game-TESTWArps-MST.png


If it work, you could use a cool tile... small spikes or small skulls, ...
OR use a tile that use a dark color but the color #0 (the black in RGB mode)
 

Raftronaut

Member
Hmmm. I was not aware of this, I am not entirely certain what sprite zero does exactly. I can try to replace the black tile with something else and see what happens!
 

Raftronaut

Member
Well Dale,
This is all it took to correct this problem. I made a tiny tile about 2x4 pixels I could wedge into the corner and this corrected my warping east/west screen freeze. I removed that tile again to confirm and the freeze came back sure enough.

I can work with it from here.

Could you perhaps give me some idea of WHY the game freezes without that tile covered by something other than black? Like I said previously, I am uncertain of sprite zero's function. I set up Sprite zero per Joe's instructions in the Scrolling shooter tutorial and have not thought about it since.

Could this also be to blame with my hud palette being unstable? I seem to get all sorts of color shifts in my hud text when scrolling.
 

dale_coop

Moderator
Staff member
Note sure if I can explained it well...
But basically, the Basic core (code engine) uses the sprite 0 to draw the HUD part. The Spite Zero is a tile (a graphic gameobject tile) designated as sprite 0 and placed on the junction of HUD area and the gameplay area. The screen will split the screen at sprite 0 ((I think the mapper30) but to be able to do that, the code always check if the sprite 0 makes a collision with a non-transparent color (by transparent or "black", I mean the color#0, the first color of each palette).
If the sprite0 NEVER touches a color different thant the #0, the code enters in a endless waiting portion of the code. The game freezes (and graphical glitch).
This whole sprite zero code has been writter for the scrolling engine.

Even if you don't want display the HUD or you don't use scrolling, some of the sprite zero code still is executed... so, you have to to set it corectly (one of the first things to set when setting your project) ;)

Oh, Joe made a video to explain the Sprite Zero (how it works and how/why we need to set it):

https://www.youtube.com/watch?v=o7m4gxhgX0U
 

Raftronaut

Member
Ok cool, I did watch the video a few months back, but your explanation is actually really helpful. Some of the tutorial stuff I fly through simply following the instructions without understanding the significance of the actions I am taking.
 

dale_coop

Moderator
Staff member
Personally, I think the Sprite Zero is the most difficult thing to understand (and set/use) in NESmaker 4.1.X
 
Top Bottom