Making a picked up item appear briefly above player's head?

So, in this project, the player collects a few different things. One of them is a dog. I'm trying to make it so that the player interacts with the dog, and then basically holds the dog over their head. A moment later, the dog disappears and the player puts their hands down.

Pretty much like what they do in the old Zelda games when you pick up items.

I kind of have it working. At the moment, the dog is to the left side of the room below. The player interacts and the dog is teleported to the tile above the player's head, but if the player interacts from a different location, then it won't appear above the player.

Is there a way to find the player's location and then make the dog or whatever object spawn one tile above it?

upload_2019-1-5_14-30-0.png
Use Control Variables to get the player's X and Y positions (in Game Data). Then subtract 1 from the Y variable. Then use Set Event Location to move the dog to the new location, using the variables to specify where to put it.
I haven't had a lot of opportunities to help, but this should work:

EDIT: Oh, Shaz beat me to it.
So, in this project, the player collects a few different things. One of them is a dog. I'm trying to make it so that the player interacts with the dog, and then basically holds the dog over their head. A moment later, the dog disappears and the player puts their hands down.

Pretty much like what they do in the old Zelda games when you pick up items.

I kind of have it working. At the moment, the dog is to the left side of the room below. The player interacts and the dog is teleported to the tile above the player's head, but if the player interacts from a different location, then it won't appear above the player.

Is there a way to find the player's location and then make the dog or whatever object spawn one tile above it?

View attachment 106312

Use Control Variables to get the player's X and Y positions (in Game Data). Then subtract 1 from the Y variable. Then use Set Event Location to move the dog to the new location, using the variables to specify where to put it.

Thanks for the replies guys and this helped me to get it working, however, I have one follow up issue/question:

I'm using this in another room where the player picks up a key. However, the player visits this room 3 different times throughout the game, but its a new map each time, I've just changed some things around.

I made it so the key is just a transparent event above the chest and when the player opens the chest it moves the key above the players head like you guys showed me, but does this mean I have to have the same key event in each version of this room if I want to allow the player to pick it up at different points?
So the chest has the commands to do everything? In that case, if it's just "one" chest and key, and the room changes at different points in the game, you'll have to have the same events in each room if you want the player to be able to get it at any time.

When they get the key, turn on a switch (not a self switch). Give all keys an extra event page with nothing on it, conditioned by that switch, and give all chests an extra event page with nothing on it but whatever the "end" image is for the chest. This means no matter what room they're in when they get the key, when they go to the other versions of the room, it will behave as if they've gotten the key from there. Easiest way here would be to get one up and running properly, then copy/paste it to the other rooms. But you'll need to make sure the key has the same event id in each room, or that you change each chest event to refer to the correct key event.
So the chest has the commands to do everything? In that case, if it's just "one" chest and key, and the room changes at different points in the game, you'll have to have the same events in each room if you want the player to be able to get it at any time.

When they get the key, turn on a switch (not a self switch). Give all keys an extra event page with nothing on it, conditioned by that switch, and give all chests an extra event page with nothing on it but whatever the "end" image is for the chest. This means no matter what room they're in when they get the key, when they go to the other versions of the room, it will behave as if they've gotten the key from there. Easiest way here would be to get one up and running properly, then copy/paste it to the other rooms. But you'll need to make sure the key has the same event id in each room, or that you change each chest event to refer to the correct key event.

Gotcha. Thanks for the breakdown.

I think what I've done wrong here is that I had this short game using multiple version of the same map for different points in the story, but then I went and consolidated most of it into the one map thinking that that was the best way to go and would reduce file size and everything.

I shouldn't have done that and it's made things really annoying. Not a workflow I'll use in future, especially now that I look at my test build and see that extra maps only cost like 100kbs or so.
I have a copy/change tiles plugin that might help you with maps that change as the story progresses. Check it out next time you want to do something like that - might make it a bit easier.

Original thread: https://forums.rpgmakerweb.com/threads/making-a-picked-up-item-appear-briefly-above-players-head.104053/