An open library of RPG Maker MZ plugins, powered by the community.

PGMZ - The Community-Driven Plugin Library for RPG Maker MZ

MZ plugins

MPP Object Free Placement - MPP_ObjectFreePlacement.js

Plugin desc : We will add a function that allows you to set up events freely.

License : MIT License

Author : Mokusei Penguin

Website : http://woodpenguin.blog.fc2.com/

Desc page : https://woodpenguin.web.fc2.com/MV_Plugin/ObjFreePlc.html

File name : MPP_ObjectFreePlacement.js

Help of plugin :

* @target MV MZ
 * @plugindesc We will add a function that allows you to set up events freely.
 * @author Mokusei Penguin
 * @url
 *
 * @help [version 2.0.0]
 * This plugin is for RPG Maker MV and MZ.
 * 
 * ▼ Plugin command
 *  - In MV, the variable N is referred to by writing v[N] in the item for
 *    inputting a numerical value.
 *  - In MZ, in the item to enter a numerical value, select the text and
 *    write v[N] to refer to the variable N.
 *  
 *  〇 MV / MZ
 *  
 *  〇 AddPlacementObj objId objTag  / addObj
 *       objId  : ID of the object to be installed(Event ID)
 *       objTag : Tag of the object to be installed(Arbitrary value / Not set:0)
 *   - Place the object in the direction facing the player’s position.
 *   - The detailed installation position and conditions set on the event
 *     side will be applied.
 *   - Tags are used when deleting individually.
 *    
 *  〇 AddPlacementObjPos objId x y objTag  / addObjPos
 *       objId  : ID of the object to be installed(Event ID)
 *       x      : X coordinate
 *       y      : Y coordinate
 *       objTag : Tag of the object to be installed(Arbitrary value / Not set:0)
 *   - Places the object at the specified coordinates.
 *   - The installation distance of the installation conditions is ignored.
 *   - Tags are used when deleting individually.
 * 
 *  〇 ErasePlacementObj objTag  / eraseObj
 *       objTag : Object tag
 *   - Deletes all objects with the specified tag.
 * 
 *  〇 ClearAllPlacementObj mapId  / clearAllObj
 *       mapId : Map ID(-1:All maps, 0:Current map / Not set:0)
 *   - Deletes all objects on the specified map.
 * 
 * ▼ Event notes
 *  〇 <PlcCdt:n>
 *   - Set [Placement conditions] to n for the object to be installed.
 *   - [Placement conditions] specify the ones set in the plugin parameters.
 * 
 * ▼ Script general
 *  〇 $gamePlayer.canPlcObj(objId)
 *       objId : Object ID (Event ID)
 *   - Returns whether the player can place an object with the specified ID
 *     from the current position.
 * 
 *  〇 $gamePlayer.canPlcObjPos(objId, x, y)
 *       objId : Object ID (Event ID)
 *       x     : X coordinate
 *       y     : Y coordinate
 *   - Returns whether an object with the specified ID can be placed at
 *     the specified coordinates (x, y).
 * 
 * ▼ Plugin parameter
 *  〇 Objects Map Id
 *   - The event of the specified map becomes a free placement object.
 *   - The event ID becomes the object ID as it is.
 * 
 *  〇 Conditions - Passable
 *   - If you can pass from the player’s position to the placement position,
 *     you will be able to install it.
 * 
 *  〇 Conditions - Collide
 *   - If there are other events at the placement location, you will not be
 *     able to install.
 * 
 *  〇 Conditions - Tags/Regions
 *   - It can be installed only when the installation position is the
 *     specified terrain tag or region ID.
 *   - When setting numbers in an array, you can specify numbers from
 *     n to m by writing n-m.
 *       Example: 1-4,8 => 1 to 4 and 8
 * 
 * ▼ Other
 *  - If the placed object executes [Erase Event], the object will be
 *    deleted.
 *  - If you use a tile image for the event image, the tile image of the
 *    installed map will be applied.
 *  - Other plugins support features that use event notes and annotations.
 *  - However, it may not be compatible with plugins from other sites.
 * 
 * ================================================================
 * Mail : wood_penguin@yahoo.co.jp (@ is half-width)
 * Blog : http://woodpenguin.blog.fc2.com/
 * License : MIT license
 * 
 *  @command addObj
 *      @desc 
 *      @arg objId
 *          @desc ID of the event to be set up
 *          @type number
 *              @min 1
 *              @max 999999
 *          @default 1
 *      @arg objTag
 *          @desc Arbitrary value
 *          Used when deleting.
 *          @type number
 *              @min -999999
 *              @max 999999
 *          @default 0
 * 
 *  @command addObjPos
 *      @desc 
 *      @arg objId
 *          @desc ID of the event to be set up
 *          @type number
 *              @min 1
 *              @max 999
 *          @default 1
 *      @arg x
 *          @desc 
 *          @type number
 *              @min 0
 *              @max 999999
 *          @default 0
 *      @arg y
 *          @desc 
 *          @type number
 *              @min 0
 *              @max 999999
 *          @default 0
 *      @arg objTag
 *          @desc Arbitrary value
 *          Used when deleting.
 *          @type number
 *              @min -999999
 *              @max 999999
 *          @default 0
 * 
 *  @command eraseObj
 *      @desc 
 *      @arg objTag
 *          @desc 
 *          @type number
 *              @min -999999
 *              @max 999999
 *          @default 0
 * 
 *  @command clearAllObj
 *      @desc Delete all objects placed on the specified map
 *      @arg mapId
 *          @desc -1:All maps, 0:Current map
 *          @type number
 *              @min -1
 *              @max 999999
 *          @default 0
 * 
 * 
 *  @param Objects Map Id
 *      @desc ID of the map to read as an object
 *      @type number
 *          @min 1
 *          @max 999999
 *      @default 1
 * 
 *  @param Conditions
 *      @type struct<Condition>[]
 *      @desc Arrangement of placement conditions
 *      (The numbers are 1,2,3 ... in order from the top)
 *      @default [”{¥”Distance¥”:¥”1¥”,¥”Passable¥”:¥”true¥”,¥”Collide¥”:¥”true¥”,¥”Tags¥”:¥”¥”,¥”Regions¥”:¥”¥”}”]
 * 
 *  @param Clear By Transfer
 *      @desc When was the line the map movement, Delete all the objects
 *      @type boolean
 *      @default true
 *

スポンサードリンク

-MZ plugins

Copyright© PGMZ - The Community-Driven Plugin Library for RPG Maker MZ , 2026 All Rights Reserved.