Using Monsters/NPCs as searchable objects

superNESjoe

New member
I'd like to have objects that are basically chests that the player can search and obtain items from. Here's the basic logic I'm looking for.

- A "search" tile is placed next to an object the player can search (chest, drawer, etc)
- If the player presses a button while colliding with this tile, it performs a search check
- The default response triggers a dialogue box informing the player nothing is there.
- If something is there, it triggers a dialogue box informing them what they found, and adds an item to their inventory
- The search tile now remembers that this item has been collected, and will trigger the default "nothing is here" text.

Alternatively, I'd like to do a variation of this
- The player interacts with the "search" tile and it checks for a specific item in their inventory
- If the item is there, it removes it and then performs some sort of response

In general, it'd be nice if there was a tutorial somewhere to help with the concept of locked doors and keys. I know I can use a variable for keys, but I don't know how to set up a "door". My guess is it'd be a solid tile that is destroyed when the player
walks into it if they have a key, but I have no idea how to script a tile that reacts in that way and then replaces itself with something else.
 
Top Bottom