Locks not working

dale_coop

Moderator
Staff member
When unlocked, doors tiles become warp tiles.
They are coded that way (it’s explained in the Adventure
Tutorial video)
So you need to set your screen to warp out to the next one.
If you don’t want this behavior for your game, Yoh will have to make some small modifications in certain scripts.
 

dale_coop

Moderator
Staff member
In the "TileScripts\LockedDoor.asm" script, change from:
Code:
ChangeTileAtCollision #$02, underSecret
To:
Code:
ChangeTileAtCollision #$00, underSecret  ;; <-- a null walkable tile


And in the "Handle_CheckForTriggers.asm" script, change from:
Code:
FindLockedDoorTilesTarget_onScreenLoad:
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;; FIND TRIGGER TYPE HERE
	LDA collisionTable,y
	CMP #$03 ;; compare to locked door target type
			;; if your trigger type is NOT #$06
			;; then change this to the tile type
			;; of your trigger
	BNE notALockedDoorTarget_onScreenLoad
	LDA #$02
	STA collisionTable,y ;; collision table is changed.
						;; graphics are a little trickier

	ChangeTile #$00, underSecret
To:
Code:
FindLockedDoorTilesTarget_onScreenLoad:
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	;; FIND TRIGGER TYPE HERE
	LDA collisionTable,y
	CMP #$03 ;; compare to locked door target type
			;; if your trigger type is NOT #$06
			;; then change this to the tile type
			;; of your trigger
	BNE notALockedDoorTarget_onScreenLoad
	LDA #$00  ;; <-- a null walkable tile 
	STA collisionTable,y ;; collision table is changed.
						;; graphics are a little trickier

	ChangeTile #$00, underSecret

I think it should be OK.
 

nroflmao

New member
I tried this as well but now i'm getting a problem where the tile in front of the locked door changes but the locked door stays there. Seems like its detecting the block my player is on at collision and changing that to the null tile, instead of changing the actual door to a null tile....any thoughts?
 

nroflmao

New member
OK I figured this one out. It seems there was a modification to the Adventure Tile Collision script from 4.0.6 to 4.0.11, so if you are using 4.0.6 the lock door works correctly, but if you are using the 4.0.11 version then the lock door affects the tile in front of the door, so you can never actually unlock it (i guess this doesn't matter if you are using warp tiles for locked doors, but if you change the default to use Null types then you are stuck). I changed mine to Null Type and found the issue. The solution that worked for me (fingers crossed) is replacing the Adventure_TileCollision.asm from 4.0.11 with the one from 4.0.6....now its working like 4.0.6 was....
it also seems like 4.0.11 changed the default unlock door to use warp tiles instead of null tiles.
 
Top Bottom