Made "CutScenes Introduction Screens" (for between Start Screen and Playable Screens)

User avatar
dale_coop
Posts: 1629
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Made "CutScenes Introduction Screens" (for between Start Screen and Playable Screens)

Post by dale_coop » Wed Aug 22, 2018 8:29 am

NEW SCRIPTS !!!
CUTSCENES FOR NESMAKER 4.0.6 --> http://nesmakers.com/viewtopic.php?p=4010#p4010



OLD TECNHIQUE (4.0.0) :
Last night, I managed to make some "Introduction Screens" (in a not very beautiful way), to be played between the Start Screen and the first playable screen.

Image

The technique I used is a variable "IntroScreens" initialized at "3" (because I have 3 intro screens) and used 3 normal screens that I designed like I wanted for my intro screens (assets, with some texts,... for exemple).
To link one screen to other, I used the "warp" functionality (as I can specify where my player will appear and I wanted to have him on the screen).

I made a script "WarpToNextScreen.asm" that check the "IntroScreens" variable, if not equal to "0", it decrease it and trigger a Warp! Else (if equal to "0", means no more Introduction screens to show, so the script to nothing). I assigned that script to the Press A button.

I modified all the the input/movement/loadScreens scripts to disable/skip some parts when the "IntroScreens" variable is not equal to "0".


(I will need to check with the v 4.0.2 that coming :p)
Last edited by dale_coop on Fri Aug 24, 2018 12:53 pm, edited 4 times in total.
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
User avatar
dale_coop
Posts: 1629
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Made "Introductions screens" (for CutScenes between Start Screen and Playable Screens)

Post by dale_coop » Wed Aug 22, 2018 9:03 am

Design:

First of all, in the overworld, I make my 1st intro screen with my player, some text (I made assets, for now, but could definitly use textbox when I will figure out how use it). This screen will be shown when the game Start (when PressStart / or skip start screen).
It is my FIRST intro screen.
In the "Screen info", I defined what screen to "Warp to", that will be my 2nd intro screen.

Then, I design my 2nd intro screen with some text, ...
In the "Screen info", I defined what screen to "Warp to", that will be my 3nd intro screen.

Then, I design my 3nd intro screen with some text, ...
It's my last intro screen, beause I want only 3 intro screens (but if you want more you can continue...)
But even, in the "Screen info", I defined what screen to "Warp to" the screen that will be my playable game.

My playable screen is full of tiles, monsters, pickups… (and I will put a "checkpoint" type tile, at the exact place where my player will warp in: when he loose a life, he will start from here).

Oh, and, if you have gravity (plateformer) like me, don't forget to put a solid tile under your player in each screen (else, he will fall when warped in) :p


Scripts:

In the "SystemVariable.asm" script, I declare a "IntroScreens" variable:

Code: Select all

  IntroScreens .dsb 1  ;;for intro cut screens
In the "InitLoads.asm" script, I initialize the variable (number of intro screens I want):

Code: Select all

	LDA #$03
	STA IntroScreens
In the "HandleScreenoads.asm" script, at line 320 (just before the "LDA HudHandler" line), I add some code to skip/hide the HUD when IntroScreens:

Code: Select all

    LDA IntroScreens
    BNE skipDrawingHud_GameHandler

I make a "IntroScreens_WarpToNextScreen.asm" script (in the "\InputScripts" folder):

Code: Select all

warpToNextScreen:
  LDA IntroScreens                     ;; check the n° of IntroScreens
  BNE continueWarpingToNextScreen      ;; if not equal to "0" means still intro screens to show 
  JMP doNothingForWarpingToNextScreen  ;; elsewe do nothing
  
continueWarpingToNextScreen:
  DEC IntroScreens  ;; decrease the n° of IntroScreens

  ;; warp to the next screen:
  LDA warpMap       ;; warp to next screen
  ADC #$07
  STA temp
  GoToScreen warpToScreen, temp
  
doNothingForWarpingToNextScreen:
  RTS
Now, in "Input Editor", I assign this script to the "PRESS" "A" button (or button you want to go one screen to the next one)

And, I modify the "changeToWalkingAnimation.asm" script to skip when IntroScreens:

Code: Select all

    LDA IntroScreens  ;; check the n° of IntroScreens, if not "0" then we skip all the animations code
    BNE finishedChangingToWalkAnimation

    LDX player1_object
    ChangeObjectState #$01, #$10

finishedChangingToWalkAnimation:
    RTS

And same for all the "startMovingPlayerXxx.asm" to skip when IntroScreens.
Here, for exemple the "startMovingPlayerRight.asm":

