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

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

MZ plugins

Dot Move System - DotMoveSystem.js

Plugin desc : Dot movement system v2.2.4

License : MIT License

Author : unagi ootoro

Website : https://github.com/unagiootoro/RPGMZ/blob/master/DotMoveSystem.js

Desc page : https://raw.githubusercontent.com/unagiootoro/RPGMZ/master/DotMoveSystem.js

Download Page : https://raw.githubusercontent.com/unagiootoro/RPGMZ/master/DotMoveSystem.js

File name : DotMoveSystem.js

Help of plugin :

@target MV MZ
@plugindesc Dot movement system v2.2.4
@author unagi ootoro
@url https://raw.githubusercontent.com/unagiootoro/RPGMZ/master/DotMoveSystem.js
@help
It is a plugin that allows you to move in dot units.

【How to use】
Basically, it can be used just by installing it, but more detailed control is possible by setting the following contents.

■ Setting of movement unit
In the move route script
this.setMoveUnit (Movement unit (decimal between 0 and 1));
By writing, you can specify the movement unit per step.
For example, to move an event half a step
this.setMoveUnit(0.5);
It is described as.

■ Move to any angle in dot units
In the move route script
this.dotMoveByDeg(angle (integer from 0 to 359));
By writing, you can move in the direction of the angle specified in dot units.

■ Move the event in the direction of the player in dot units
In the move route script
this.dotMoveToPlayer();
By writing, you can move the event in the direction of the player in dot units.

■ Move to the specified coordinates
In the move route script
this.moveToTarget(X coordinate, Y coordinate);
You can move it toward the specified coordinates by writing.
※1 If it collides with a wall etc. on the way, the arrival coordinates will shift.
※2 The movement with respect to the specified coordinates is performed with the upper left of the character as the origin.

■ Event contact judgment settings
Annotate the very first event command on the EV page on the first page of the event
Event contact judgment can be set in more detail by describing the following contents in the annotation.
・ Contact range on the horizontal axis
<widthArea: Contact width (decimal number between 0 and 1)>

・ Contact range on the vertical axis
<heightArea: Contact width (decimal number between 0 and 1)>

If you set the event priority below the regular character or above the regular character,
Both the contact range on the horizontal axis and the contact range on the vertical axis are used as the contact range.
When set to the same as a normal character, the contact range on the horizontal axis will be changed when touching upward or downward.
When touching to the left or right, the contact range on the vertical axis is used.

If neither the horizontal axis nor the vertical axis is set, 0.5 will be applied.

■ Event size setting
Annotate the very first event command on the EV page on the first page of the event
You can set the size of the event in more detail by including the following in the annotation.
・ Horizontal size
<width: width (real numbers greater than or equal to 0.5)>

・ Vertical size
<height: height (real numbers greater than or equal to 0.5)>

・ X coordinate display offset
<offsetX: offset (real number)>

・ Y coordinate display offset
<offsetY: offset (real number)>

For example, to set a 96 * 96 size character with width: 2 and height: 2, it will be as follows.
When displaying a character larger than 48 * 48, the display start position is different from the actual XY coordinates.
You need to adjust the display offset.
<width: 2>
<height: 2>
<offsetX: 0.5>
<offsetY: 1>

■ Setting the event slide length
When the character collides with the corner of the wall, it will move to the side where there is no corner.
If the character size is less than 1, half the size is applied to the slide width, and 0.5 is applied if it is 1 or more.

Also, after annotating the very first event command on the EV page on the first page of the event,
you can set the slide width of the event in more detail by writing the following content in the annotation.
・X axis slide length
<slideLengthX: Width (0 or more real number>

・Y axis slide length
<slideLengthY: Vertical width (0 or more real number)>

■ Change character size/display offset/slide width from script
By describing the following script in the movement route script
Character size/display offset/slide width can be changed.

・Horizontal size change
this.setWidth(width value);

・Vertical size change
this.setHeight(height value);

・Change the X coordinate display offset
this.setOffsetX(offset value);

・Change Y coordinate display offset
this.setOffsetY(offset value);

・Change the slide width in the X-axis direction
this.setSlideLengthX(slide width value);

・Change the slide width in the Y-axis direction
this.setSlideLengthY(slide width value);

・Change the contact range of the horizontal axis
this.setWidthArea(contact width value);

・Change the contact range of the vertical axis
this.setHeightArea(contact width value);

■ Other functions that can be used in scripts
Game_CharacterBase#isMoved()
Gets whether the character has moved into that frame.

Game_CharacterBase#calcFar(targetCharacter)
Gets the distance between the characters. The origin of the distance calculation uses the center point.

Game_CharacterBase#calcDeg(targetCharacter)
Gets the angle to the target character. The origin of the angle calculation uses the center point.

Game_CharacterBase#moveByDirection(direction)
Moves in the direction of the character direction in the movement unit specified by setMoveUnit.

Game_CharacterBase#stopMove()
Stop character movement. If you move the character while stopped, it will automatically resume movement.

Game_CharacterBase#resumeMove()
Resume the movement of the character.

Game_CharacterBase#cancelMove()
Cancels the movement of the character to a specific point by moveToTarget etc.

Game_CharacterBase#checkCharacter(character)
Checks if it collides with the character specified by the argument, and if it collides, returns a CollisionResult object.

Game_CharacterBase#checkHitCharacters(targetCharacterClass)
Checks for collisions with all characters that match the character class specified
by targetCharacterClass, and returns an array of CollisionResult objects.

【License】
This plugin is available under the terms of the MIT license.

スポンサードリンク

-MZ plugins

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