delayed auto warping using gametimer script 4,5,9

I saw a comment on facebook asking how to set up delayed automatic warping for cut scenes and i created this. Idk if this is dumb in any way..
I have always thaught that setting up the autowarping with the help of monster or the players actionsteps is rather complicated.

Doing it this way all you need a new userVariable called "delay" and a little bit of code in the gametimer script.
(You go to ProjectSettings, user variable tab to add a new user variable)

Paste this code into your HandleGameTimer script
Found in ProjectSettings, Script Settings, scroll down to "Game"-folder section.
If you are not already using a gametimer script in your game, you save this script as a .asm file and set it up so that nesmaker uses it as your gametimer.

Code:
;;RustyRetroEntertainmentsystems
;;;;AutoWarp with delay on specified-screens
LDA gameState
CMP #3 ;;;automatic warping screen
    BEQ +yesScreen
        JMP +notDelayScreen
    +yesScreen:
 
    LDA delay
    CMP #100 ;;;<!!--here, how long to wait
    BEQ +delayDone
        INC delay
        JMP +notDelayScreen:
    +delayDone:
 
    WarpToScreen warpToMap, warpToScreen, #$01
    LDA #0
    STA delay

+notDelayScreen:

How to set up a screen to autowarp with a delay:
When you are setting up your autowarp screen in nesmaker, you got the different gamestates:
MainGame -0
StartScreen-1
WinScreen-2
GameState-3

You change the gamestate from "Main Game" to "GameState-3", (you can change the displayed name in project settings, project labels, look for Game States..)
In the code you are using in GameTimer script you can edit how long you want the delay to be before warping. I set it to #100 in my example script.

Thats it.
 
Top Bottom