Small problems with start screen and checkpoint

CGdfc

New member
Hello, I have not been here for a long time because I am also working on another game.

Back to our beloved NES/Famicom console, I've been checking some things that I see that don't work well, I really don't know why ... it worked before. I think it must be some script because in all projects it gives the same problem.

problem 1: special screen of start game, it does not work, the image appears but pressing the start button does not start the game. the start button script is well added (StartGame.asm)

Problem 2: In my game, since we can't use save game, use the checkpoints to continue, the problem I see is that sometimes you die and the image stays there, or makes a restart game.
it doesn't always happen ... but it happens.

I hope you guys can help me, greetings.
 

dale_coop

Moderator
Staff member
Hey CGdfc :)

1) Are you sure you assigned the StartGame to the "StartScreen" state, for START button "Press" in the Input Editor? Could you check/confirm? (a screenshot?)
2) Could you share the checkpoint script here, could be an error in it?
Or maybe the way you die.... killed by a monster? killed by a death tile? Also how is your Player Lose Life script ?
 

CGdfc

New member
hey dale_coop,
YES! here more info and screenshot.
eOVi6u5.jpg


--StartGame.asm
Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; PART 1: Prepare the game for a state change.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  StartButton_StartScreen:
  LDA #STATE_START_GAME
  STA change_state
  
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; PART 2: If a sound is playing and you want it to stop,
;; or if you'd like to play a sound effect to designate
;; the button press, you can do that here;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

  ;StopSound
  ;PlaySound #$00, $00
  
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; PART 3: Turn on sprites;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

  LDA #%10000000
  STA gameHandler ;; turn sprites on
  RTS


--PlayerLoseLife.asm

Code:
;;; do loss of life stuff here
	DEC myLives
	LDA myLives
	BNE gameNotOver
	;;do gameover stuff here.  Warp to screen?  Show animation?  Just restart?
	JMP RESET
	
gameNotOver:

;;;;;
;;; do warp to continue screen stuff here.
LDA #$00
STA newGameState
 LDA continueMap
 clc
 ADC #$01
 STA temp
 GoToScreen continueScreen, temp, #$04
 LDA #$00
 STA playerToSpawn
; LDX player1_object
; DeactivateCurrentObject
 LDA #$01
 STA loadObjectFlag
 
LDA continuePositionX
STA newX
LDA continuePositionY
STA newY


hmm it seems to be random, I am not sure but it is almost always the first time the player dies, then he can die and usually works well.
It is strange why it happens when it falls into deadly tiles but also with enemy damage.
About the special screen, the startgame thing I don't know why it happens, previously it worked for me by pressing the start button.
 

dale_coop

Moderator
Staff member
For the startGame... make sure your script is still listed under "Scripts > Input Scripts"
The script is correct it should work...
Or maybe an issue with your Start Screen? You could try changing the song to any music except "NO CHANGE" nor "STOP MUSIC".

For your dead, I think your Death Tiles script is not correct? (maybe it is assigned to a script that does a JMP RESET... it should be assigned the the HandlePlayerDeath.asm).
 

CGdfc

New member
Everything is correct, does not use these music and the script is in input scripts. I think it must be some other script but I don't know.

After many additions and improvements, using forum tutorials, to do tests etc., I had the start game inactive so as not to waste time, but now it doesn't work because some modified script had changed something.

if I make a new project, the special screen of start game does not work.

The same goes for deaths.

I can show the scripts I have.

setcheckpoint asm

Code:
	CPX player1_object
	BEQ +
	JMP dontDoCheckpoint
+

	LDA Object_x_hi,x
	STA continuePositionX
	LDA Object_y_hi,x
	STA continuePositionY
	LDA currentMap
	STA continueMap
	LDA Object_scroll,x
	STA continueScreen
	PlaySound #SND_VICTORY
	TriggerScreen continueScreen
	ChangeTileAtCollision #$00, #TILE_CHECKPOINT_CLEARED
dontDoCheckpoint:

handleplayerdeath asm

Code:
	CPX player1_object
	BNE +
	JSR HandlePlayerDeath
	PlaySound #SND_HURT_PLAYER
+

warptoscreen asm

Code:
	;; used with macro
		
		LDA temp2
			STA Object_scroll,x
			STA currentNametable
			STA newScreen
			STA currentScreen ;currentScreen
			STA xScroll_hi
			STA nt_hold
			LDA Object_scroll,x
			AND #%00000001
			STA showingNametable
			LDA newX
			STA Object_x_hi,x
			STA xHold_hi
			

	LDA temp1
	STA screen_transition_type
		
	LDA temp3
	;LDA warpMap
	STA update_screen_details
	
	;LDA #$01
	;STA tile_solidity		
	LDA #$00
	STA gameHandler
		LDA #%11000000
				;7 = active
				;6 = 8 or 16 px tiles
			ORA #GS_MainGame
			ORA #%01000000
			STA update_screen
	LDA #$00
	STA xScroll
doneWithWarpToScreen:
 

dale_coop

Moderator
Staff member
You might have made some errors during your modifications in scripts that could cause those issues.
If you want to share your NESmaker folder (zipped), I could check your project and tell more precisely you what's going and how to fix those issues.
 

CGdfc

New member
dale_coop said:
You might have made some errors during your modifications in scripts that could cause those issues.
If you want to share your NESmaker folder (zipped), I could check your project and tell more precisely you what's going and how to fix those issues.

thanks dale_coop, yes, now I send you the project and many texts privately. ;)
 

jcramer

New member
Was this problem resolved? I'm working on a new game and I noticed similar problems. It wasn't until I set up the start screen that I noticed it. There isn't any checkpoints or lives available. Forced to reset to begining.
 

dale_coop

Moderator
Staff member
jcramer said:
Was this problem resolved? I'm working on a new game and I noticed similar problems. It wasn't until I set up the start screen that I noticed it. There isn't any checkpoints or lives available. Forced to reset to begining.

It depends... i found out the Start Screen had an issue because of the PreDraw script (that was executing code that was freezing the game).
What is your issue jcramer? Your start screen freezes? or your checkpoints don't work?
 

CGdfc

New member
the special start screen problem has been fixed, thanks to dale_coop. :)

It was related to the "Handle Sprite Pre-Draw" by some bad modifications, that freezee start screen.
 

jcramer

New member
4.1. I think I might have accidentally deleted it because I was making a lot of changes, butI tried looking in a new nesmaker folder but can't find it there. I tried using the checkpoint in the scrolling platformer but it won't compile.
 

jcramer

New member
Is there a difference between the scrolling platformer checkpoint and the simple platformer checkpoint?
 

jcramer

New member
Could there be a bigger problem causing it to not compile? I even tried the checkpoint code posted here in the thread.
 

dale_coop

Moderator
Staff member
Could you share your errors, we'll see what is the problem for your project? (maybe it's just a SFX sound label that is not declared)
 

jcramer

New member
Here's the errors I'm getting. I spent some time looking through my game files and I think it's happening because it's set to JMP reset instead of losing a life.
 

Attachments

  • checkpoint errors.jpg
    checkpoint errors.jpg
    97.4 KB · Views: 1,602

dale_coop

Moderator
Staff member
It's an "unknown label" in the setChecpoint.Asm script, at line 16... it might be a constant name (the TILE_CHECKPOINT_CLEARED one?)...
Go to your "Project Settings > User constants" and add a new one, name it "TILE_CHECKPOINT_CLEARED" with value "0". It should work.
 
Top Bottom