Tile Configuration

Texture Functions

A tile can be configured to have different textures for the top, bottom, and sides.
A special inside texture will be used if the tile has depth configured.
Different texutres can also be used for the north, south, east, and west sides.
If unset, the inside texture will be the same as the side texture, and the side and bottom textures will be the same as the top texture.

Each texture can be set with the respective top(), side(), bottom(), inside(), north(), south(), east(), and west() function. Texture() can be used to set both the top and side texture. at the same time.

A texture is defined using the following list of parameters:


img,x,y,w,h|alpha|glow,glowintensity|anim:animx,animy

The img parameter should be either a tileset image name (A1-5, B, C, D, E) or a custom image name. Custom images are loaded form the img/MV3D folder. Filenames should include the file extension. If the image path starts with a slash, it will be loaded relative to the project root folder instead. Example: texture(/img/tilesets/Inside_B.png)

The x and y parameters can be prefixed with + or - to use relative values (in other parts of the plugin + is required to indicate relative because - means negative, but there are no negative tile coordinates so it's unambiguous here)

The alpha parameter can be used to make the texture partially transparent. Or, you can set alpha to 1 to turn on alpha blending.
Examples: texture(|1), texture(alpha:0.5)

The glow parameter will add an emissive color to make the texture glow in the dark. The effect works well for lava and other things that should emit light.
Examples: texture(||1), texture(glow:red)

A second parameter can be provided to control the intensity of the premium glow effect.


Examples: texture(||1,0), texture(glow:red,1)

Due to a bug the second parameter seems to not work for tile textures... Glow intensity will always be 1.
For now, use the glow function instead if you need to set the glow intensity.

anim is an alias for animx and can be used with a colon to jump to that parameter.
Animx and animy are used for defining custom animated tiles. The number supplied to animx and animy will be the offset used by the animation. The final offset will be equal to the anim offset times the current frame.
Animx has frames 0,1,2,1 (like water animations), while animy has frames 0,1,2 (like waterfall animations).
Examples: texture(|||1,0), texture(anim:0,1)

Ceiling Function

Overrides the ceiling config set for the map for this tile. This only works for bottom layer tiles.

Height Function

The height function, as the name implies will set the height for a tile. Tiles will be stacked on top of tiles layered below them, so if you configure height on both an upper layer and lower layer tile, their heights will be effectively combined.

height(n)

Depth Function

The depth function will set the depth of a tile. Depth is like a negative height, the tile's effective height will be its own height minus its depth. If there is a tile on a layer below the tile with depth, it will "cut a hole" in that tile, reducing that tile's height instead.
The primary use is to create pits, bodies of water, and other holes in the ground. The side texture of the tile will use the "inside" texture for the part of the height caused by the depth.

depth(n)

Fringe Function

The fringe function will add a gap between the tile and the tile below it, effectively making the tile appear to be floating. The player can walk under the tile if the gap is large enough.

fringe(n)

Float Function

The float function will set a distance above the tile that boats and ships should float above the tile. This is useful if you used the depth function to create a body of water and want boats to float near the top of the water instead of at the bottom.

float(n)

Shape Function

The shape function will set the shape of the tile. The shape determines how the tile's mesh will be built and how it will behave.

flat
The default shape. Flat tiles normally appear as a flat plane, but when given height will have walls that use the side texture.
cross
An intersection of two verical planes.
xcross
Same as cross, but angled at 45deg. Essentially a shorthand for shape(cross),rot(45)
8cross
A combination of cross and xcross.
sprite

A special shape that will always face the camera.

Takes a second parameter for dynamic offset.

billboard
Formerly known as the "tree" shape, also named "board" and "cardboard".
A billboard will rotate to match the camera's yaw, but not its pitch.
fence
A shape that will connect to other nearby tiles to create a fence. A second parameter can be provided to set whether it should have fence posts (true by default).
Examples: shape(fence), shape(fence,false)
wall
The wall shape is a flat plane that stands straight up instead of lying on the ground. It's intended for creating wall decorations by using it alongside the rot function and offset functions.
slope
A shape for creating slopes that let the player walk up or down to different elevations. Can be used as ramps or stairs, sloped roofs, or hills. Takes a second parameter which is the slope's height.
Examples: shape(slope), shape(slope,2)
For more information and functionality, see the slope function.

Rotation Functions

There are four rotation functions, yaw, pitch, roll, and rot.

Rot is the simple rotation function, and is usually only used on its own, but when used with the others it is applied last.

Yaw rotates the tile around the z axis, effectively turning it left and right.

Pitch rotates the tile around the x axis, effectively turning it up and down.

Roll rotates the tile around the y axis, effectively tilting it side to side.

yaw(n)
pitch(n)
roll(n)
rot(n)

Offset Functions

There are three offset functions, xoff, yoff, and zoff, which add an offset to the position in the respective dimension. There is also an offset function which can be used to set all three at once.

xoff(n)
yoff(n)
zoff(n)
offset(x,y,z)

Dynamic Offset

The DOff Function controls the tile's "Dynamic Offset". Dynamic offset is the amount the tile will be offset towards the camera. This is usually used for the sprite shape, but other dynamic shapes can be given a dynamic offset as well, such as the board shape or the model or mesh shapes. The default dynamic offset for sprites is settable in the plugin parameters through the "Sprite Dynamic Offset" parameter.

If the value provided to this function includes the letter "p", the dynamic offset will be adjusted according to the camera's pitch. The offset will be zero when the camera pitch is parallel to the ground, and will be the full offset when the camera is looking straight down.

Examples:
doff(0), doff(.45), doff(.45p)

Tile Offset Function

The tile offset function will offset the tile's actual position on the map. This is used by default for star tiles to move them one tile down onto the tile below them.

tileoffset(x,y)

Slope Function

The slope sets the tile shape to slope and configures other slope-related settings.

parameter list:

height,direction|top,side|texrot

The height parameter is the height of the slope. The direction parameter is the direction the slope is facing.
Direction can be n, s, e, w, ne, se, sw, nw.
The diagonal directions can be appended with i or o to indicate they're an inner or outer corner, for example nei or neo.
Direction can also be set up with the shadow pen link to mapping page.
Examples: slope(2,e), slope(2,e), slope(2,swi)

The top and side parameters are the textures used for the top and side of the slope. If these aren't set, it will use the normal top and side textures for the tile.
The texture parameters should be wrapped with {} to group them into a single parameter.
Example: slope(2,top:{A4,0,0},side:{A4,0,1})

The texrot parameter is whether the texture should be rotated to match the slope's direction. For regular tiles this is true by default, but for autotiles it's false.
Example: slope(2||false), slope(2,texrot:true)

Pass Function

The pass function can be used to alter the passability of a tile. Possible values are pass(o) meaning you can walk on the tile, pass(x) meaning you cannot walk on the tile, and pass(*) meaning you can walk through the tile.

Width Function

The width function can be used to set the width of a tile. This can be useful for creating pillars that are thicker or thinner than a normal tile.

width(n)

Slant Function

The slant function can be used to give the walls of the tile a slight angle instead of being perfectly vertical. The exact angle will vary depending on the height of the tile, because the value provided is the extra vertical distance the bottom of the tile will occupy.

width(n)

Shadow Function

Whether the tile should cast shadows, true by default.

shadow(true/false)

Glow Function

The glow parameter will add an emissive color to make the tile glow. The effect works well for lava and other things that should emit light.
It can take a number from 0 to 1 or a color.
Examples: glow(1), glow(red)

If one of the tile's textures has glow configured, the texture settings will take priority.

A second parameter can be provided to control the intensity of the premium glow effect.
Examples: glow(1,0), glow(red,1)

Alpha Function

The alpha parameter can be used to make the tile partially transparent. Or, you can set alpha to 1 to turn on alpha blending.
Examples: alpha(0.5), alpha(1)

If one of the tile's textures has alpha configured, the texture settings will take priority.


Highlight Function

Sets the highlight color for the tile. Set this to black to disable.
To change other highlight settings, use the Set Command.

highlight(color)

Model Function

Imports a 3D model for the tile.

For more information about importing 3D models into MV3D, see Importing Models.

Mesh Function

Constructs a mesh for the tile based on a mesh string.

For more information about mesh strings, see Mesh Building

When using model or mesh, you should use the Scale Function to set the size instead of width and height.