Language…
16 users online:  Ahrion,  AmperSam,  Ayami, bucketofwetsocks, Dispace, Green, Guido_Keller, Hayashi Neru, JezJitzu, Metal-Yoshi94, pnaha, ShadowMistressYuko, signature_steve, Sweetdude, Tomi P, Znes.609 - Guests: 247 - Bots: 274
Users: 64,795 (2,377 active)
Latest user: mathew

Help disabling bonus stars reset to 0 at Game Over

Hey, can somebody help me disable bonus stars being reset to 0 at Game Over ? When Game over happens, lives are reset to 5 (fine), score is reset to 0 (fine), but the player gets to continue while their bonus star counter is also reset to 0 (not good for my hack). Can you help me make it so that the bonus stars counter is not reset to 0 at Game Over ? (whether Mario or Luigi game overs). But so that instead, the bonus stars counter stays the same at Game Over ?

Or else, disable the ability to continue at game over (must exit game).
I made the hacks Tsunami Island and Super Mario Archipelago
Check them out !


When Mario game-overs, the game effectively reloads the last save point. So first things first, if you're not already, you should probably be using SRAM Plus to add the bonus stars to the save file. Otherwise, if someone saves and quits your game then returns later, they'll lose the stars anyway.

Anyway, to actually get the bonus stars to not reset then, this is all you need:

Code
org $009E4B
	NOP #3


Professional frame-by-frame time wizard. YouTube - Twitter - SMW Glitch List - SMW Randomizer
Thank you Thomas,
I did actually use SRAM Plus to add the bonus stars to the save file before.

I'm gonna try this $009E4B NOP#3.

How do you know this is the place where bonus stars are reset?? I can't see it from the SMW ROM Map on here 0_0
Oh, because it's listed in SRAM Plus patch?
It only has one NOP there,
so, doing NOP #3 will cancel some extra lines that reset the bonus lives at game over?

EDIT:
So I have tried this $009E4B NOP#3 now: bonus stars still get reset to 0 after a game over, when the player selects "Continue". [My saves do save bonus star counts]
The thing is, when Mario game overs and you choose continue, it doesn't reload the last save point, it lets you continue from where you are while resetting all values to default like you're starting a new game there : lives at 5, score at 0, bonus stars at 0, etc.

I would like to make it so that the bonus stars aren't reset to 0 when this happens, to prevent a player getting to "continue" after uncovering levels on the overworld and resetting their bonus star counter to 0 allowing him to effectively start the time limited game at any point on the map, taking advantage of levels that have more coins in them to start from etc. (cause in my hack game ends when you are at 100 bonus stars and you get +2 bonus stars for finishing a level and +1 bonus star for losing a life)

Worst case scenario, I can add a few moons in the first levels so that the best play is still to play from the beginning and grab the moons from the early levels. But it would be much nicer to just make sure you can't reset your bonus star counter by doing game over > continue after uncovering however many levels on the map.

Can you help me ? 0_0

I think I may have a alternate solution actually, I have this patch made by Technius which I will use and have tested before (it works) :

Code
header : lorom			; > Are these even necessary anymore?

org $00F60A			; \ Hijack
autoclean JML DeathHijack	; / 

freecode
DeathHijack:		PHX			; > Preserve X

			LDX $0DB3		; \ 
			LDA $0F48,x		; | Increase the current player's bonus stars
			INC A			; | 
			STA $0F48,x		; / 
			CMP #$64		; \ If greater than #100, branch
			BCS HasBonusStars	; / 

			LDA #$09		; \ 
			STA $1DFB		; |  Change music
			LDA #$FF		; | 
			STA $0DDA		; / 
			PLX			; > Pull X
			JML $00F614		; Continue the death

HasBonusStars:		LDX $95			; \ 
			LDA $5B			; | 
			LSR			; | 
			BCC +			; | Teleport
			LDX $97			; | 
+			STZ $19B8,x		; | 
			LDA #$06		; | 
			STA $71			; / 

			STZ $19			; > Remove power-up
			
			PLX			; \ Pull X and return
			RTL			; / 


This causes a bonus star to be added on death, and teleports to level 0 which player gets stuck in for end of game if bonus stars are 100 or more. If I'll just add an extra branch condition in there to check for 0 lives, I can make it go to teleport to level 0 as well and this would end the game for the player (they can't get out to hit a game over > continue and keep playing a resetted game from whatever overworld status, and even get to save game after that :/). If needed, I could make it add one life if for some reason it causes a game over before teleporting to level 0. Sounds reasonable no?
I made the hacks Tsunami Island and Super Mario Archipelago
Check them out !
Originally posted by PROMETHEUS
If I'll just add an extra branch condition in there to check for 0 lives, I can make it go to teleport to level 0 as well and this would end the game for the player (they can't get out to hit a game over > continue and keep playing a resetted game from whatever overworld status, and even get to save game after that :/). If needed, I could make it add one life if for some reason it causes a game over before teleporting to level 0. Sounds reasonable no?

This is the solution I ended up using, it works now as intended. I actually had to implement a little fix to TechniusStarDeath you have to do SEP #$20 STZ $88 REP #$30 before the teleport stuff, otherwise teleporting will bug if you ever used a pipe in the level (or entered level with pipe exit) before triggering the teleport.
I made the hacks Tsunami Island and Super Mario Archipelago
Check them out !