SANDBOX — this is a test environment. No servers are actually deployed and no real payments are charged.
Back to NxLabs

NxLabs / Vintage Story

S

Simple Weight Mod

KBy KenigVovan

Adds weight for items and blocks, slows and then prevents movements if is overburden.

Simple Weight Mod

Description

Adds physical weight to items and blocks. Carrying too much slows you down — or stops you completely. Weights can be defined explicitly, with wildcard rules, or auto-generated by the built-in categorizer.

Config file: ModConfig/weightmod.json


Defining weights

WEIGHT_RULES — wildcard rule list

Each rule has three fields: Pattern, Weight, and Kind ("item", "block", or "bonus"). Rules are evaluated in order; the first match wins.

Pattern syntax:

  • game:ingot-copper  — exact
  • game:ore-  — prefix
  • -bountiful  — suffix
  • ore  — contains
<pre style="background: rgba(0,0,0,0.2); padding: 14px 18px; border-radius: 4px; overflow: auto; font-size: 14px; line-height: 1.5; margin: 0 0 16px 0;">{ "Pattern": "game:crystalizedore-poor-", "Weight": 43, "Kind": "item" } { "Pattern": "-bountiful-hematite-*", "Weight": 104, "Kind": "item" } { "Pattern": "game:backpack", "Weight": 2000, "Kind": "bonus" }</pre>

Kind: "bonus" means the item adds carry capacity (backpacks, baskets, mining bags) instead of weighing the player down.

Legacy dictionaries (still supported)

  • WEIGHTS_FOR_ITEMS / WEIGHTS_FOR_BLOCKS — item or block code → weight. Processed after WEIGHT_RULES.
  • WEIGHTS_BONUS_ITEMS — bonus-carry items (backpacks, clothing).

Auto-categorizer (Weight Oracle)

Out of the box WEIGHT_RULES already ships with curated values for vanilla ores, ingots, metal plates and bonus carriers (backpacks, baskets, sacks, mining bag). The oracle fills in everything that isn't covered — useful when you have modded items or just don't want to enumerate the whole game by hand.

Enable with USE_WEIGHT_ORACLE: true. On first launch the mod walks every item and block that has no weight yet, drops it into a broad bucket (tool, weapon, armor, ore, metal, wood/stone/metal/glass block, food, clothing, misc) and writes a weight into the config. Then it flips WEIGHT_ORACLE_DONE: true and stops.

The classification is intentionally coarse: oak, birch and maple planks land in the same bucket and get the same weight; granite and basalt do too. Shape adjustments are applied on top (stairs/slab ×0.5, wall ×0.8, fence/gate ×0.3, stackable ×0.8). For variant-specific weights, add a WEIGHT_RULES entry — rules are processed first and win over oracle output. Manually-defined values are never overwritten.

Tune the auto-generation with:

  • BASE_WEIGHTS_BY_CATEGORY — base weight per bucket.
  • MATERIAL_MULTIPLIERS — multiplier per material family (wood, stone, metal, cloth, leather, glass, gem).

Player settings

<dl style="margin: 0;"> <dt style="font-weight: bold; margin-top: 14px;">MAX_PLAYER_WEIGHT</dt> <dd style="margin: 4px 0 0 0; padding-left: 0;">Max weight at full health, no bonuses. Overloaded players can't move or jump.</dd> <dt style="font-weight: bold; margin-top: 14px;">WEIGH_PLAYER_THRESHOLD</dt> <dd style="margin: 4px 0 0 0; padding-left: 0;">Current/max ratio at which walk speed starts to drop (0 &lt; value ≤ 1).</dd> <dt style="font-weight: bold; margin-top: 14px;">RATIO_MIN_MAX_WEIGHT_PLAYER_HEALTH</dt> <dd style="margin: 4px 0 0 0; padding-left: 0;">Floor for health-based capacity scaling. With 0.4, capacity never falls below MAX_PLAYER_WEIGHT × 0.4, even at minimum health.</dd> <dt style="font-weight: bold; margin-top: 14px;">ACCUM_TIME_WEIGHT_CHECK</dt> <dd style="margin: 4px 0 0 0; padding-left: 0;">Minimum seconds between weight recalculations. Skipped if health and inventories didn't change.</dd> <dt style="font-weight: bold; margin-top: 14px;">HOW_OFTEN_RECHECK</dt> <dd style="margin: 4px 0 0 0; padding-left: 0;">Full re-evaluation interval, in seconds.</dd> <dt style="font-weight: bold; margin-top: 14px;">PERCENT_MODIFIER_USED_ON_RAW_WEIGHT</dt> <dd style="margin: 4px 0 0 0; padding-left: 0;">If true, the percent stat modifier (weightmodweightbonus) applies to raw weight instead of the bonus.</dd>

Download

No download link is available for this entry right now.

Ratings & reviews

No ratings yet

Sign in to leave a rating or comment.