Keys/Locked Doors in Platformer?

crazygrouptrio

Active member
I'm trying to get keys and locked doors functioning in the simple platform module. After messing with it for hours and scouring the forums and videos I've yet to get it working. I've set up the keys and the doors to use the correct tile constant, etc, but either the door remains solid even with a key, or the door is walkable with or without the key (I've been messing with it alot... :p ) Much appreciated If anyone has a step by step on how the process would be done maybe I can see where I went wrong.
 

dale_coop

Moderator
Staff member
Yep it's kinda broken. I spent hours/days on that too.

I fixed it in my Monster Lock tutorial. If you want to try.
Backup your NESMaker folder before doing anything (just in case)!
Then, just follow the "EASY WAY" (you need to be in NESMaker 4.1.3 or more )
http://nesmakers.com/viewtopic.php?f=3&t=1750
After installed the zipScript, check again your TILE_KEY, TILE_LOCK, TILE_DOOROPENED (if I remember well), because my script may have set some values by default. And Export & test ;)
--> 2 min.

If your it's not working as you wish. Just restore your backup folder ; )
 

crazygrouptrio

Active member
dale_coop said:
Yep it's kinda broken. I spent hours/days on that too.

I fixed it in my Monster Lock tutorial. If you want to try.
Backup your NESMaker folder before doing anything (just in case)!
Then, just follow the "EASY WAY" (you need to be in NESMaker 4.1.3 or more )
http://nesmakers.com/viewtopic.php?f=3&t=1750
After installed the zipScript, check again your TILE_KEY, TILE_LOCK, TILE_DOOROPENED (if I remember well), because my script may have set some values by default. And Export & test ;)
--> 2 min.

If your it's not working as you wish. Just restore your backup folder ; )

Yes that is what I was following but I messed it up somehow :lol: Now when the player touches the key he turns into a projectile and falls off screen. No idea how that happened... I'll start from scratch later and see if I can make any progress, thanks for the help!
 

dale_coop

Moderator
Staff member
The key is a game object? (like in the platformer tutorial game)
Check the "Project Settings > Scripts Settings", what is the script assign to the corresponding "Power Up" ? (your key, may be the "Power Up 02")
(by the way, for your platformer, your TILE_KEY and COL_KEY user constants should be with a value "0". You "TILE_INDEX_LOCK" should be the tile index of your door...)

Don't hesitate to share screenshots, that can help to see the situation.
(script settings, user constants, tileset, objects?)
 

crazygrouptrio

Active member
None of my power up scripts use the keys? 2 & 3 are blank.
Here is my constants
jrrWBfK.png
 

dale_coop

Moderator
Staff member
What is your key? a tile ? a game object?
If it's a tile, could share a screenhot of your tileset?
If it's a game object, could you share screenhots of your object details, of your "Project Settings > Script Settings" showing the power up scripts assigned.
(Maybe your key is a Game Object and set as "monster"?... instead of "pickup/collectable")
 

crazygrouptrio

Active member
Sorry yes my Key is a game object, and I have it set to pickup. I have the key script in powerup 02. I counted out the tiles for the right constant for TILE_INDEX_DOOR as well but the door tile doesn't change when I get a key. I'm at a loss :?
ULuTSDI.png

7sGehsA.png

TUtJXKJ.png
 

dale_coop

Moderator
Staff member
That looks correct...
And still, when the player touches the key, he turn into a projectile object?
 

dale_coop

Moderator
Staff member
Would you be ok to send me your NESMaker folder (zipped)? I could tell you what's going on...
 

crazygrouptrio

Active member
Sorry no I fixed the projectile problem. I was just messing with settings and that happened :lol: Right now the player can collect a key, the HUD updates correctly, but the door doesn't change.
Sure I can send you the zipped folder. This is the last big hurdle to making my game work so I'm very eager to get it working.
 

dale_coop

Moderator
Staff member
Ok ;)
I check your project and tell you... I think it might be related to the tile_xxx col_xxx constants.
 

dale_coop

Moderator
Staff member
I checked your project...


1/ First, you should add a "locked door" tile type: open the "Project Settinfs > Project Labels", select the Tile Type 11 and rename it from "11 - NULL" to "11 - Locked Door"

2/ Then in the "Project Settings > Script Settings", set the script "Routines\Basic\ModuleScripts\TileScripts\Adventure\LockedDoor.asm" to your "Tile collision 11" element:

2019-01-22-17-09-39-Param-tres-du-projet.png


3/ In the "Project Settings > User constantss", set your "TILE_OPENDOOR" to the value "02" (the normal wall tile in the tileset):

2019-01-22-17-11-52-Param-tres-du-projet.png

(And your "TILE_INDEX_LOCK" should be "70")

4/ And you should put again your EXIT asset on your screen (currently ths collision says "14 - Monster Locks" but it should be a "05 - Warp To Screen").
 
Top Bottom