Plugin Commands
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 placed directly after the "mv3d" prefix as the second word in the command.
Example:mv3d @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:mv3d 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.
mv3d camera pitch n t
mv3d camera yaw n t
mv3d camera roll n t
mv3d camera dist n t
mv3d camera height n t
mv3d camera zoom n t
mv3d camera pan x y t
The Camera Target command sets the camera target to a character. The camera will move with the camera target.
mv3d 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.
mv3d camera track @t t
mv3d camera track pitch @t t
mv3d camera track yaw @t t
mv3d 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.)
mv3d 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.
mv3d light color t
mv3d ambient color t
The Lamp commands set up a point light on the target event and changes properties of that light.
mv3d @t lamp color color t
mv3d @t lamp intensity n t
mv3d @t lamp dist n t
mv3d @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.
mv3d @t flashlight color color t
mv3d @t flashlight intensity n t
mv3d @t flashlight dist n t
mv3d @t flashlight angle n t
mv3d @t flashlight pitch n t
mv3d @t flashlight yaw n t
mv3d @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.
mv3d sun color color t
mv3d sun yaw n t
mv3d sun pitch n t
mv3d sun angle yaw pitch t
Animation Command
The Animation command plays an animation at the target event.
Additional parameters can also be provided at the end of the command.
- 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.
mv3d @t animation id
mv3d @t animation id depth true/false scale 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.
mv3d fog color color t
mv3d fog near n t
mv3d fog far n t
mv3d fog dist near far t
mv3d 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.
mv3d 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.
mv3d @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.
mv3d skybox clear
mv3d skybox clear layer
mv3d skybox layer alpha n t
mv3d skybox layer img t
mv3d skybox layer img top img bottom img t
mv3d skybox layer north img south img east img west img top img bottom img t
mv3d skybox layer autorotate yaw n
mv3d skybox layer autorotate pitch n
mv3d skybox layer autorotate roll n
mv3d 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.
mv3d skyball clear
mv3d skyball clear layer
mv3d skyball layer alpha n t
mv3d skyball layer img t
mv3d skyball layer img repeat n t
mv3d skyball layer autorotate yaw n
mv3d skyball layer autorotate pitch n
mv3d skyball layer autorotate roll n
mv3d 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.
mv3d @t action play name
mv3d @t action play name wait
mv3d @t action play name loop
mv3d @t action play name important
mv3d @t action play name loop important
mv3d @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.
mv3d 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.
mv3d enable
mv3d 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.
mv3d enable 0
mv3d disable 1
Instead, you can use a script call to accomplish the same thing.
mv3d.enable(0);
mv3d.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 mv3d.command
.
You should leave out the "mv3d" prefix when running commands this way.
You can pass the parameters as separate arguments into the function as well.
var id=1, depth=true, scale=1;
mv3d.command("@p animation", id, "depth", depth, "scale", scale);