Valheim
Install with App

Details

Latest version
0.4.0
Last Updated
First Uploaded
Downloads
76
Likes
0
Size
28KB
Dependants
ADDatHost Valheim hosting
30% off

PortalSkidmarks

By Adam Robichaud.

A BepInEx mod for Valheim that plots the whole portal network on the map: every portal gets a pin labelled with its tag, and each connected pair is joined by a line.

  • Works in single player, on a locally hosted game, and on dedicated servers.
  • On a server, the mod must be installed on the server too. The server owns the full list of portals (clients only know about portals in zones near them) and broadcasts it to clients whenever it changes. Without it on the server the mod falls back to the portals the client has loaded nearby.
  • Lines are coloured per tag by default, so linked pairs are easy to tell apart. Unconnected portals are pinned with a "(no link)" suffix.
  • Markers and lines are drawn at 20% opacity. Pointing at a portal marker or a line on the large map brings that pair (both markers and their line) to full opacity and shows the portal name next to the pointer.
  • Toggle the overlay any of three ways. All three share one setting that is remembered between sessions.
    • Press Shift+P anywhere in game, except while typing.
    • Tick the Portals checkbox on the large map. It sits in its own row above the "Cartography Table" row when that is shown, otherwise above "Visible to other players", with the same width and spacing.
    • Type portals, portals on or portals off in the console (F5) or in chat as /portals.

Building

Requirements: .NET SDK 6 or newer, Valheim installed, BepInEx 5.4.x installed (plain or via a mod manager).

  1. Copy Paths.props to Paths.local.props and point the three properties at your install:

    • ValheimManaged: .../Valheim/valheim_Data/Managed
    • BepInExCore: the folder holding BepInEx.dll and 0Harmony.dll
    • PluginsDir: the BepInEx/plugins folder to deploy into (leave empty to skip deployment)
  2. Build:

    dotnet build -c Release
    

The DLL lands in bin/Release/PortalSkidmarks.dll and is copied to <PluginsDir>/<PluginFolderName>/. A Release build also writes thunderstore/PuhPuhBurr-PortalSkidmarks-<version>.zip. Mod managers read the author from the PuhPuhBurr- prefix of the zip name, which comes from ThunderstoreAuthor in the project file.

Showing it in Thunderstore Mod Manager / r2modman

Mod managers only list packages they installed, so a DLL copied into plugins still loads but never appears in the mod list. To make it appear, import the zip once: Settings → Profile → Import local mod, and pick thunderstore/PuhPuhBurr-PortalSkidmarks-<version>.zip. The manager takes the author from the file name and installs it to plugins/PuhPuhBurr-PortalSkidmarks/. Builds look for an installed PortalSkidmarks.dll in any plugins subfolder and update it in place, so they keep working whatever the manager names the folder.

Configuration

BepInEx/config/com.puhpuhburr.portalskidmarks.cfg is created on first run.

Key Default Meaning
Enabled true Master switch.
BroadcastInterval 5 Server: seconds between change checks.
LineThickness 3 Line width in UI pixels.
IdleOpacity 0.2 Opacity of markers and lines when not hovered.
HoverOpacity 1 Opacity of the hovered pair.
ShowTooltip true Show the portal name next to the pointer on hover.
LineColorMode PerTag PerTag or Single.
SingleLineColor light blue Colour when LineColorMode = Single.
ShowPortalPins true Add a portal pin for each known portal.
ShowUnconnectedPins true Also pin portals with no partner.
MarkUnconnected true Add " (no link)" to unconnected pin names.
ShowOnMinimap false Also draw lines on the small corner minimap.
ShowOverlay true Current on/off state. The hotkey, checkbox and command all change it.
ToggleKey P + LeftShift Toggle hotkey. Set to None to disable.
ShowMapToggle true Show the "Portals" row on the large map.
MapToggleOffset 0, 0 Nudge the "Portals" row in UI pixels if it overlaps something.

How it works

  • Game.ConnectPortals runs on the server every 5 seconds to pair portals by tag. A Harmony postfix on it snapshots ZDOMan.GetPortalList() (id, position, tag, linked id) and, if the fingerprint changed or a new peer joined, sends it to everyone with the routed RPC PortalSkidmarks_Portals. Clients also request the list once on login via PortalSkidmarks_RequestPortals.
  • A postfix on Minimap.Update draws the lines as UnityEngine.UI.Image quads under the map's pin root, using the same world-to-map maths the game uses for pins, clipped to the visible map rectangle. Portals are added as non-saved pins of type Icon4 (the vanilla portal icon).

Compatibility

Built against Valheim 1.0.15 (Unity 6000.0), BepInEx 5.4.22, HarmonyX 2.9. No other mod dependencies.

Thunderstore development is made possible with ads. Please consider making an exception to your adblock.