Skip to content

Valks-Terraria-Mods/MerchantsPlus.Generator

Repository files navigation

MerchantsPlus.Generator

C# console app that auto-generates Shops/Catalogs/ShopExpandedCatalog.cs for the MerchantsPlus mod. Do not hand-edit that file — run the generator instead.

Quick Start

From the MerchantsPlus/ mod root:

dotnet run --project ../MerchantsPlus.Generator

That's it. The generator reads its input CSV, classifies items, paginates them into shops, and writes the catalog file.

Files You'll Actually Touch

File What it does
ItemClassifier.cs Maps item names → merchant + shop (regex patterns, order matters)
CatalogGenerator.cs Pipeline rules: pagination, page names, redistribution logic

After editing either file: re-run the generator, then rebuild the mod.

Input CSV

The input is .tmp/missing_items_integrated_with_stage.csv (already committed — don't regenerate it unless you're adding new Terraria items or rebalancing progression stages).

Column Meaning
Name ItemID constant name
Id Numeric item ID (informational only)
Index Sort order
Stage Progression tier (0 = early game, 3 = post-Moonlord)

For small stage corrections, edit the CSV directly.

To fully regenerate the CSV (only needed after a Terraria update):

  1. Run Legacy/classify_missing.ps1 → produces .tmp/missing_classified.csv
  2. Review and correct stages
  3. Overwrite .tmp/missing_items_integrated_with_stage.csv
  4. Re-run the generator

Outputs

Path Description
MerchantsPlus/Shops/Catalogs/ShopExpandedCatalog.cs The generated catalog (main output)
.tmp/expanded_report.csv Human-readable item assignment report

Output is deterministic — same input always produces identical output.

Rules the Generator Enforces

  • Max 40 items per page
  • Max 24 characters per shop name
  • No duplicate shop names per merchant
  • Coins pages exclude raw coin items
  • Treasure Bags pages exclude boss bag overrides

About

Generator for MerchantsPlus Terraria mod.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors