Valheim
You are viewing a potentially older version of this package. View Latest Version
Install with App

Details

Date Uploaded
2 weeks ago
Downloads
2.3K
Size
179KB
ADDatHost Valheim hosting
€1

Prefab Hammer

Prefab Hammer is an advanced construction utility for Valheim. It allows players to capture custom build combinations (prefabs/blueprints) directly from their existing structures, name them, manage them in a catalog, and build them using standard resource calculations.

Features

  • Manual and Area Capturing: Select pieces individually using precise green outlines, or fall back to a radius area save.
  • Visual Multi-Row Requirements Grid: Clear, readable requirement display for complex prefabs and blueprints with enlarged icons, item names, and color-coded stock counts.
  • Movable Requirements Display: Freely reposition the requirements panel via in-game drag (Shift + Drag) or custom X/Y configuration.
  • In-Game Blueprint Trading: Swap saved custom structures directly with nearby players over the network.
  • Inline Catalog Renaming: Organize and rename your custom prefabs dynamically within the Library Catalog.
  • Stability Support Calculations: Custom designs automatically calculate structural integrity upon placement.
  • Undo History: Revert mistakes cleanly, automatically refunding construction materials at their original spots.
  • Zero Alt-Tab Lag: Captures and places large structures in small background batches across frames to prevent freezes.
  • Seamless MovingDay Compatibility: Shares the exact same selection pool in memory if the MovingDay mod is active.

Usage Guide

1. Capturing and Saving a Blueprint

  • Manual Selection: Equip the Hammer, look at any building piece, and press J to add it to your selection. Selected pieces highlight with a pulsating green overlay.
  • Clearing Selection: Press Shift + J or Ctrl + J (or press J while aiming at empty air) to clear the active selection.
  • Saving: Press K to open the Save Dialog. Enter a name for your custom prefab and click Save Combo.
  • Area/Radius Fallback: If you open the Save Dialog (press K) without selecting any pieces first, the mod automatically captures all pieces within a radius of the targeted crosshair.

2. Managing the Library Catalog

  • Opening the Catalog: Press Delete or Shift + K to open the Prefab Manager directly to the Library Catalog tab.
  • Renaming a Blueprint: In the Library Catalog list, click Rename next to any blueprint. Type the new name and click Save to update the template file and menu instantly.
  • Deleting a Blueprint: Click Delete next to any blueprint, and click Confirm? to permanently delete the blueprint.

3. Building and Requirements Display

  • Placing a Blueprint: Open your hammer build menu, navigate to the Prefab tab, select your saved blueprint, and build it like a normal piece.
  • Visual Requirements Grid: Complex prefabs display all required materials in a clean, multi-row grid of badges. Each badge shows the item icon, localized name, and inventory/required counts:
    • Red count (e.g. 19186): You currently have 0 in your inventory.
    • White / Red (e.g. 14/892): You have a partial amount (14 owned out of 892 required).
    • White count (e.g. 100): You have enough in inventory or free build is enabled.
  • Repositioning the Requirements Display:
    • Hold Shift (or your configured drag key) and Left-Click Drag anywhere on the requirements display to move it freely on your screen.
    • Releasing the mouse button automatically saves the position to your config file.
  • Batched Construction: Large blueprints build automatically over multiple frames to prevent game freezing. A progress message (e.g. Placing MyBase... 45/120) will show on screen.
  • Undoing a Placement: If you make a mistake, press Shift + U to open the Undo History tab. Click Undo next to the placement you want to revert. All pieces will be removed, and building materials will drop at the original piece locations.

4. In-Game Blueprint Trading

  • Initiating a Trade:
    • Open the Prefab Manager (press K or Shift + K) and select the Trade Window tab.
    • You will see a list of nearby players (within 10 meters) who have the mod active.
    • Click Invite to Trade next to their name. (A 30-second cooldown applies to prevent spam).
    • An interactive invitation popup will open on the other player's screen. If they are in combat or dead, the invite is auto-declined.
  • Exchanging Blueprints:
    • Once the invite is accepted, the trade screen opens for both players.
    • Click Add + in the My Offer column to select blueprints from your library.
    • Blueprints that the other player already owns are highlighted in yellow as [Already Owned] and cannot be added.
    • Click Lock Offer when satisfied with your offer. Note: Any modifications to offers after locking will force both locks to open for safety.
    • After both players have locked, click Accept Trade to transfer the files. Payloads are compressed using Gzip and securely transferred.
  • Safety Interrupts:
    • The trade instantly cancels and closes the GUI if either player enters combat, dies, moves out of the 10m range, or disconnects.

