"Adventure" Module Softlock

Hello! I am having an odd issue with the adventure module. This issue causes the to freeze up. The music still plays, but nothing moves and you can't do anything; it essentially softlocks the game and you'll have to reset. I'm not sure exactly what causes it, but it seems to happen only if you get hurt by an enemy while a player projectile is present on screen. I am also using a checkpoint system (I implemented it with dale_coop's checkpoint tutorial) and that might have something to do with it, as a game that made a long time ago ran into it recently, and it had never run into it until I updated it to have the checkpoint system. This really sucks for long games on Flash Carts, where savestates/rewinding is not a thing, so if anyone could help with this, it would be greatly appreciated! Thanks! :D
 

Dirk

Member
I have the same or similar problem in my game, but I think the music doesn't continue to play. Sadly I've never found a solution.
Which version of NESmaker do you use?
It happens in the 4.0.x release for me, in 4.1.5 I have yet to implement an enemy who shots.
 
Dirk said:
I have the same or similar problem in my game, but I think the music doesn't continue to play. Sadly I've never found a solution.
Which version of NESmaker do you use?
It happens in the 4.0.x release for me, in 4.1.5 I have yet to implement an enemy who shots.

I am in 4.1.5 so I can confirm, it's still a thing unfortunately...
 

Razzie.P

Member
Not sure about the adventure module, but I had the same issue with the Maze module after adding the checkpoint system. If happened anytime the player died (got hurt script) or finished the level when a projectile was on screen. I didn't figure out the "correct" way to fix it, but the workaround that resolved it for me (to the best of my knowledge) is I added code to destroy all monster objects upon player death or before events that caused the warp. I'm pretty sure I found the code somewhere on the forum here and started playing around with it to see if it'd work. The code used I is --

Code:
;;; Adding the following code to correct "shooting" bug
;;; Destroy all Monsters

	CPX player1_object
	BNE +

        LDX #$01
	LDA Object_ID,x	
	DeactivateCurrentObject
	LDX #$02
	LDA Object_ID,x	
	DeactivateCurrentObject
	
	+
	CPX #$02
	BNE ++
	
	LDX #$03
	LDA Object_ID,x	
	DeactivateCurrentObject
	LDX #$04
	LDA Object_ID,x	
	DeactivateCurrentObject
	
++


;;;; End Destroy Code

Hope it helps!
 

dale_coop

Moderator
Staff member
A fix you could try for the soft lock, open the script assigned to the « handle object collision » in your « Project Settings > Script Settings ».

Locate and comment out the line
Code:
   JSR CountAllMonsters
(adding a « ; » at the beginning of the line)
 

Razzie.P

Member
Dirk said:
That's great, thank you! Where did you add the code?

I would definitely try dale_coop's suggestion first. His sounds like it could be the correct way to fix it. But if it's still not working and you want to give it a shot, I added that code in 2 places. 1st, I added to the beginning of my "PlayerLoseLife" script so it would destroy everything when I die, before restarting at the checkpoint. And then I added it to the beginning of the "NoMorePrize_CreateVictoryObject" script. In the maze module, this destroys everything, THEN creates the Victory animation which causes the game to warp to the next screen. I'm not sure where it should be added in the other modules though.
 

KamDraby

New member
Thanks for the additional suggestions. Itd be an interesting thing to find that it had been Waylander, because I had thought that I hadnt read any of Gemmell before. But maybe...
 

Dirk

Member
Razzie.P said:
I would definitely try dale_coop's suggestion first. His sounds like it could be the correct way to fix it.

Thank you for the tip, but unfortunately it didn't work. I'll try your approach next.
 

dale_coop

Moderator
Staff member
Dirk, your project is in 4.0? Not sure it's the same problem...
Yours could be the player Action Step used for shooting (the Action Step 2 for adventure / Action Step 3 for platformer) that is not set to "GoFirst" at end of timer/animation...?
 

dale_coop

Moderator
Staff member
If it's not that, and if you need help to fix that, send me a copy of your NESmaker project (more precesily, I'd need, the .MST file and GraphicAssets and GameEngineData folders).
 

Dirk

Member
dale_coop said:
Dirk, your project is in 4.0? Not sure it's the same problem...
Yours could be the player Action Step used for shooting (the Action Step 2 for adventure / Action Step 3 for platformer) that is not set to "GoFirst" at end of timer/animation...?

Hmm, I changed Action Step 2 and 3 for the witch and the projectile to "GoFirst" but it still doesn't work.
 

Dirk

Member
dale_coop said:
If it's not that, and if you need help to fix that, send me a copy of your NESmaker project (more precesily, I'd need, the .MST file and GraphicAssets and GameEngineData folders).

Oh, thank you! That would be nice. Should I email you the folders?
 

dale_coop

Moderator
Staff member
Yep, you could zip it. And send/share via google drive ou dropbox (or servicee like wetransfer.com or send.firefox.com), send me the link for dl via PM.
 

Dirk

Member
dale_coop said:
...or servicee like wetransfer.com...

I always forget about wetransfer. Thank you again! I'll pm you my files in a minute.
The game doesn't always get stuck. If you die it'll get stuck sooner when killing a witch, at least that's my impression. Maybe it has something to do with the music, which also stops after you die.
 

Dirk

Member
I just want to report that dale_coop managed to solve my problem :)
After killing witches for 20 minutes I still had no freezes occur, so I'm very hopeful they are gone for good.
Thank you again dale_coop :)

Here is the code Dale added:

dale_coop said:
To fix this, modify the Bounds_Platform_Simple script (the one assigned to the "Handle Bounds" element in your "Project Settings > Script Settings").
Around line 145, just after the line:

Code:
	STA DrawHudBytes

Add this code:

Code:
	;; dale_coop: fix the freeze when killing/colliding monsters/monster weapons:
	JSR DeactivateAllObjects

I have to mention that I am using NESMaker version 4.0.11.
 
Dirk said:
I just want to report that dale_coop managed to solve my problem :)
After killing witches for 20 minutes I still had no freezes occur, so I'm very hopeful they are gone for good.
Thank you again dale_coop :)

Here is the code Dale added:

dale_coop said:
To fix this, modify the Bounds_Platform_Simple script (the one assigned to the "Handle Bounds" element in your "Project Settings > Script Settings").
Around line 145, just after the line:

Code:
	STA DrawHudBytes

Add this code:

Code:
	;; dale_coop: fix the freeze when killing/colliding monsters/monster weapons:
	JSR DeactivateAllObjects

I have to mention that I am using NESMaker version 4.0.11.

Doesn't seem to work for me, any advice?
 
Top Bottom