Skip to content

Drop Dice 1.0.0

Latest

Choose a tag to compare

@jburneko jburneko released this 10 Sep 01:48

First public release.

Added

Drop zones. A drop zone is an ordinary Scene Region carrying the module's Dice Drop Zone
behavior, so it can be any polygon, combine several shapes, and have holes punched in it. Dice
settle inside the shape without overlapping and avoid the holes.

Dice that stay put. Rolled dice land in random, non-overlapping spots, persist across
reloads, and can be moved, turned, re-valued, or removed afterward. A die whose value was
changed by hand is marked, shows what it originally rolled, and offers to revert.

Rolling. A roll dialog builds a pool of any combination of d4 through d100. Dice have a
physical size from 5mm to 25mm, measured against the scene's own grid at 25.4mm per square, so
they keep their real-world size on any scene. Rolls can optionally be posted to chat.

Handling dice on the table. Drag to move, Ctrl or Shift with the
scroll wheel to turn in 15° or 45° steps, Delete to remove the hovered die, and a
per-die menu to turn, straighten, set a face, reroll, revert, or remove.

Permissions. Three modes: Gamemaster only, everyone sharing all dice, or everyone but only
their own dice. Every change routes through the active GM over a socket and is chained per
region, which is what keeps non-overlap holding under concurrent rolls.

Colours. Per-user, per-die-type body and number colours, defaulting to the roller's own
player colour. A user's choices are theirs alone.

Dice So Nice integration. Throws animate in 3D and the dice are placed only once the
animation has finished, on every connected client. A die with no colour chosen takes the
appearance Dice So Nice would give it — colours, outline, edge, font, texture, and material —
and keeps the look it was thrown with. Colours chosen in Dice Colours are pushed onto the 3D
dice, so what tumbles matches what lands.

Dice Textures setting. Draws Dice So Nice textures always, never, or only while Dice So
Nice is active, which is the default. A texture that reads well on a large screen can crowd a
small numeral, and textures outlive the module that brought them. A per-browser preference.

A public API on game.modules.get("drop-dice").api, documented in the README:

  • rollDice performs a whole throw in one call — evaluating the roll, colouring the 3D dice to
    match what will land, posting to chat, and placing once the animation has played out. One
    throw may carry several looks, matched to the roll's terms.
  • addDice, moveDie, rotateDie, setDieValue, removeDice, and clearZone operate on a
    zone's dice, and every one answers with a result rather than throwing or going quiet — a
    relayed request resolves with what actually happened on the GM's client.
  • The dropDiceChanged hook fires on every client that can see a zone, reporting dice however
    they got there.
  • Zone queries, size helpers that measure against a named scene, colour helpers, and a
    renderer interface for supplying a custom die appearance.

Procedural dice. Dice are drawn from shape and colour rather than from image assets, behind
a renderer interface, so the module ships no artwork and a custom appearance can be registered.