Compatibility with MovingDay

If you also have the MovingDay mod installed, they will automatically work together:

  • Shared Selection: They share the exact same selection pool in memory. Highlighting a structure with PrefabHammer's select keys will immediately make it targetable by MovingDay's move keys, and vice versa.
  • Coordinated Highlights: Selecting pieces in one mod keeps them visually highlighted, and clearing the selection in either mod cleans up both mods' highlight overlays.

Keybinds (Configurable)

  • J: Toggle manual piece selection (must hold Hammer).
  • Shift + J or Ctrl + J: Clear the current selection.
  • K: Open save panel / Prefab Manager.
  • Delete or Shift + K: Open Library Catalog directly.
  • Shift + U: Open Undo History tab.
  • Shift + Left Mouse Drag: Move the requirements display panel anywhere on screen.

Chat Commands

  • /prefabsave [name] [radius]: Save the hovered structure (or current selection) as a new blueprint.
  • /prefablist or /prefablibrary: Open the Prefab Manager to the Library tab.
  • /prefabreload: Reload custom blueprints from disk.
  • /prefabdelete [name]: Delete a saved blueprint by name.
  • /prefabinspectorigin [radius]: Inspect and categorize all entities near world origin (0, 0, 0) with their exact distances in meters.
  • /prefabcleanorigin [radius]: Clean up orphaned dummy containers, loose item drops, or standard building pieces near world origin (0, 0, 0). Note: Also sweeps up standard building pieces within 5m of the altar.

Installation

Prefab Hammer requires BepInEx to run.

  1. Install BepInExPack Valheim.
  2. Place PrefabHammer.dll into the BepInEx/plugins/ directory (or download directly via r2modman).

Configuration

You can customize the mod's behavior by editing BepInEx/config/com.prefabhammer.cfg (or using the in-game Configuration Manager / r2modman's Config Editor).

General

  • Enabled: Enable or disable the mod on the fly (default: true).
  • BuildCategory: The build menu category tab where your custom prefabs are loaded (default: Prefab). Can be set to vanilla tabs like Misc, Crafting, Building, or Furniture.
  • DefaultRadius: Capture radius in meters for the fallback area save (default: 5.0).

UI (Requirements Display)

  • RequirementsPositionX: Horizontal screen offset of the requirements display (default: 0.0, 0 = centered).
  • RequirementsPositionY: Vertical screen offset of the requirements display (default: -28.0).

Keybinds

All hotkeys use BepInEx's native click-to-bind system. In the in-game configuration manager, click the keybind button and press the key combination you want — no need to type key names.

  • SaveHotkey: Open the save panel (default: K).
  • SelectHotkey: Toggle piece selection (default: J).
  • ManagerHotkey: Open the Prefab Manager to the Library tab (default: Left Shift + K).
  • UndoHotkey: Open the Prefab Manager to the Undo History tab (default: Left Shift + U).
  • RequirementsDragKey: Modifier key to hold when dragging the requirements display (default: LeftShift). Options include LeftShift, LeftControl, LeftAlt, None, etc.

Performance

  • PlacementBatchSize: Number of pieces placed per frame during batched building (default: 10). Lower values reduce stuttering on slower hardware.
  • MaxUndoHistory: How many recent placements are kept in the undo history (default: 5).

Upgrading from v1.0.7 or earlier: Delete your old com.prefabhammer.cfg file to let BepInEx regenerate it with the new keybind format. The old string-based key entries are not compatible.

Discord

Join our Discord Server for discussion, suggestions, and bug reports!

DatHost — Valheim server hosting, first month for one euro
DatHost — Valheim server hosting, first month for one euro
DatHost — Valheim server hosting, first month for one euro
DatHost — Valheim server hosting, first month for one euro
DatHost — Valheim server hosting, first month for one euro