Plugin Commands
RPG Maker MZ adds a new UI for plugin commands. MV3D-style plugin commands can still be used using the "Legacy Command" plugin command.
With a few exceptions, the commands are largely the same as in MV3D. The main difference is that the mv3d
prefix is omitted.
Most of the information on this page assumes you are using the legacy command format.
Some commands (like lamp and flashlight) act on a character. By default the target character will be the current event. You can define your own target by providing a target string. A target string is the "@" character followed by an identifier. The target string should be provided as the first word in the command.
Example:@target rest of the command
Valid targets:
- @p or @player - targets $gamePlayer
- @e0, @s, or target string omitted - targets the current event
- @e1, @e2, @e3, @e25 etc - targets event with specified id
- @f0, @f1, @f2 - targets first, second, third follower, etc.
- @v0, @v1, @v2 - targets boat, ship, airship
Many commands can take a time parameter at the end. The time parameter is in seconds. If omitted, the time parameter defaults to 1 second.
Some numeric parameters can be prefixed with + to be set relative to the current value.
Example:camera yaw +45
Camera Commands
The Camera Pitch, Yaw, and Roll commands rotate the camera around the camera target.
The Camera Dist command sets the distance from the camera target.
The Camera Height command sets a height offset from the camera target.
The Camera Zoom command alters the FOV to zoom in or out.
The Camera Pan command offsets the x and y position from the camera target.
The following camera commands can have the word "camera" omitted and still work as a command.
camera pitch n t
camera yaw n t
camera roll n t
camera dist n t
camera height n t
camera zoom n t
camera pan x y t
The Camera Target command sets the camera target to a character. The camera will move with the camera target.
camera target @t t
The Camera Track command sets the camera to track a character, automatically rotating the camera to face the character.
Typically you will want to use this in conjunction with the Camera Target command to move the camera away from the player, then track the player.
There are additional "Track Pitch" and "Track Yaw" commands which track only the pitch and yaw respectively.
camera track @t t
camera track pitch @t t
camera track yaw @t t
camera track off
The Camera Mode command sets the camera mode between perspective, orthographic, and 2D. Only the first letter is required, so "p", "o", and "2" are possible values. (2D mode is a false 2D projection, and is different from disabling the 3D rendering.)
camera mode p/o/2d
Light Commands
The Light command (and its alias the Ambient command) sets the ambient light color. When combined with a sunlight source, the ambient light will appear to be the color in shadowed areas.
The color parameter can be a hex color, named color, or any other valid css color.
light color t
ambient color t
The Lamp commands set up a point light on the target event and changes properties of that light.
@t lamp color color t
@t lamp intensity n t
@t lamp dist n t
@t lamp color intensity dist t
The Flashlight commands set up a spot light on the target event and changes properties of that light. In addition to the same properties as the lamp, the flashlight has angle, pitch, and yaw properties. Angle is the angle of the light cone in degrees, and pitch and yaw are the direction the light is pointing.
@t flashlight color color t
@t flashlight intensity n t
@t flashlight dist n t
@t flashlight angle n t
@t flashlight pitch n t
@t flashlight yaw n t
@t flashlight color intensity dist angle t
The Sun commands set up a directional light to act as a sunlight source and changes properties of that light. The sun will create dynamic shadows.
sun color color t
sun yaw n t
sun pitch n t
sun angle yaw pitch t
Animation Command
The Animation command plays an animation at the target event.
Due to the new animation system in RPG Maker MZ, the animation command is slightly different in MZ3D. In addition to the depth and scale parameters supported by MV3D, MZ3D also supports the rot and height parameters.
- Depth controls whether the animation should have depth enabled. If false, animations are drawn over everything else.
- Scale is a scaling factor for the animation.
- Rot is the rotation of the animation in degrees.
- Height is a height offset for the animation's position.
@t animation id
@t animation id depth true/false scale n rot n height n
Fog Command
The fog command changes the fog color and density for the map. It has a near distance and a far distance, which are the distances from the camera where the fog starts and ends. To control the alpha fog, see the Set Command.
fog color color t
fog near n t
fog far n t
fog dist near far t
fog color near far t
Resolution Scale Command
The Resolution Scale command changes the size of the 3D canvas relative to the game canvas. This can be used to create a pixellated effect. The scale should be between 0 and 1.
resolution scale n t
Configure Command
The configure command can change the configurations of a character. You should provide a list of configuration functions as the parameter. For more information the configuration functions you can use, see Event Configuration Functions.
@t configure functions t
Skybox and Skyball Commands
Skybox Command
The Skybox command will set up a cube-shaped mesh to represent the sky. The skybox takes six textures, one for each face.
A layer parameter can be provided after to set up multiple skyboxes. The layer parameter is always optional and defaults to 0. Higher layers will be drawn over lower layers.
The time parameter will fade the skybox in or out, but cannot fade between different textures. To fade between textures you need to use multiple skybox layers.
If an image is provided without a side name, it will be used as the default image and will be used for any sides without an image.
Texutres are pulled from the img/parallaxes folder.
The word "clear" can be used to mean a blank texture.
The autorotate parameters can be used to make the skybox rotate automatically.
skybox clear
skybox clear layer
skybox layer alpha n t
skybox layer img t
skybox layer img top img bottom img t
skybox layer north img south img east img west img top img bottom img t
skybox layer autorotate yaw n
skybox layer autorotate pitch n
skybox layer autorotate roll n
skybox layer autorotate yaw pitch roll
Skyball Command
The Skyball command will set up a sphere-shaped mesh to represent the sky. The skyball takes only one texture which is wrapped around the sphere.
Like skyboxes, skyballs can also be layered. Skyballs are always drawn in front of skyboxes.
Also like skyboxes, skyballs can be automatically rotated with the autorotate parameters.
Skyballs have an additional "repeat" parameter which can make the texture repeat a certain number of times around the sphere.
skyball clear
skyball clear layer
skyball layer alpha n t
skyball layer img t
skyball layer img repeat n t
skyball layer autorotate yaw n
skyball layer autorotate pitch n
skyball layer autorotate roll n
skyball layer img repeat n autorotate yaw pitch roll t
Action Command
The Action command plays or stops an action (animation) on the target character with an imported gltf model.
The wait, loop, and important keywords can be provided at the end of the command to modify the behavior.
- Loop will cause the action to loop.
- Important will prevent the action from being interrupted by changing state.
- Wait will cause the interpreter to wait until the action is finished before continuing.
@t action play name
@t action play name wait
@t action play name loop
@t action play name important
@t action play name loop important
@t action stop name
Set Command
Changes a setting. Some of the settings changeable using this command also appear in the plugin parameters. For those settings, the same syntax is used as in the plugin parameters.
Settings changed with this command are saved in the save file.
set setting value
Valid Settings:
- lockCamera
- Locks the camera in place. true or false
- allowRotation
- Allows the camera to rotate side to side. true or false
- allowPitch
- Allows the camera to pitch up and down. true or false
- diagonalMovement
- Changes the way diagonal movement works. Can be Off, Diagonal Basic, Diagonal Basic 3D, Diagonal Smart, or Diagonal Smart 3D
3D modes mean diagonal movement only allowed when 3D mode is enabled. - turnIncrement
- How many degrees the camera turns when turning. 0 to 360
- turnSpeed
- How fast the camera turns in degrees per second.
- instantMovement
- When true, the player moves instantly to the new position. true or false Doesn't work propertly with 3D models
- inputCameraMouse
- When true, the camera can be controlled with the mouse. true or false
- inputCameraGamepad
- When true, the camera can be controlled with a gamepad. true or false
- cameraCollision
- Allows the camera to collide with objects. Can be Off, Type1, Type2, Type1 Smoothed, or Type2 Smoothed
Type2 allows objects to be between the camera and player, Type1 does not. Smoothed will smooth the camera position when colliding. - airshipHeight
- How high the airship flies.
- allowGlide
- If true, collision detection for flying characters will only use the current elevation and not target elevation. true or false
- animationDepth
- Whether animations should have depth enabled. If false, animations are drawn over everything else. true or false
- alphaFog
- Blends the 3D environment into the parallax background with an alpha fog effect. 0 to disable, 1 for full effect.
- glowIntensity
- Intensity of the glow effect. 0 or higher
- glowRadius
- Radius of the glow effect. 0 or higher
- glowThroughWalls
- When true, the glow effect will be visible through walls. true or false
- highlight
- Controls the mode for the highlight effect. Can be Off, Inner, Outer, or On
- highlightRadius
- Radius of the highlight effect. 0 or higher
- highlightThroughWalls
- When true, the highlight effect will be visible through walls. true or false
- chromaticAberration
- Intensity of the chromatic aberration effect. 0 or higher
- chromaticAberrationAngle
- Angle of the chromatic aberration effect. 0 to 360
- aperture
- Larger values cause more blur away from the focus distance.
- blurStrength
- Strength of the blur effect. 0 or higher
- focusDistance
- Distance at which the camera is focused. center focuses on the center of the screen. mouse focuses on the mouse position. auto will set focus to camera distance, or center of screen if in 1st person. Using a number will fix the focus distance at that value.
- bloom
- Intensity of the bloom effect. 0 or higher
- bloomThreshold
- Threshold for the bloom effect. 0 to 1
- bloomRadius
- Radius of the bloom effect. 0 or higher
The Enable and Disable commands enable or disable the 3D rendering. When disabled, the 3D rendering will be hidden and the game will behave as if the plugin is not installed.
enable
disable
It was intended that you be able to provide a fade type with the enable or disable command, but this isn't working due to a bug.
enable 0
disable 1
Instead, you can use a script call to accomplish the same thing.
mz3d.enable(0);
mz3d.disable(1);
Fade mode 0 is fade to black and fade mode 1 is fade to white.
Script Call
To run a plugin command using javascript, you can use mz3d.command
.
You can pass the parameters as separate arguments into the function as well.
var id=1, depth=true, scale=1;
mz3d.command("@p animation", id, "depth", depth, "scale", scale);