Skip to content

Releases: Obsidian-TTRPG-Community/Randomness

Randomness 1.15.0

Choose a tag to compare

@github-actions github-actions released this 17 Aug 11:21

Added

  • |sep: — choose what goes between multiple results. A roll that
    returns several things has always joined them with , , which is
    right inside a sentence and wrong everywhere else. |sep: sets the
    glue: `rdm:3#monster|sep:<br>|link` puts one monster per line,
    `rdm:3#monster|sep:<br>• |link` bullets them, and
    `rdm:3[[Rumours|line]]|sep: /\_` runs them together with
    slashes. It works on every multi-result inline roll — tag rolls,
    table rolls, line and block rolls — and under the dice: prefix.

    Everything after sep: is the separator, spaces and HTML included.
    Escapes cover what the surrounding syntax would eat: \n newline,
    \t tab, \_ space (needed at the end of a glue, since an inline
    span reaches the parser trimmed — sep: / joins with " /", and
    sep: /\_ is the one that gives /), \\ backslash. On a wikilink roll
    sep: goes outside the brackets — inside them a pipe already means
    "column pick" — and on a tag roll it is a segment like unique, so
    it comes before prop:, which still swallows the rest of the line.
    Separator text is never evaluated, so a glue containing [@table]
    prints as itself. Thanks to Gizmo734 for the request.

Fixed

  • dice:*|folder=… rolls instead of silently doing nothing useful.
    The tagless * source — "any note matching these properties", with
    no tag constraint — never reached the tag-roll branch under the
    dice: prefix. It fell through to the formula translator and came
    out as the nonsense expression {*|folder=Bestiary|link}: no error,
    no roll, nothing to indicate the syntax was fine and the plumbing
    wasn't. The reference has claimed since these filters landed that
    they work under the compatibility prefix, so this was a documented
    feature that had never run. * now dispatches exactly like #tag,
    including the repetition prefix, |unique, and prop: templates,
    and a test pins the two prefixes to the same note on the same seed.

  • Documentation: [@N table] was described as joining results with
    blank lines.
    It doesn't, and shouldn't — a repeated sub-table call
    runs its results straight together, because it is nearly always
    embedded in a sentence (The party of [@4 hero] sets out.) where an
    injected blank line would be wrong. The separator is the author's
    call, via >> implode: bare for , , or \n / \n\n / <br> /
    ;\_ for anything else. The reference's "Call variations",
    "Filters" and "Repetitions" sections now say so, with a new note on
    the one place separation is automatic — a whole-file MaxReps:
    roll, whose reps are standalone blocks and so are blank-line
    separated. Behaviour is unchanged; the corpus tests now pin every
    one of these joins so the docs can't drift again.

    Two smaller errors went with it: a filter's glue is trimmed and
    never quoted, so the documented implode ", " would have put the
    quote marks in the result and implode , loses its trailing space.
    Both examples are corrected, and \_ is documented as the way to
    end a glue with a space. Thanks to claudermilk for the report.

Randomness 1.14.0

Choose a tag to compare

@github-actions github-actions released this 13 Aug 22:18

Changed

  • A bare dice formula in an rdm: span now rolls. `rdm:2d10`
    used to render the literal text "2d10" — no roll, no error, nothing
    to suggest anything was wrong. It was the trap waiting for anyone
    converting dice: spans, where the formula is the whole
    expression. An inline call that is nothing but a dice formula is now
    treated as `rdm:{2d10}`, and an omitted die count is filled in
    (`rdm:d20`) for the same reason.

    The test is deliberately narrow: the whole expression must be a
    formula, so `rdm:you take 2d6` is still literal text, and no
    expression containing generator syntax ([@table], {…}, #tag,
    |) can match. Bracing is native, so `rdm:3d6>=10` means what
    `rdm:{3d6>=10}` means — 1 when the total reaches 10 — rather
    than the success-counting a dice: span would read it as. Thanks to
    Anna_B_Meyer for walking into it.

Randomness 1.13.0

Choose a tag to compare

@github-actions github-actions released this 12 Aug 23:03

