camera

Reads or moves the camera, in explore or combat mode. action:

  • read (the default): returns what it is following, its focus and how far that is from what it follows (focusOffset), its position, facingDegrees and pitchDegrees, whether it is tactical, zoom (1 close in, -1 the tactical view) and zoomSetting, the zoom it is easing toward. Its projection is what the last frame was drawn with, for drawing the same frame elsewhere: fovDegrees (vertical), aspect (width over height, as used), near and far in metres, the view’s width and height in pixels, and Direct3D’s row-major matrix. While another plugin’s free view flies (flycam mode), read gives only the projection.
  • face: turns it at once so that target or point is straight ahead, beyond the focus, for a screenshot that shows it. With tilt true it tilts as well, so the target is in the middle of the picture: use it for something above or below, such as the sky. A creature’s point is at its feet, so one standing near is looked down on.
  • follow: makes it follow target and jump there at once, as selecting a party member does (nothing gets selected). Use it to look at a creature elsewhere, or to centre the tactical view on one.
  • turn: turns it to facingDegrees, tilts it to pitchDegrees, or both. The tactical view keeps its own pitch of -45 degrees, so tilt close in.
  • behind: turns it to look the way target faces, from behind it, as the game’s own camera reset does. Default: what it follows.
  • zoom: sets zoom as the mouse wheel does: -1 is the tactical view, high above, and 0.5 (farthest) to 1 (closest) the close view. The game has no view between them. The camera eases there within about a second. In the tactical view the game pans the camera while the mouse is at the picture’s edge or off it, so the party drifts to a corner (focusOffset grows): first hold the cursor inside the picture with pointer (a pixel near the middle), then follow a creature to centre on it.

Every action returns the camera as read does. A turn or tilt shows from the next frame, so take the screenshot after this call; after zoom, read until zoom has arrived. A mod that smooths camera moves treats a move from here as the player’s and stops its own.

Arguments

Name Type Required What
action "read" | "face" | "follow" | "turn" | "behind" | "zoom"   What to do. Default read.
target any   With face, follow or behind: the creature or object, by id.
point any   With face: a world point, {x, y, z} or [x, y, z].
tilt boolean   With face: also tilt, so the target is in the middle of the picture and not only ahead. Default false: the tilt stays as it is.
facingDegrees number   With turn: the way the camera looks, measured as a creature’s facingDegrees, so a creature’s turns the camera the way it looks: 0 along -y, -90 along +x, 90 along -x, 180 along +y.
pitchDegrees number   With turn: -90 to 90. 0 is level, up positive, -90 straight down. Close in, the game keeps it between -60 and 60.
zoom number   With zoom: -1 for the tactical view, or 0.5 (farthest) to 1 (closest) for the close view.

Call it as camera over MCP, or POST /api/tool/camera with the arguments as JSON.