ItemStringParser

版本 v2.0.0·更新於 2025-11-28

A library for parsing Item Strings. Does nothing on its own.

模組介紹 作者原文

ItemStringParser

This mod is a library for parsing ItemStrings. See bottom on the developer manual.

User Manual

ItemStrings are a way to describe a droptable using plain text. They let you describe what items should appear and how many in a simple, readable line. ItemStrings can include instructions for repeating items, choosing items randomly, or excluding certain items.

ItemString Operators

ItemString operators are symbols that help you decide which items to give, repeat, or exclude in a list. They make it easy to write rules like "give this item", "skip that one", or "choose one randomly" using short codes. Each entry in the ItemString roughly follows the format:

x!*:

Entries can be separated by & or |. Entries can be grouped with { and }.! (Not-Operator)

  • Purpose: Blacklist items from tiers or droptables.
  • Placement: Directly after the name of the droptable or tier.
  • Example:
  • Tier1!Hoof - White item but not a Hoof
  • dtChest1!Bear!Crowbar - Content of a Small Chest but neither Tougher Times nor Crowbar.

& (And-Operator)

  • Purpose: Every item separated by & will be selected.
  • Example:
  • Hoof & Boss - The player receives both a Hoof and a random Boss item.

| (Or-Operator)

  • Purpose: Only one of the items separated by | will be chosen at random.
  • Weights: You can specify selection weights using a colon: after the item (e.g., Tier1: 0.5 | Tier2: 0.5).
  • Example:
  • Tier1 | Tier2 - The player gets either a Tier1 or a Tier2 item (equal chance unless weighted).: (Weight Separator)
  • Purpose: Assigns probability weights to options with the Or-Operator (|).
  • Default: If omitted, the default weight 1 is used.
  • Example:
  • Tier1: 0.6 | Tier2: 0.4 - Tier1 has a 60% chance, Tier2 a 40% chance.
  • Tier1: 3.0 | Tier2 - Tier1 has a 75% chance, Tier2 a 25% chance.

x (Repeat-Operator)

  • Purpose: Repeats the immediately following item or group a fixed number of times.
  • Placement: Directly before a group or item.
  • Example:
  • 5xHoof - The player gets 5 Hoof items.
  • 3x{ Tier1 | Tier2 } - The player gets 3 times a randomly selected item from Tier1 or Tier2.
  • (Multiplier-Operator)
  • Purpose: Multiplies the amount of items of a group.
  • Placement: Directly after a group or item.
  • Example:
  • Hoof*5 - The player gets 5 Hoof items.
  • { Tier1 | Tier2 }*3 - The player gets 3 copies of a single type of item from either Tier1 or Tier2.

{ and } (Grouping Symbols)

  • Purpose: Group items and operators together. Can use & and | within a group, but they cannot be mixed.
  • Operator precedence: Use { } to explicitly control grouping and order of operations, especially when combining repeat, and, or multiply.
  • Nested groups: You can nest { } for more complex item generation logic.
  • Example:
  • { 2xdtChest1 | dtChest2 } - Represents a choice between "2x small chest" and "1 large chest" as a single entity; useful with other operators.

Summary Table

| Operator | Symbol | Description | Example |

|----------|--------|-----------------------------------------------------------|-----------------------|

| Not |! | Blacklists the item from the group | A!B |

| And | & | All items, together | A & B |

| Or | \| | Only one item, random (optional weight via:) | A \| B:0.7 \| C:0.3 |

| Weight |: | Specifies probability weight for options when using \| | A: 0.6 \| B: 0.4 |

| Repeat | x | Repeats the following item/group N times | 5xA or 3x{A \| B} |

| Multiply | ` | Multiplies the amount of items in the group by N | {A & B}4` |

| Grouping | {} | Groups items/expressions | {A & 2xB} |

Examples

A random lunar item, except for Light Flux Pauldron and Stone Flux Pauldron:

ItemList = Lunar!HalfSpeedDoubleHealth!HalfAttackSpeedHalfCooldowns

5 Hooves:

ItemList = 5xHoof

Also 5 Hooves:

ItemList = Hoof*5

5 random whites:

ItemList = 5xTier1

5 copies of the same white:

ItemList = Tier1*5

5 Hooves and 2 Armor Plates:

ItemList = 5xHoof & 2xArmorPlate

Either 5 Hooves or 2 Armor Plates:

ItemList = 5xHoof | 2xArmorPlate

Either 5 Hooves with 30% c

安裝與使用 安裝:BepInEx 外掛

  1. 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
  2. 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
  3. 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
  4. 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。

帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。

檔案與校驗

檔案名稱
ItemStringParser-2.0.0.zip
檔案大小
98.1 KiB