Code: Select all

    LDA IntroScreens  ;; check the n° of IntroScreens, if not "0" then we skip all the movement code
    BNE finishedMovingPlayerRight

    StartMoving player1_object, MOVE_RIGHT
    LDX player1_object
    LDA Object_movement,x
    AND #%11111000
    ORA #%00000010
    STA Object_movement,x
	
finishedMovingPlayerRight:
    RTS

Voilà. I hope to have forgotten nothing

(I will need to check with the v 4.0.2 that coming :p)
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
Bucket Mouse
Posts: 193
Joined: Wed Mar 07, 2018 2:25 am

Re: Made "CutScenes Introduction Screens" (for between Start Screen and Playable Screens)

Post by Bucket Mouse » Wed Aug 22, 2018 9:25 am

It's beautiful, man *sniff*
User avatar
dale_coop
Posts: 1629
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Made "CutScenes Introduction Screens" (for between Start Screen and Playable Screens)

Post by dale_coop » Thu Aug 23, 2018 4:00 pm

The only problem is, once these scripts are modified, it means you will need to set up 3 introduction screens for each game you make !

Need to find a way to have user variables that are defined/initialized by the project (like the ones used in the HUD) and not in the common scripts.
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
User avatar
WolfMerrik
Posts: 199
Joined: Sat Aug 11, 2018 4:59 pm
Location: Maine
Contact:

Re: Made "CutScenes Introduction Screens" (for between Start Screen and Playable Screens)

Post by WolfMerrik » Thu Aug 23, 2018 5:22 pm

This is an awesome way to do this, and it seems like it works pretty darn well. With some clever coding and graphics work, you could probably add some pretty cool stuff to make them like a full blown cutscene, great work!
dale_coop wrote:
Thu Aug 23, 2018 4:00 pm
...a way to have user variables that are defined/initialized by the project (like the ones used in the HUD) and not in the common scripts.
This would be a GREAT feature suggestion.

With this, In regards to the reply about adding 6 point collision detection, middle points for the player could be added here as well, rather than hardcoding them into the scripts, they could be read from here.
ImageWant to download & share Image NESMaker Resources? Check out My Files on www.NESMakerFiles.com Image
User avatar
dale_coop
Posts: 1629
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Made "CutScenes Introduction Screens" (for between Start Screen and Playable Screens)

Post by dale_coop » Thu Aug 23, 2018 6:20 pm

WolfMerrik wrote:
Thu Aug 23, 2018 5:22 pm
This would be a GREAT feature suggestion.

With this, In regards to the reply about adding 6 point collision detection, middle points for the player could be added here as well, rather than hardcoding them into the scripts, they could be read from here.
Exactly!
We will see in the 4.0.6... what Joe added.
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
User avatar
WolfMerrik
Posts: 199
Joined: Sat Aug 11, 2018 4:59 pm
Location: Maine
Contact:

Re: Made "CutScenes Introduction Screens" (for between Start Screen and Playable Screens)

Post by WolfMerrik » Fri Aug 24, 2018 1:59 am

It will definitely open up a LOT of possibilities!

Also, Thanks for sharing this post, this was something (albeit way down the road for me) I was wondering how to do.
ImageWant to download & share Image NESMaker Resources? Check out My Files on www.NESMakerFiles.com Image
User avatar
dale_coop
Posts: 1629
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Made "CutScenes Introduction Screens" (for between Start Screen and Playable Screens)

Post by dale_coop » Fri Aug 24, 2018 6:18 am

Ok I watched the tutorial video for the new version of NESMaker, started playing with it too...
I have some ideas to improve my scripts. I will test that today and update my tutorial ;)
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
User avatar
WolfMerrik
Posts: 199
Joined: Sat Aug 11, 2018 4:59 pm
Location: Maine
Contact:

Re: Made "CutScenes Introduction Screens" (for between Start Screen and Playable Screens)

Post by WolfMerrik » Fri Aug 24, 2018 11:27 am

dale_coop wrote:
Fri Aug 24, 2018 6:18 am
Ok I watched the tutorial video for the new version of NESMaker, started playing with it too...
I have some ideas to improve my scripts. I will test that today and update my tutorial ;)
I look forward to it! You have been making and sharing some awesome stuff!
ImageWant to download & share Image NESMaker Resources? Check out My Files on www.NESMakerFiles.com Image
User avatar
dale_coop
Posts: 1629
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Made "CutScenes Introduction Screens" (for between Start Screen and Playable Screens)

Post by dale_coop » Fri Aug 24, 2018 12:52 pm

With the release of NESaker 4.0.6, I decided to modify my script to make it more versatile.
So here my new version.

It's is meant to be use with the AdventureModule.MOD in NESMaker 4.0.6


