TolerantX
Active member
Hey there NESmaker users!
I wrote a script, and with some "help from my friends" it was able to "come together"
(*apologies for The Beatles puns)
Below I have two input scripts, both relatively simple and written to explain things clearly (*I hope*)
FIRST: You need to know a few things: This script uses variables such as myLives, (Optional) my Score, and (Optional: see below) myContinues
SECOND: YOU NEED A GAME OVER SCREEN http://nesmakers.com/viewtopic.php?f=36&t=2137&p=26172#p26174
(make one from here or your own way)
PLEASE! MAKE SURE THEY ARE DEFINED! PRETTY PLEASE!
I have commented out the parts of the script pertaining to SCORE and CONTINUES to enable them you can uncomment them or download them already edited (your choice)
You want to assign this script below in inputs to your GAME OVER SCREEN STATE or lacking that, your WIN screen state
The script below is an input for the Start Screen (or any screen you want to add credits with a button press) This is only needed IF you want LIMITED CONTINUES.
I use press SELECT button on START SCREEN (*I commented out the SFX but you can add them back in*)
those were the two simple scripts, below is the uncommented version of CONTINUE WITH SCORE RESET AND LIMITED CONTINUES...
LIMITED CONTINUES AND SCORE RESET:
Thank you to Drexegar and ChronosV2 for all your help making this work gentlemen.
I hope this helps some of you out
I wrote a script, and with some "help from my friends" it was able to "come together"
(*apologies for The Beatles puns)
Below I have two input scripts, both relatively simple and written to explain things clearly (*I hope*)
FIRST: You need to know a few things: This script uses variables such as myLives, (Optional) my Score, and (Optional: see below) myContinues
SECOND: YOU NEED A GAME OVER SCREEN http://nesmakers.com/viewtopic.php?f=36&t=2137&p=26172#p26174
(make one from here or your own way)
PLEASE! MAKE SURE THEY ARE DEFINED! PRETTY PLEASE!
I have commented out the parts of the script pertaining to SCORE and CONTINUES to enable them you can uncomment them or download them already edited (your choice)
You want to assign this script below in inputs to your GAME OVER SCREEN STATE or lacking that, your WIN screen state
Code:
;;; This script can be used as a restart game from screen input script.
;;; It will take you to the previous screen and set up new continue points based on
;;; that screen's info.
LDA #$03
STA myLives
;;;; THE PART HERE RESETS YOUR SCORE 6 DIGITS;;;;
;LDA #$00
;STA myScore
;STA myScore+1
;STA myScore+2
;STA myScore+3
;STA myScore+4
;STA myScore+5
;;;; THE PART ABOVE RESETS YOUR SCORE 6 DIGITS;;;;
;;;; THE PART BELOW IS EDITED FOR IF YOU USE A VARIABLE FOR CONTINUES/CREDITS ;;;;
;LDA myContinues
;CMP #$00
;BNE +DoContinue
; JMP +EndofScript
;+DoContinue:
;DEC myContinues
;;;; THE PART ABOVE IS EDITED FOR IF YOU USE A VARIABLE FOR CONTINUES/CREDITS ;;;;
LDA screenUpdateByte
ORA #%00000100
STA screenUpdateByte
LDA continueMap
STA warpMap
LDA continueScreen
STA currentNametable
LDX player1_object
STA Object_screen,x
LDA #$02 ;; this is continue type warp.
STA screenTransitionType ;; is of warp type
LDA gameHandler
ORA #%10000000
STA gameHandler ;; this will set the next game loop to update the screen.
LDA myMaxHealth
STA myHealth
+EndofScript:
RTS
The script below is an input for the Start Screen (or any screen you want to add credits with a button press) This is only needed IF you want LIMITED CONTINUES.
I use press SELECT button on START SCREEN (*I commented out the SFX but you can add them back in*)
Code:
;; simple script adds to a variable myContinues and plays a sound ;;
;; someone else may add an indicator on screen, but for now a simple script ;;
INC myContinues
;PlaySound #SND_GETCOIN
RTS
those were the two simple scripts, below is the uncommented version of CONTINUE WITH SCORE RESET AND LIMITED CONTINUES...
LIMITED CONTINUES AND SCORE RESET:
Code:
;;; This script can be used as a restart game from screen input script.
;;; It will take you to the previous screen and set up new continue points based on
;;; that screen's info.
LDA #$03
STA myLives
;;;; THE PART HERE RESETS YOUR SCORE 6 DIGITS;;;;
LDA #$00
STA myScore
STA myScore+1
STA myScore+2
STA myScore+3
STA myScore+4
STA myScore+5
;;;; THE PART ABOVE RESETS YOUR SCORE 6 DIGITS;;;;
;;;; THE PART BELOW IS EDITED FOR IF YOU USE A VARIABLE FOR CONTINUES/CREDITS ;;;;
LDA myContinues
CMP #$00
BNE +DoContinue
JMP +EndofScript
+DoContinue:
DEC myContinues
;;;; THE PART ABOVE IS EDITED FOR IF YOU USE A VARIABLE FOR CONTINUES/CREDITS ;;;;
LDA screenUpdateByte
ORA #%00000100
STA screenUpdateByte
LDA continueMap
STA warpMap
LDA continueScreen
STA currentNametable
LDX player1_object
STA Object_screen,x
LDA #$02 ;; this is continue type warp.
STA screenTransitionType ;; is of warp type
LDA gameHandler
ORA #%10000000
STA gameHandler ;; this will set the next game loop to update the screen.
LDA myMaxHealth
STA myHealth
+EndofScript:
RTS
Thank you to Drexegar and ChronosV2 for all your help making this work gentlemen.
I hope this helps some of you out