twin paradox
New member
After watching all of the tutorials and scouring many, many forum posts I am still having trouble with one mechanic that I need in my game. First off, I am using the Simple Platformer Module and NES Maker Version 4.1.5. I managed to successfully create a key object that uses a Powerup script and the HUD seems to update properly when I pickup the key. I then used the Locked Door script and assigned it to tile type #07. I had to uncomment a bunch of lines in the locked door script and now I am able to use the key on the locked door and have it change the locked door tile type to my #00 type tile (walkable) so that I can pass through. The only problem is that when I return to the room with the locked door, it is still there. I have tried uncommenting the "TriggerScreen screenType" line in the locked door script as the comments suggest to do but if I do, it gives me a "Branch out of Range" error when I try to compile the game.
Here are a few relevant things-
My User Constants:
My Script Settings:
My Background Tileset that contains the locked door tile (it's just a yellow square placeholder for now):
My Locked Door Script:
Please let me know what relevant information you would like me to share if the solution is not obvious. Thank you!
Here are a few relevant things-
My User Constants:
My Script Settings:
My Background Tileset that contains the locked door tile (it's just a yellow square placeholder for now):
My Locked Door Script:
Code:
;;; SOLID
;;;This is how to inform a solid collision.
;;; You can also add this to the end of
;;; any tile type if you want it to have an effect AND
;;; be treated like solid.
;;; You could also check to see if it is a non-player object,
;;; and only return solid if it's a not player. This would
;;; cause monsters to treat things like spikes or ladder or fire
;;; as solid while the player is able to interract with it.
;;; RIGHT NOW, this changes to the underSecret type tile.
;;; And it changes to the 00 type (walkable) collision.
;;; to change this to a different collision type, for instance a warp,
;;; change the first argument in the ChangeTileAtCollision macro below.
LDA #TILE_SOLID
STA tile_solidity
;; if you want it solid, declare it at the end
;; is collision position loaded into y?
CPX player1_object
BNE +
LDA myKeys
SEC
SBC #$01
BMI +
STA myKeys
LDA myKeys
LDA #$01 ;; amount of score places?
STA hudElementTilesToLoad
LDA DrawHudBytes
ORA #HUD_myKeys
STA DrawHudBytes
ChangeTileAtCollision #$00, underSecret
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ;;; IF YOU WANT THE LOCK TO STAY GONE, Trigger the screen.
; ;;; if not, comment this out.
TriggerScreen screenType
;PlaySound #sfx_emptySFX
+