Image


Technique:

For that, I use normal screens for the cutscenes / introduction screens, design them as I want (assets, with some texts,... for exemple). And FLAG them as "cutscene" (I hijack the currently not used "Screen Flag 4" that I will rename as "Cutscene screen").
To link one screen to other, I used the "warp" functionality.

I made a script "Cutscenes_WarpToNextScreen.asm" that check if the current screen is a "Cutscene screen", if so, it triggers a Warp! Else the script does nothing. I assigned that script to the Press A button.

I modified all the the input/movement/loadScreens scripts to disable/skip some parts when on a "Cutscene screen".


Design:

In the "Project Settings > Project Labels" , I rename the "Screen Flag 4" to "Cutscene screen".

Image

First of all, in the overworld, I make my 1st Cutscene screen with my player, some text (I made assets, for now, but could definitly use textbox when I will figure out how use it). This screen will be shown when the game Start (when PressStart / or skip start screen).
It is my FIRST Cutscene screen.
In the "Screen info", I set the screen as "Cutscene screen" and defined what screen to "Warp to", that will be my 2nd Cutscene screen.

Image

Then, I design my 2nd Cutscene screen with some text, ...
In the "Screen info", I set the screen as "Cutscene screen" and defined what screen to "Warp to", that will be my 3nd Cutscene screen.

Then, I design my 3nd Cutscene screen with some text, ...
It's my last Cutscene screen, beause I want only 3 Cutscene screens (but if you want more you can continue...)
But even, in the "Screen info", again, I set the screen as "Cutscene screen" and defined what screen to "Warp to" the screen that will be my playable game.

My playable screen is full of tiles, monsters, pickups… (and I will put a "checkpoint" type tile, at the exact place where my player will warp in: when he loose a life, he will start from here).

Oh, and, if you have gravity (plateformer) like me, don't forget to put a solid tile under your player in each screen (else, he will fall when warped in) :p


Scripts:

In the "HandleScreenoads.asm" script, at line 320 (just before the "LDA HudHandler" line), I add some code to skip/hide the HUD when on a Cutscene screen:

Code: Select all

    ;; dale_coop: check for the cutscenes screens 
    LDA ScreenByte01
	AND #%00010000  ;; check if a cutscene screen flag
    BNE skipDrawingHudForCutScene
	JMP continueDrawingHudForCutScene
skipDrawingHudForCutScene:
    ;; Uncomment, if you want Hide the player during cutscene (cf. CutScenes_WarpToNextScreen.asm too) 
    ;;ChangeObjectState #$05, #$02  ;; change to action step 5 
    ;; skip the HUD drawing (= no HUD)
    JMP skipDrawingHud_GameHandler
continueDrawingHudForCutScene:
    ;; dale_coop: continue as usual

I make a "Cutscenes_WarpToNextScreen.asm" script (in the "\Routines\UserScripts\AdventureGame_Base\InputScripts\InputScripts" folder):

Code: Select all

warpToNextScreen:
  ;; dale_coop: check for the cutscenes screens 
  LDA ScreenByte01
  AND #%00010000  ;; check if a cutscene screen flag
  BNE continueWarpingToNextScreen      ;; if cutscene we warp 
  JMP doNothingForWarpingToNextScreen  ;; else we do nothing
  
continueWarpingToNextScreen:
  ;; warp to the next screen:
  LDA warpMap
  clc
  adc #$01

  STA temp
  GoToScreen warpToScreen, temp

doNothingForWarpingToNextScreen:
  ;; Uncomment, if you want Hide the player during cutscene (cf. handleScreenLoads.asm too)
  ;; check the current state
  ;;GetCurrentActionType player1_object
  ;;CMP #$05                      ;; if action step 5 (cutscene)
  ;;ChangeObjectState #$00, #$02  ;; change to action step 0 (idle)
  RTS
Now, in "Input Editor", I assign THAT script to the "PRESS" "A" button (or button you want to go one screen to the next one)


And, I modify all the "startMovingPlayerXxx.asm" to skip when on a Cutscene screen.
Here, for exemple the "startMovingPlayerRight.asm":

Code: Select all

    ;; dale_coop: check for the cutscenes screens 
    LDA ScreenByte01
	AND #%00010000  ;; check if a cutscene screen flag
    BNE finishedMovingPlayerRight

    LDX player1_object
    GetCurrentActionType player1_object
    CMP #$02 ;; attack
    BEQ ++
    CMP #$01
    BEQ +
     ChangeObjectState #$01, #$04
 +
    StartMoving player1_object, MOVE_RIGHT
 ++
     FaceDirection player1_object, FACE_RIGHT
    RTS

