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.
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.
Change / Add this to your Handle Game Timer code...
(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.
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.
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.
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.