Added

  • A "Show dice formula" setting. Inline rolls can now show what
    was rolled next to the result — 2d6+3 → 11 instead of a bare 11
    — without adding a flag to every call. Settings → Randomness → Show
    dice formula, off by default. It covers both prefixes, so
    `rdm:{2d6+3}` and `dice:2d6+3` read the same (the {…}
    wrapper is dropped from the display), and it only touches rolls that
    actually rolled dice, so `rdm:[@Weather]` is unaffected. A
    dice: span still overrides it per roll: |form shows the formula
    with the setting off, |noform hides it with the setting on, and
    |text(label) wins over both. The formula is display only — locking
    a roll commits the result, as before. |noform had been accepted
    and ignored until now. Thanks to Anna_B_Meyer for the request.

Randomness 1.12.0

Choose a tag to compare

@github-actions github-actions released this 12 Aug 22:37

Added

  • Roll more than one note at a time. Tag and folder rolls take the
    same repetition prefix the [[Note|line]] rolls have always had —
    `rdm:3#monster|link` or `rdm:{1d4}#rumour` — and the new
    |unique segment draws them as a deck so no note comes up twice:
    `rdm:3#monster|unique|link` is three different monsters.
    Comma-joined, works with prop: templates
    (`rdm:3*|folder=Bestiary|unique|prop:{{name}} (CR {{cr}})`), and
    passes through the dice: prefix. |unique has to come before
    prop:, which swallows the rest of the line. Asking a unique roll for
    more notes than match gives you all of them rather than an error.
    Thanks to Gizmo734 for the suggestion.

Randomness 1.11.0

Choose a tag to compare

@github-actions github-actions released this 12 Aug 11:43

