Skip to content

Instantly share code, notes, and snippets.

@KageDesu
Last active April 18, 2025 16:57
Show Gist options
  • Save KageDesu/aad29345574201ec9979b9a913b001f1 to your computer and use it in GitHub Desktop.
Save KageDesu/aad29345574201ec9979b9a913b001f1 to your computer and use it in GitHub Desktop.
Pocket Events Plugin Guide

Pocket Events Plugin Guide for RPG Maker

This guide explains how to use the Pocket Events plugin in RPG Maker MZ and MV, allowing players to place and manipulate events from a specified 'template' map in the current map.

Setup

  1. Template Map:
    The plugin allows you to place events from a designated 'template' map. The template map can be set in the plugin's "Templates Map" parameter.

  2. Placement Items Setup:
    Define placement rules and setup events using the 'Placement Items' plugin parameter.


Plugin Commands

Placing and Removing Events

To place and remove events, use the following plugin commands:

RPG Maker MV Commands:

  • PlacePocketEvent PlacementItemID RemoveItemID

    • PlacementItemID: The index of the Placement Item from the 'Placement Items' plugin parameter.
    • RemoveItemID (Optional): The ID of the item that will be removed from the player's inventory after placing the item.
  • PickUpPocketEvent PlacementItemID GainItemID

    • PlacementItemID: The index of the Placement Item from the 'Placement Items' plugin parameter.
    • GainItemID (Optional): The ID of the item that will be added to the player's inventory after removing the item from the map.
  • PickUpThisPocketEvent GainItemID

    • This command will remove the currently selected Pocket Event (which must have been placed using this plugin).
    • GainItemID (Optional): The ID of the item that will be added to the player's inventory when the event is removed from the map.

RPG Maker MZ Commands:

See plugin command inside RPG Maker

PluginCommands


Changing Event Direction

You can change the direction of placed events. Ensure the template event has "Direction Fix" disabled.

  • Keyboard: Hold Shift and press the Arrow Key to rotate.
  • Mouse: Hold Shift and use the Mouse Scroll Wheel to rotate.

DirectionFix

directionDemo


Adjusting Y Offset

If the Pocket Event has the Allow Y Offset? parameter enabled, you can adjust the Y offset as follows:

  • Keyboard: Hold Ctrl and press the Arrow Key.
  • Mouse: Use the Mouse Scroll Wheel to adjust.

yOffset

Offset


Expanding Event Collision Size

This feature allows you to expand the collision size of an event, which can be useful for both draggable and pocket events.

To expand the collision size of an event, add the following comment on the event's page:
expandSize:[DX, DY],...

  • DX, DY: These represent the extra collision cells added to the event, measured in tiles.

Examples:

  • Expand to the left:
    expandSize:[-1,0]

  • Expand to the left and right:
    expandSize:[-1,0],[1,0]

  • Expand up and down:
    expandSize:[0,-1],[0,1]

  • Expand in all directions:
    expandSize:[-1,0],[1,0],[0,-1],[0,1]

ExpandSize

Note: Please note that this comment should be added on every page of the event. If the event switched to a page without this comment, it will revert to its original 1x1 size.


Timer

You can set Timer for Pocket Event.

  • See plugin parameter Timer for setup Timer settings.
  • After Timer is expired, you can set action for Pocket Event.

Timer


Initialy placed pocket events

empty event

You can add pocket events to the map in the editor. To do this, add the following comment to the event's page: initialPocketEvent:ID

initial comment

Where ID is the index of the placement item from the plugin parameters. index from pp

Note: The event must be set to "Below Characters" in the editor for it to be placed correctly. And event must be empty (not image, no trigger, etc.). Event body will be replaced with the pocket event.


Place pocket event only over certain events types

First you should turn ON Place On Events? plugin parameter in placement item config. This will allow you to place pocket events over other events.

Then, you can restrict the placement of pocket events to only certain event types. Add types to the Events Types plugin parameter. Example: "Table".

type

For set type to the map event, add the following comment to the event's page: placeOverType:NAME
Where NAME is the name of the type you want to allow place over this event.

placeOverType

Note: You can set special comment placeOverType:none to disable placement over this event.


Draggable Events

You can create events that the player can drag across the map using the mouse. To enable this feature:

  1. Set the plugin parameter "Event Drag Drop?" to true.
  2. Define draggable event rules in the "Draggable Templates" plugin parameter.

Creating Draggable Events:

To make an event draggable, add the following comment to the event's page:
draggable:X
Where X is the number of the dragging template from the plugin parameters.

DragableTemplate

DragDemo

Step by Step Guide


Script Calls

The following script calls are available for use in your events:

  • PE_Place(PlacementItemID, RemoveItemID);
    Place a Pocket Event with the specified item. Optionally remove an item from the inventory after placement.

  • PE_PickUpByItem(PlacementItemID, GainItemID);
    Pick up (remove) a Pocket Event and optionally gain an item.

  • PE_PickUpByEvent(GainItemID);
    Pick up the currently selected Pocket Event and optionally gain an item.

  • PE_LastEventId();
    Returns the ID of the last placed Pocket Event or draggable event.

  • PE_LastEventRegion();
    Returns the region of the last placed event.

  • PE_LastEventTerrain();
    Returns the terrain tag of the last placed event.

  • PE_LastEvent();
    Returns the Game_Event object of the last placed event.

  • PE_ForceStopTimer(eventID, mapID);
    Stops the timer for a specified Pocket Event. If mapID is not provided, the current map ID is used.

  • PE_ForceCompleteTimer(eventID, mapID);
    Completes the timer action for a specified Pocket Event. If mapID is not provided, the current map ID is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment