Material picker
Updated 2026-11-27
Some recipes take one of several materials for the same slot, and the material changes the item: a rifle stock of Cypress fires faster, one of Redwood lasts twice as long.
The material picker lets readers try that on the item’s page. They pick a material, the page shows what it changes, and the link they share opens with the same pick.
The examples follow a rifle whose recipe takes Heartwood, Cypress or Redwood for its stock.
What it does



What it reads
Everything comes from your own data, nothing is typed into the block by hand. It needs two things for each item:
In the example both come from an Items table. Each item has recipe_cards, one card per recipe, and a card with a material slot carries the list in its choice_icons field, one entry per material:
{
"title": "Cypress\n+15% Rate Of Fire · +15% Reload Speed · -15% Aim Time",
"icon": "CypressLumber_icon.png",
"href": "/items/cypress"
}The bonuses are read from that second line, the way a player reads it: a sign, an amount, an optional %, and the stat. Separate them with “·” or “;”.
A bonus finds its stat by its words, in any order, so “Rate Of Fire” changes the stat called “Fire Rate”. Units stay as they are (1.5/s, 60m). A bonus the item has no stat for, such as +15% Reload Speed on a rifle that lists none, still shows as its own line with just the change.
Set it up in the layout editor
This is done once, in the shared layout of the item pages, and then works on every item that has a material slot. See One layout for every entry and Variables and scripts if those are new to you.
- In Variables & Scripts, add a reader input named
material: text, empty by default. Set its Share link name tomaterialso links read?material=cypress. - Add a script that returns the materials of the item, for example from the recipe card shown (below), and one that returns the stats a material can change.
- Select the recipe cards block, open the field that shows the material list, and set Pick into input to
material. The list becomes choices, and the slot that names those materials (“Heartwood / Cypress / Redwood”) opens the picker. - Add an Option stats block (in the Data blocks) under the recipe. Choose the stats script, the materials script, and
materialunder Pick stored in. Give it a title, such as “Stats with this material”. - Optional: a second Option stats block in the item’s summary panel, with Controls switched off. It only follows the pick, so the item’s main stats change too.
Two scripts that do this for an items table like the one above:
-- The materials of this item's recipe slot, from the recipe card shown.
local e = vars.entry or {}
for _, card in ipairs(vars.recipeCards or e.recipe_cards or {}) do
if type(card.choice_icons) == "string" and card.choice_icons ~= "" then
return card.choice_icons
end
end
return ""-- The stats a material can change, before it.
local rows = {}
for _, r in ipairs(vars.tipStats or {}) do
rows[#rows + 1] = { name = r.name, value = r.value }
end
-- plus the durability of the quality the reader picked
local e = vars.entry or {}
for _, r in ipairs(e["quality_" .. (vars.qSel or "common")] or {}) do
if r.name == "Durability" then
rows[#rows + 1] = { name = "Durability", value = tostring(r.quantity):match("^[%d%.]+") }
end
end
return rowsShow the Option stats block only once near the recipe. On a phone the summary panel is at the top of the page and the recipe far below it, so the block under the recipe is the one the reader sees right after picking.
One slot, several items
A recipe slot that takes any one of several items (any meat, any seasoning) can show those items themselves: their real icons, each linking to its own page, instead of a placeholder. Give the slot’s entry an options list, one entry per item, in the same shape as any other icon:
{
"title": "Meat",
"qty": 1,
"options": [
{ "title": "Bear Meat", "icon": "meat_02_icon.png", "href": "/items/bear-meat" },
{ "title": "Bird Meat", "icon": "BirdMeat_icon.png", "href": "/items/bird-meat" },
{ "title": "Bison Meat", "icon": "BisonMeat_icon.png", "href": "/items/bison-meat" }
]
}- Add
optionsto the slot’s entry in your data or script, as above. The other slots stay as they are.alternativesworks as a name too. - Select the recipe cards block, open the icon field of the ingredients (Icon list: All icons with names and links), and choose Slots with several items: One at a time in the slot or All side by side.
A slot without a name of its own is named after its first items (“Bear Meat / Bird Meat / Bison Meat / ...”). The count (qty) belongs to the slot, not to each item.
On a page whose script already renames the slot to “Bear Meat / Bird Meat / ...”, add the list to that slot in the same script: the slot then shows the items, and the picker still opens from it.
Several pickers on one card
Some recipes take several picks: a meat, an optional seasoning and a fuel. Each becomes its own picker on the same card, and one stats block adds them all up.
- In the recipe cards block, add one icon list per picker (for example
choice_icons,choices,choicesF). Give each its own Pick into input (material,optional,optional2) and a label (Required Material, Optional Material, Optional Fuel). - Untick Show this list under the card on those lists if the slots alone should offer the items.
- Give each slot of the ingredients the picker it opens, with
pick(below). Without it a slot still opens the picker whose items it lists or names. - Use one Option stats block. Under Pickers, click Add a second picker and add one row per picker: its options, the input and a button text.
[
{ "title": "Meat", "qty": 1, "pick": "material",
"options": [ { "title": "Bear Meat", "icon": "meat_02_icon.png", "href": "/items/bear-meat" } ] },
{ "title": "Flour", "icon": "Flour_icon.png", "href": "/items/flour", "qty": 1 },
{ "title": "Optional material", "icon": "Slot_White.png", "qty": 1, "pick": "optional" },
{ "title": "Fuel", "icon": "Slot_White.png", "qty": 1, "pick": "optional2" }
]The same setup written as block settings, for an AI assistant or a layout file. The three option lists of the recipe cards block, hidden under the card:
[
{ "display": "icons", "fieldRef": "input_icons", "iconsMode": "flow" },
{ "display": "icons", "fieldRef": "choice_icons", "iconsMode": "flow",
"label": "Required Material", "pickInput": "material", "pickList": "hidden" },
{ "display": "icons", "fieldRef": "choices", "iconsMode": "flow",
"label": "Optional Material", "pickInput": "optional", "pickList": "hidden" },
{ "display": "icons", "fieldRef": "choicesF", "iconsMode": "flow",
"label": "Optional Fuel", "pickInput": "optional2", "pickList": "hidden" }
]And the one Option stats block that follows all three picks:
{
"type": "option-stats",
"attrs": {
"statsVariable": "materialStats",
"groups": [
{ "inputVariable": "material", "optionsVariable": "materialOptions", "label": "Choose required material" },
{ "inputVariable": "optional", "optionsVariable": "optionalOptions", "label": "Choose optional material" },
{ "inputVariable": "optional2", "optionsVariable": "optional2Options", "label": "Choose fuel" }
]
}
}The same layout serves every recipe: meat only, meat with seasoning and fuel, two meats, seasoning only. A picker whose list is empty for an item simply does not appear.
Share a pick with a link
The pick is part of the page address: picking Cypress turns the address into …/items/harrison-repeater?material=cypress. Anyone who opens that link sees the page with Cypress already picked. The name in the link is the material’s name in lower case, with dashes for spaces (bird-meat).
Quality and material together
A quality picker (Common, Uncommon, Rare, Epic) and the material picker work side by side. The quality decides which recipe card is shown and the stats the material starts from; the material is applied on top of them.

Limits, and items without materials
For developers
The block is option-stats; the recipe cards’ icons field takes pickInput; a reader input’s share link name is urlKey. Options are icon entries (title with the name on its first line, icon, href), read and matched in lib/option-picker.ts.
A slot’s options are parsed in lib/repeater-rows.ts and drawn by components/widgets/icon-alt-slot.tsx; the field setting is optionsMode (absent: one at a time, "row": side by side).
Several pickers: every icons field with pickInput is one picker of its card; pickList: "hidden" keeps a list off the card. A slot names its picker with pick. The block takes groups (inputVariable, optionsVariable, label) and applies every pick in that order.
The live scripts of a page re-run only when an input they name changes, so a material pick runs no Lua.