🦸🏻 Player: Pick up and Drop

Pick up and throw is a common feature in most simulation games. To achieve this feature, we can use plugin command Child and Parent.


STEP 1 - PICK UP



I'll create a barrel event. When player interacts with it, I'll position the barrel above the player's head in pixels and use the Child and Parent commands to make the barrel a child of the player. This way, whenever the player moves, the barrel will move along with him. Not placing the barrel on player's head also works, but it's less visually appealing.

First command:
moveToPosition($gamePlayer.centerPositionPoint().x - 0.5, $gamePlayer.centerPositionPoint().y - 0.5 - 1.1)

In version 1.2.0, you can use this instead:
moveToPosition('player pixel', 'player pixel - 1.1')

This moves the barrel to the player's position with a Y offset of -1.1 tiles. Adjust this value to match your character's height.

Second command: Child and Parent - No further explanation needed.
Don't forget to add Control Self Switch so when picked up, the barrel will enter drop stage.

STEP 2 - DROP



This page will operate in Parallel mode. When the OK button is triggered, we'll detach this event from being a child of the player by setting The Parent to none.

Next, we'll move the barrel to a ground position based on the player's direction. If we previously positioned the barrel at the player's position with a Y offset of -1.1, we'll now set it to just Y (without the -1.1 offset) so that it moves to the player's feet. This is purely about positioning; feel free to experiment, make adjustments, and try different numbers until you achieve the desired effect.

After that, let's turn off the self-switch so the barrel can be picked up again.

RESULT



With creativity and eventing power, you can also throw the barrel or make it fly away or anything.
5 RPG Maker Action Combat Manual: 🦸🏻 Player: Pick up and Drop Pick up and throw is a common feature in most simulation games. To achieve this feature, we can use plugin command Child and Parent . STEP 1...
< >