Added

  • api.rollFormula() and api.formulas() — saved dice formulas are
    now reachable from scripts.
    Formula aliases (Settings → Randomness
    → Dice formula aliases, and the dice tray's ★ button) resolved only
    for inline dice: spans and the tray, so a Templater / Meta Bind /
    QuickAdd script had no way to invoke one — the reported case was an
    initiative button that rolls exploding step dice and writes the
    result to a monster note's frontmatter. api.rollFormula("sneak")
    now rolls the saved alias (matched trimmed and case-insensitively,
    exactly as inline), and any unmatched string is rolled as a raw
    formula in the full Dice Roller grammar — modifiers, special dice,
    [[Note^id]] table rolls, #tag rolls. api.formulas() lists the
    saved aliases. roll(), rollUnscoped() and rollExpression() are
    unchanged: they still do not resolve aliases, so an expression
    sharing a name with one keeps its existing meaning. API version
    1.2.0 → 1.3.0 (additive).
  • Print a rolled note's properties, not just a link to it. Tag and
    folder rolls could always filter on frontmatter
    (rdm:*|folder=Bestiary|cr=3|link); now they can output it. End the
    call with prop: and the rest is a template:
    `rdm:*|folder=Bestiary|prop:{{link}} — CR {{cr}}, {{hp}} HP`
    [[Bestiary/Bog Hag|Bog Hag]] — CR 3, 45 HP. One note is rolled and
    the whole template is filled from it, so the values can never belong
    to different monsters the way two separate `rdm:` spans would.
    prop:cr is shorthand for prop:{{cr}}. {{link}}, {{linkpath}},
    {{path}} and {{name}} describe the note itself; every other
    placeholder is a frontmatter key, and naming one also requires it, so
    a note missing that property is never picked. Works under the dice:
    prefix too.
  • api.randomNote() now returns the note's frontmatter, so
    Templater and dataviewjs callers don't need a second metadataCache
    lookup. API version 1.3.0 → 1.4.0 (additive).

Randomness 1.10.0

Choose a tag to compare

@github-actions github-actions released this 07 Aug 22:04

Added

  • count(Table) inside {...} — how many items a table has.
    Mostly useful for rolling an index that stays valid as a table
    grows: {1d{count(npcs)}} instead of hard-coding 1d3 and
    forgetting to update it when you add a row. The argument is a table
    name rather than a value, so dotted column names
    (count(npcs.Job)), quoted names with spaces, and interpolated
    names (count({$whichTable})) all work. It counts items, so a
    lookup table with two range rows counts 2, not the span of its dice
    formula; counting a table that doesn't exist is an error, the same
    as rolling one.

Documentation

  • How to pull several columns from the same rolled row. Each
    column of a markdown table is its own rollable table, so
    [@npcs.Job] and [@npcs.Name] land on different people — which
    looks like a bug the first time you write a sentence with two of
    them in it. The fix is to roll the row number once and pick by
    index: The [#{row=1d{count(npcs)}} npcs.Job] was [#{$row} npcs.Secret]. Written up in the reference (Rolling on note
    content → One row, several columns
    ) and in guide note 02, along
    with the reason it can't be split across two `rdm:` spans:
    every inline span is evaluated on its own, so variables don't carry
    from one to the next.
  • The [#table] current-index form — pick the item at the position
    of the item currently being rendered, for cross-indexing parallel
    tables — is now in the call-variations table, and the function list
    (if, max, min, round, substr, …) is documented at all.

Randomness 1.9.2

Choose a tag to compare

@github-actions github-actions released this 04 Aug 22:04

Fixed

  • The dice animation now shows the total when a roll has a
    modifier.
    The graphical dice overlay only drew its = total line
    when a roll had more than one die, so a single die plus a modifier —
    1d20 + 5, 1d6 - 3 — animated the die and showed nothing else.
    The die face was the only number on screen, which read as "the
    modifier was ignored"; the roll itself was always correct, and the
    dice tray's result panel had the right number the whole time. The
    total is now shown whenever it says something the faces don't: more
    than one die, or a flat modifier or dropped die that makes the total
    differ from the dice on screen. A plain 1d20 still animates
    without a redundant total. Thanks to Anna_B_Meyer for the report.

Randomness 1.9.1

Choose a tag to compare

@github-actions github-actions released this 02 Aug 01:48

Added

  • names.rdm in the Fantasy Hub bundle — a much larger NPC name
    pool.
    Dictionary tables keyed by race_gender
    ([#elf_female TF-PersonName], or rollUnscoped("TF-PersonName", { dictKey: "elf_female" })), plus TF-FirstName and TF-Surname
    for the halves. Surnames blend a curated list with a
    prefix + suffix compound table, giving roughly 16,000–47,000 full
    names per race/gender bucket instead of a few hundred. Covers human,
    elf, half-elf, half-orc, gnome and goblin; half-elves draw from both
    parent cultures. Town Forge's place templates use it to keep every
    NPC in a settlement distinct.

Changed

  • Bigger built-in portrait name tables. The names behind
    api.portraits.roll() came from lists of 9–15 entries per race, so
    a town full of NPCs would occasionally hand out the same name twice
    (human males had only 210 possible full names). Each list is now
    32–48 entries — human is 48 × 48 — cutting the chance of a repeat
    across a 40-NPC town from roughly 36% to 4%. This is the fallback
    path now that the Fantasy Hub ships names.rdm.
  • Fantasy Hub Personality grown from 21 to 61 beats, so
    characters stop sharing a personality line two or three times per
    generated town.

Randomness 1.9.0

Choose a tag to compare

@github-actions github-actions released this 25 Jul 00:57

Added

  • Reroll button on randomness codeblocks. Fenced ```randomness
    rollers now render a Reroll button beside their prompt controls, so
    an NPC or table roller embedded in a note can be re-rolled in place —
    the same affordance the .rdm file view and inline calls already
    had. Prompt selections are preserved across rerolls, and the button
    forces a fresh roll even when Stable codeblock seeds is on (the
    new result then persists across passive re-renders until the next
    reroll).

Randomness 1.8.0

Choose a tag to compare

@github-actions github-actions released this 22 Jul 11:50

Changed

  • Tag and property |link rolls now show the note's name, not its
    full path.
    `rdm:#tag|link` and property/folder variants like
    `rdm:*|spelllevel=1st|link` render the wikilink as the note's
    name — Burning Hands rather than Spells/Level 1/Burning Hands
    while still linking to the correct note wherever it lives in the
    vault. This is the new default for every |link roll.

Added

  • |linkpath flag for link rolls that keeps the full vault path
    visible, for anyone who preferred the previous display. Works under
    the dice: compatibility prefix too (`dice:#tag|linkpath`).