Loot — Samples¶
Runnable examples for the Loot system.
Scene¶
Scenes/00_Loot_Quickstart — open it and press Play. It carries a LootService, a recipient, and both teaching panels already wired to the example tables. No adapters are bound on the service, which is deliberate: it is what makes the delivery half of the scene show a real failure rather than a rehearsed success.
See Scenes/ for the scene index, and the scene's own README for what is in it and what to look for.
Example tables¶
| Table | Mode | Teaches |
|---|---|---|
Tables/Chest_Weighted | Weighted | 2–3 picks per pull, mostly nothing, occasional potions and gold, a rare blade. |
Tables/Purse_IndependentChance | IndependentChance | Gold every time, gems one pull in ten. |
The chest's weights deliberately do not total 100. Weights are relative — 60/30/12/8 behaves identically to any other set in the same proportions — and a table that happens to sum to 100 reads as percentages and teaches the wrong thing.
What works without other systems¶
Rolling works on its own: open the scene with only Loot installed and the roll panel still samples the tables and reports real rates.
Delivery needs partners. The item entries use placeholder GUIDs (sample-potion, sample-blade) that resolve to nothing unless you point them at real items in your own database, and currency entries need Currency installed and an adapter bound. That is why the delivery panel reports which adapters are bound rather than leaving you to work out why nothing arrived.
Worth knowing while you read the roll panel's output: a placeholder id rolls exactly like a real one. LootRoller refuses only a blank id, so sample-potion appears in every sample at its authored rate and looks entirely healthy. The first thing that consults an item database is the inventory adapter, at delivery — which is why sampling checks the table and only granting checks the ids.
Notes¶
- Compiles only when both
REV_SAMPLES_PRESENTandREV_LOOT_PRESENTare defined. - Moving this folder out of
Assets/RevFrameworkclearsREV_SAMPLES_PRESENTand compiles the samples out entirely, which is the supported way to strip them from a build. - The scene is generated rather than hand-authored, by a dev-only builder under
Editor/Internal, so it can be rebuilt if the panels or the service change shape.