[4.5.X] Easy WarpToScreen Delay Timer For Cutscenes (Using Screen Flag)

Jonny

Well-known member
This is a simple tutorial for users who are starting to get into creating cutscenes and looking for a way to do delayed screen changes in a universal way which does not involve monster action steps or tile types. I'm sure people are already using screen flags for this use but I haven't read any mention of it, only using monster action steps with a timer. The reason I went for this method was because, even after a fix, I was still having problems with monsters on screens with text boxes. Ok, thats enough waffling on...

Setting up the screen flag (skip this is you already know how)

Goto Project Settings > Project Labels
Pick a Screen Flag (which is not in use) and change the name to 'Warp Timer' or whatever you would like to call it.
This is just a label to keep things organised in NM. You'll have heard this mentioned in the tutorial videos.

screenflags.gif

HandleGameTimer.asm code


As mentioned before, it's good practice to make a copy of any base module scripts you're going to change.
For example NEWHandleGameTimer.asm or something which relates to your project.
This new script then needs assigning in script setings like this... (again, skip if you already know this)
Click on the Script Define for - Game > Handle Game Timer
Then find your duplicate script on the right and double click it and the path should change on the left to point to your new one.

project settings.gif

Change / Add this to your Handle Game Timer code...

Code:
;;; SCREEN FLAG CHECK FOR WARP TIMER ;;;;;;;;;;;;;;;;;;;;;;;

    LDA ScreenFlags00  
    AND #%00000100     ;; FLAG BEING USED FOR WARP TIMEER ;;
    BNE warpAfterTimer
    JMP endAll         ;; THE FLAG IS NOT SET SO GOTO END ;;
warpAfterTimer:

;;; GAME TIMER ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    LDA gameTimerTicks
    CLC
    ADC #$01              ;; TIMER SPEED / TICKS ADDED    ;;
    STA gameTimerTicks    ;; COUNTS TO 255 THEN WARPS     ;;
    BCC endAll
   
    WarpToScreen warpToMap, warpToScreen, #$01
   
endAll:

(if you already have code in your HandleGameTimer.asm for example palette cycling, the code above would be added to the end)

Thats it!

Now all you would need to do is tick the flag for 'Warp Timer' in Screen Info > Screen Flags when you're building your cutscenes. I haven't tested this on scrolling game screens but I presume it would work. Another use would be for a delayed "PRESS START" input script, whereby the screen flag would be flipped when the start button is pressed.
 

jakenastysnake

New member
I'm kinda confused on how to get this working. I got everything to build and run, but it appears my first screen is never warping to the second screen. My HandleGameTimer.asm script is identical to this, and on my Screen Info tab I have the Warp Timer screen flag checked. I wonder if I am supposed to give specific values in the "GAME TIMER" part of the code below?

Code:
LDA gameTimerTicks
CLC
ADC #$01              ;; TIMER SPEED / TICKS ADDED    ;;
STA gameTimerTicks    ;; COUNTS TO 255 THEN WARPS     ;;
BCC endAll

WarpToScreen warpToMap, warpToScreen, #$01

Edit: Sorry, probably should have mentioned that I'm using the MetroVania module. Could that be the issue?
 
Last edited:

IMBrendan

Member
I'm kinda confused on how to get this working. I got everything to build and run, but it appears my first screen is never warping to the second screen. My HandleGameTimer.asm script is identical to this, and on my Screen Info tab I have the Warp Timer screen flag checked. I wonder if I am supposed to give specific values in the "GAME TIMER" part of the code below?

Code:
LDA gameTimerTicks
CLC
ADC #$01              ;; TIMER SPEED / TICKS ADDED    ;;
STA gameTimerTicks    ;; COUNTS TO 255 THEN WARPS     ;;
BCC endAll

WarpToScreen warpToMap, warpToScreen, #$01

Edit: Sorry, probably should have mentioned that I'm using the MetroVania module. Could that be the issue?
Hey Jake,
If you plugged in the script into timers correctly - the only thing you need to do is activate screen type 5.

I do however have questions about HOW one might implement this into a game - the idea of cutscenes is something I haven't been able to wrap my head around but have been dreaming about for sure.
 

jakenastysnake

New member
I have been able to use the invisible monster object way of automatically changing screens before, but this way looked much easier and didn't require creating more objects. But I can't even get the monster objects to work in the MetroidVania module so maybe it's something related to screen scrolling? I'm just guessing at this point..
 
Top Bottom