finishedMovingPlayerRight:
   RTS

Also something similar in the "a_create_projectile.asm" script:

Code: Select all

    ;; dale_coop: check for the cutscenes screens 
    LDA ScreenByte01
	AND #%00010000  ;; check if a cutscene screen flag
    BNE skipCreatingProjectile
	JMP canContinueCreatingProjectile
skipCreatingProjectile:
    JMP doneShooting
canContinueCreatingProjectile:

 LDA gameHandler
    AND #%00100000
    BEQ notNPCstate_proj
 JMP doneShooting
 notNPCstate_proj
 LDA weaponsUnlocked
 AND #%00000010
 BNE canShoot
 JMP doneShooting
canShoot:
LDX player1_object
 GetCurrentActionType player1_object


 CMP #$02
 BNE notAlreadyShooting
 JMP doneShooting 
notAlreadyShooting
 ;;; don't attack if already attacking.
 ;;; do we have to check for hurt here?
 ;;;;; Here, we WOULD create melee
 ChangeObjectState #$02, #$02
 LDA Object_movement,x
 AND #%00001111
 STA Object_movement,x
 LDA #$00
 STA Object_h_speed_hi,x
 STA Object_h_speed_lo,x
 STA Object_v_speed_hi,x
 STA Object_v_speed_lo,x
 
 LDA Object_x_hi,x
 ;;; offset x for creation
 CLC
 ADC #$04
 STA temp
 LDA Object_y_hi,x
 CLC
 ADC #$04
 STA temp1
 
 LDA Object_movement,x
 AND #%00000111
 STA temp2

 
    CreateObject temp, temp1, #$03, #$00
  
    ;;;; x is now the newly created object's x.
    LDA Object_movement,x
    ORA temp2
    STA Object_movement,x
    LDY temp2
    LDA directionTable,y
    ORA Object_movement,x
    STA Object_movement,x
      PlaySound #sfx_shoot
doneShooting:

RTS


;;000 down
;010 right
;100 up
;110 left

And in the "b_create_melee.asm" script:

Code: Select all

    ;; dale_coop: check for the cutscenes screens 
    LDA ScreenByte01
	AND #%00010000  ;; check if a cutscene screen flag
    BNE skipCreatingMelee
	JMP canContinueCreatingMelee
skipCreatingMelee:
    JMP doneAttacking
canContinueCreatingMelee:

 LDA gameHandler
 AND #%00100000
 BEQ notNPCstate_attack
 JMP doneAttacking
notNPCstate_attack
 LDA weaponsUnlocked
 AND #%00000001
 BNE canAttack
 JMP doneAttacking
canAttack:
LDX player1_object
 GetCurrentActionType player1_object

 CMP #$02
 BNE notAlreadyAttacking 
 JMP doneAttacking
notAlreadyAttacking
 ;;; don't attack if already attacking.
 ;;; do we have to check for hurt here?
 ;;;;; Here, we WOULD create melee
 ChangeObjectState #$02, #$02
 LDA Object_movement,x
 AND #%00001111
 STA Object_movement,x
 LDA #$00
 STA Object_h_speed_hi,x
 STA Object_h_speed_lo,x
 STA Object_v_speed_hi,x
 STA Object_v_speed_lo,x
 
 LDA Object_x_hi,x
 STA temp
 LDA Object_y_hi,x
 STA temp1
 
 LDA Object_movement,x
 AND #%00000111
 STA temp2
 AND #%00000010 ;; this will be 0 on up and down, but 1 on left right
 BNE createLRmelee
    LDA temp2
    TAY
    LDA temp
    SEC
    SBC #$08 ;; width of weapon
    CLC
    ADC weaponOffsetTableX,y
    STA temp
    LDA temp1
    SEC
    SBC #$10
    CLC
    ADC weaponOffsetTableY,y
    STA temp1
 
  CreateObject temp, temp1, #$01, #$00
  JMP meleeCreated
createLRmelee:
    LDA temp2
    TAY
    LDA temp
    SEC
    SBC #$10 ;; width of weapon
    CLC
    ADC projOffsetTableX,y
    STA temp
    LDA temp1
    SEC
    SBC #$08
    CLC
    ADC projOffsetTableY,y
    STA temp1
 CreateObject temp, temp1, #$02, #$00
meleeCreated:
    ;;;; x is now the newly created object's x.
    LDA Object_movement,x
    ORA temp2
    STA Object_movement,x
    PlaySound #sfx_slash
doneAttacking:

RTS


;;000 down
;010 right
;100 up
;110 left

Voilà. I hope to have forgotten nothing
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
Post Reply