Skip to main content

What your team gets

  • One loot table at a time (pick it from a menu): every drop with its weight, quantity and rarity.
  • The real numbers: chance per roll (weight divided by the table’s total weight) and chance per kill or open (with the table’s number of rolls).
  • A pie chart of the table. Edit weights in place and save.
  • Your agent changes drops by asking (“halve the Moonfang chance from wolves”, “make the Ember Staff a 2% drop from the boss chest”).

Ask your agent

Loot table editor. Your agent builds, seeds and checks the app.

The manifest

Seed the data

One apps.write_data call writes every starter row in one revision. "as": "seed" marks the rows as the team’s, with no author.
Each table’s weights add up to 100 here, so a weight is the chance per roll in percent. That is not required: chances always come from the total.

An agent edit: “halve the Moonfang chance from wolves”

Read the drops with apps.read_data:
In the answer, wolf-moonfang has "weight": 1 and a revision, here 1. Halve the weight with apps.write_data:
The Moonfang chance per wolf goes from 1% to about 0.5% (0.5 of 99.5). A conflict means someone changed the drop: read again and retry. For an exact chance, call the app’s tool while the person has it open: apps.call with { "tool": "set_chance", "input": { "drop": "chest-staff", "percent": 2 } }.

Check the look

After every publish:
  • apps.screenshot { "appId": "<app id>" }
  • apps.screenshot { "appId": "<app id>", "width": 390 }
  • apps.screenshot { "appId": "<app id>", "theme": "dark" }
  • apps.screenshot { "appId": "<app id>", "params": { "table": "boss-chest" } } if the app opens a table from launch params.
Check the chances by hand once: a wolf drops Wolf Pelt 60% per kill, and the boss chest (3 rolls) drops the Ember Staff 48.8% per open.

What it uses

SDK: summer.ready (its params for the starting table); summer.data.collection("tables") and summer.data.collection("drops") with .list(), .get(), .patch() and .subscribe(); summer.data.commands() to save table edits in one revision; summer.agent.tool("set_chance"); summer.page.declare() with a choice field for the table. Kit: summer-page; summer-section with summer-select in slot="aside" to pick the table; summer-stats and summer-stat (drops, rolls, the rarest drop’s chance per kill); summer-table (row-key="id", sortable; an editable weight column with format: "number"; chance columns with format: "percent" and digits: 1, which take a fraction from 0 to 1); summer-chart (kind="pie", x="item", y ["weight"]); summer-save-bar; summer-dialog with summer-form to add a drop. The chances, and the weight for an exact chance: