Triggered screen causing assets to disappear (Bug or feature?)

SciNEStist

Well-known member
I am making an adventure style game and I have noticed that any tile I make that uses the very top right of the tileset gets erased and replaced with the regular ground when entering a screen that is triggered.

this means that if i draw a small rock on the top right corner of BckCHR_02.bmp for example, then make an asset that puts a rock on the screen and place a bunch of these rocks around my screen, they show up normally. I then trigger the screen and then next time it is loaded, all my rocks have dissapeared. (it doesn't effect collision BTW)

This is a pretty cool way of changing how a screen looks after something happens, but It really really confused me as to why all my rocks kept disappearing.

Is there a way to stop this from happening? (other than just not using the top right corner of the tileset?)
 

Mugi

Member
generally you should leave the top left metatile empty on a tileset, as that is the metatile index #$00 which is the default for an unpainted area.
it can somewhat be worked around with, but this is generally how the tiledraw in nesmaker was made, as such, it does indeed reserve one metatile for "blank"
 

dale_coop

Moderator
Staff member
Which module are you using?
Because, yes, it's a feature... it's the way NESmaker deals with the locked doors, Key tiles, monster locks, ....
You collect e key tile, you kill all the monsters or you open a lockeddoor... the tile is removed (replaced by another tile) and the screen is triggered.
When a triggered a screen is loaded, the engine remove/replace tiles that match to the Key tile or lockeddoor or monster lock tile ID (it does the same with the collision data).
To do that... The code engine compares the tiles and collision data with a bunch of constants.
So... you need to check if those constats are correct for your needs/project:
- TILE_INDEX_LOCK (should match with the index of your locked door tile... "index", in your bg tileset)
- TILE_KEY (should match with the index of your key tile... "index", in your bg tileset)
- TILE_MONSTER_LOCK (should match with the index of your monster lock tile... "index", in your bg tileset)
Note: If you don't have some of those constants, it means they are not used in your modules (TILE_KEY and TILE_MONSTER_LOCK are not used in every modules)

For simple tests... if you don't know, just set them to "0"

ALSO, the same happens with collisions, some tile types are chcked and replace, so you have to check those:
- COL_INDEX_LOCK (should match with the tile type for locked door)
- COL_KEY (should match with the tile type for get key tile)
- COL_MONSTER_LOCK (should match with the tile type for monster lock)
 
Top Bottom