Shop (Buy) (Show Shop Buy)
Category: Character/Party
An event content that opens a shop screen where the player can purchase Items and equipment. Provides UI in a single package for all "buy" scenes: town general stores and armories, quest-reward exchange counters, special trading posts, etc.
Multiple goods in one event content
This event content holds an internal lineup list, so one event content can sell multiple Items / equipment. Each item can be configured individually for stock mode, cost (consumed Parameters), auto-equip, etc. — a flexible design.
Independent stock per store (shop_id)
By identifying stores with Shop ID (shop_id), the same Item can have independent stock per store (e.g., a potion with separate stock managed between the general store in town A and the general store in town B).
Property Structure
Because this event content has a complex structure, we explain it in three layers: "common header," "lineup array," and "cost array."
Common header
| Item | Input format | Description |
|---|---|---|
| Title | Text | Title at the top of the shop window |
| apply_to | Split button | Storage destination for purchases (Party / Character); auto-set when adding content |
| Target | Select | How to specify the purchaser when apply_to=Character (Selected Member / Character ID) |
| Member Index | Select | When Target=Selected Member; 0-based party index |
| Character Key | Text or Select | When Target=Character ID; directly specify character.id ({var} variable reference allowed) |
| Save Unique Variable | Select | Variable to save the unique identifier of the purchased item |
| Shop ID | Text | Store identifier (manages stock independently from other stores) |
Lineup list (Items)
Settings per item:
| Item | Input format | Description |
|---|---|---|
| Kind | Select | Item / Attach (equipment, passive) |
| Item Key | Select | Choose from Item/Attach definitions |
| Count | Number | Quantity gained per purchase |
| Stock Mode | Select | Unlimited / Managed |
| Initial Stock | Number | When Managed; stock on first visit |
| Auto Attach | Checkbox | When Attach + Character; equip simultaneously with purchase |
| On Attach Fail | Select | Behavior on equip failure when Auto Attach (Deny / SkipToPool) |
Cost list (Costs)
Resources consumed per item (multiple can be specified):
| Item | Input format | Description |
|---|---|---|
| Cost Param | Select | Key in parameter.json to consume (e.g., GOLD) |
| Cost Value | Formula | Fixed value or Formula (e.g., 10 / {counter_1} * 5) |
| Use Current Value | Checkbox | ON = consume from current value / OFF = consume from max value |
Property Details
Title
Title displayed at the top of the shop window.
- Translation-ready: If multi-language support is set up in the Translation Tab, the text of this property is also treated as a translation key
Examples: Armory, General Store, Legendary Equipment Workshop
apply_to
Specifies the storage destination for purchases in two choices.
| Option | Behavior |
|---|---|
| Party | Store in party-shared storage, consume from party Parameters (gold, etc.) |
| Character | Store in the selected character's individual storage, consume from the same character's Parameters |
"Payer = Receiver" principle
The storage destination and the consumption source are always on the same side. If buying for the party, consumption is from party gold; if buying individually for a character, consumption is from that character's individual gold.
apply_to is auto-selected when adding content
Choosing one of the two buttons "Shop (buy for Party)" / "Shop (buy for Character)" in the editor's Add Content screen auto-sets apply_to. After placement, the apply_to UI is hidden on the editor.
Target (only when apply_to=Character)
Specifies how to choose the purchasing character.
| Option | Behavior |
|---|---|
| Selected Member | Specify by index within the party |
| Character ID | Directly specify character.id |
Member Index (when Target=Selected Member)
Select a 0-based index within the party.
- "1st" to "nth"
- Out-of-range index (less than party size) → Skip this event content (silent)
Character Key (when Target=Character ID)
Directly specify the character.json key (character.id).
- Direct input: Enter character.id like
MINATO - Variable reference: Specify in the form
{var_name}to resolve the variable value as character.id - Can also be selected via OptionButton
Variable reference for reusing "the NPC we talked to earlier"
By saving character.id as a string via Assign Variable, you can dynamically change the shop target character.
Save Unique Variable
Saves the unique identifier of the most recently purchased item into a variable.
- Variable selection from the dropdown (define in advance in the Variable tab)
- After purchase, can be referenced in subsequent Assign Variable or Conditional Branch
- Nothing is saved if left empty
Useful for processing immediately after purchase
By saving the purchase unique to a variable, you can implement purchase-linked behavior like "show the name of the item just after purchase," "trigger a special event after buying," etc.
Shop ID
Key that identifies the store. Show Shop Buy / Show Shop Sell with the same shop_id share stock.
- Examples:
village_1_shop_1,capital_arms_shop - If left empty, treated as shared stock across all shops
- Items sold at Shop Sell are dynamically added to the Shop Buy list of the same shop_id
Realize independent stock per store
Even for the same "potion," setting different shop_ids for the general store in town A and the one in town B keeps their stock managed independently.
Lineup list (Items)
Array where you can register multiple goods for sale.
Kind
| Option | Behavior |
|---|---|
| Item | Items in item.json (consumables, etc.) |
| Attach | Items in attach.json (weapons, armor, passive skills, etc.) |
Item Key
Select from the keys in item.json or attach.json depending on Kind.
- Supports real-time cross-tab reference updates (2026-09-09)
- Deleted entries are displayed with an Error icon
Count
Specifies the quantity gained per purchase.
- Default: 1
- Example: Setting
3gives you 3 at a time (bulk purchase)
Stock Mode
| Option | Behavior |
|---|---|
| Unlimited | Can be purchased any number of times (stock does not decrease) |
| Managed | Decreases from initial stock; sold out at zero |
Initial Stock (when Managed)
- Default: 0
- Stock set on first visit
- Second visit onward retains the remaining stock from the previous visit (independent per shop_id)
Auto Attach (only when Kind=Attach + apply_to=Character)
Specifies whether to equip to the character simultaneously with purchase.
- ON: Purchase → Automatically equipped on the target character
- OFF: Purchase → Goes into the character's pool (unequipped Attach)
On Attach Fail (when Auto Attach is ON)
Behavior when equipping is not possible (attachable=false, insufficient req_param, etc.).
| Option | Behavior |
|---|---|
| Deny | Purchase itself fails (no resource consumption, no acquisition) |
| SkipToPool | Purchase succeeds but goes into pool instead of being equipped |
PASSIVE Attach is fixed to Deny
Attaches with type=PASSIVE (passive skills) cannot be equipped from the equipment screen, so going into the pool means they can never be equipped and will rot forever. To prevent this, PASSIVE Attach is fixed to On Attach Fail=Deny (even if SkipToPool is selected, Deny behavior is used).
Cost list (Costs)
Array of consumed resources tied to each item. Multiple can be specified, and all costs are consumed simultaneously.
Cost Param
Specify the key in parameter.json.
- Examples:
GOLD(gold),SP(shop points),EXP(experience) - Supports real-time cross-tab reference updates
Cost Value
Specify the amount to consume as a fixed value or Formula.
- Fixed value: Integers directly like
100,500 - Formula:
{counter_1} * 10,USER.LEVEL.MAX * 50, etc. - The formula is evaluated at purchase time (dynamic pricing possible)
Use Current Value
- ON (default): Consumed from current value (normal behavior)
- OFF: Consumed from max value (special use, e.g., permanent max HP reduction)
Dynamic pricing via Formula
You can implement mechanisms like "the higher {quest_phase}, the cheaper" or "price rises every {counter_1} purchases" to change prices based on progress or purchase count.
Runtime Behavior
When this event content runs, the following processing is performed:
1. Resolve apply_to and target character
When apply_to=Character, specify the target character from Target / Member Index / Character Key.
- Resolution success: Open the shop screen
- Resolution failure (no matching character in party, etc.): Output a warning log and advance to the next event content doing nothing
2. Pause all HUD processing
Before opening the shop screen, pause processing of screen effects, images, text, choices, buttons, and function buttons.
3. Merge dynamic lineup
If shop_id is specified, internally read from shop_stock and merge into the lineup list:
- Items that were sold via Shop Sell and flowed into the same shop_id
- Remaining count that was consumed in Managed stock mode
4. Display the shop screen
Display the title, lineup, and each item's price / stock. The player can:
- Buy: Select an item, pay the cost, and obtain it
- Cancel: Close the shop and advance to the next event content
5. Purchase processing
When the player confirms a purchase:
- Check costs (all Cost Param × Cost Value); fail if insufficient
- Consume costs
- Add Item/Attach to storage
- In Managed stock mode, decrease remaining stock
- If Save Unique Variable is specified, save purchase unique to the variable
- If Auto Attach is set, perform equip processing (per On Attach Fail)
6. Shop end
When the player closes the shop:
- Resume all HUD processing
- Advance to the next event content
Typical Flows
Flow 1: Town general store
Buy potions with party gold:
- Show Text ← "Welcome!"
- Shop (Buy) (this event content)
- Title: General Store
- apply_to: Party
- Shop ID:
town_a_item_shop - Lineup:
- Potion × 1, Unlimited, Cost 50 GOLD
- High Potion × 1, Unlimited, Cost 200 GOLD
- Elixir × 1, Managed (Initial Stock 3), Cost 1000 GOLD
- Show Text ← "Come again!"
Flow 2: Character-individual equipment store
Buy weapons with character-individual gold + auto-equip:
- Shop (Buy) (this event content)
- Title: Armory
- apply_to: Character
- Target: Selected Member (1st)
- Shop ID:
capital_arms_shop - Lineup:
- Steel Sword (Attach, Auto Attach ON, On Attach Fail: Deny), Cost 500 GOLD
- Steel Shield (Attach, Auto Attach ON, On Attach Fail: SkipToPool), Cost 300 GOLD
Flow 3: Dynamic pricing (Formula)
Price based on party average level:
- Shop (Buy) (this event content)
- Lineup:
- Rare equipment (Attach), Cost
MEMS_AVG.LEVEL.MAX * 100GOLD
- Rare equipment (Attach), Cost
- Lineup:
Flow 4: Purchase-linked event
Trigger a special event right after purchase:
- Shop (Buy) (this event content)
- Save Unique Variable:
last_bought_unique
- Save Unique Variable:
- Conditional Branch (Formula
{last_bought_unique} != "") ← Only when a purchase occurred - Show Text ← "Thank you for your purchase!"
- End If
Flow 5: Multi-currency shop
Purchase with gold + special currency (shop points):
- Shop (Buy) (this event content)
- Lineup:
- Special equipment, Cost:
- GOLD:
500 - SP:
10
- GOLD:
- Special equipment, Cost:
- Lineup:
Flow 6: Linked with Shop Sell (store where sold items can be bought)
Items that the user sold can be bought at the same shop:
- Shop (Buy) (this event content) (Shop ID:
town_a_shop) - (In another event)
- Shop (Sell) (Show Shop Sell) (same Shop ID)
Flow 7: Quest-reward exchange counter
Exchange with special materials instead of GOLD:
- Shop (Buy) (this event content)
- Title: Material Exchange
- Lineup:
- Legendary equipment (Attach), Cost:
- Rare material:
10 - Quest point:
100
- Rare material:
- Legendary equipment (Attach), Cost:
Flow 8: Stock-limited shop
Rare items with limited quantity:
- Shop (Buy) (this event content)
- Lineup:
- Legendary Ring (Attach), Managed (Initial Stock 1), Cost 10000 GOLD
- Rare consumable, Managed (Initial Stock 5), Cost 1000 GOLD
- Lineup:
Once bought, stock decreases, and after sold out, you cannot buy even on revisit.
Typical Combinations
For the complete picture, see Combination Patterns.
Town general store
Standard pattern:
Buy + Sell set
Provide both "buy" and "sell" UIs:
- Add Choice × 3 (Buy / Sell / Leave)
- Show Selection Window
- Conditional Branch (judge selection result)
- Shop (Buy) (this event content) (when "Buy")
- Shop (Sell) (Show Shop Sell) (when "Sell")
Purchase-linked event
Save purchase unique and branch:
- Shop (Buy) (this event content) (specify save variable)
- Conditional Branch (purchase unique matches specific value?)
- (Special processing)
Related Event Contents
| Related event content | Use |
|---|---|
| Shop (Sell) (Show Shop Sell) | Sell shop (shares stock via the same shop_id) |
| Add Item | Directly grant an item to the party/character within an event content (no purchase) |
| Change Parameter | Individually increase/decrease GOLD, etc. |
| Assign Variable | Define the purchase-unique save variable |
| Conditional Branch | Purchase-linked conditional branches |
Related Pages
| Page | Related content |
|---|---|
| Item Tab (Editor) | item.json definition |
| Attach Tab (Editor) | attach.json definition |
| Parameter Tab (Editor) | parameter.json definition for GOLD, etc. |
| Variable Tab (Editor) | Define the purchase-unique save variable |
| Formula Reference | Formulas for dynamic pricing |
| Event Content List | List of all event contents |
Notes
apply_to is decided when adding content
The storage destination (Party/Character) is decided by the two-split button at the time of Add Content in the editor, and cannot be changed afterwards on the placed event content. To use a different storage destination, place a separate event content.
Shops are distinguished by Shop ID
Even the same item has independent stock if the shop_id differs. Make shop_id unique when defining a different store. An empty specification is treated as common across all shops.
Sharing shop_id with Shop Sell links the stock
Specifying the same shop_id as Shop (Sell) (Show Shop Sell) adds sold items to the purchase list. To avoid this, use a different shop_id.
PASSIVE Attach fixes On Attach Fail=Deny
Attaches with type=PASSIVE cannot be equipped from the equipment screen, so once they enter the pool they can never be equipped. Even if you specify SkipToPool, Deny behavior is used automatically.
Managed stock is independent per shop_id
Stock in Managed stock mode is managed separately per shop_id. Running this event content multiple times for the same shop_id keeps the stock state.
Formula is evaluated at purchase time
The Cost Value formula is evaluated at the moment the player presses the purchase button. Even if the game state changes during shop display, the price is based on the value at purchase execution.
All multiple costs are consumed
If multiple Costs are specified for one item, all costs are consumed simultaneously (e.g., gold 100 + material 1). If even one is insufficient, purchase is denied.
Silent on character resolution failure
When apply_to=Character and the target character cannot be identified, the shop does not open and silently advances to the next event content (warning log).
Works even without a save unique variable
Even without specifying Save Unique Variable, the shop still functions (just the unique is not saved to a variable). If no post-processing is needed after purchase, leaving it empty is fine.
Other HUDs are paused during the shop
While the shop is displayed, all HUD processing (images, text, choices, buttons, etc.) is paused. Closing the shop automatically resumes them.
