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

Details

Date Uploaded
3 weeks ago
Downloads
570
Size
67KB
ADDatHost Valheim hosting
30% off

MasterPortal-Ymiron

A BepInEx mod for Valheim that adds two portals you can build with the hammer, next to the vanilla portal:

Portal Look What happens when you step in
Master Portal Large, low round platform (9 m) with three small pillars: energy beams run from the crystals on top straight to the center, where a purple bubble rises from the emitter Opens the list of linked Minor portals: pick where to go
Minor Portal Dark wooden ring bound in iron, like a Viking shield standing on four legs; inside, a purple energy veil that opens like an iris Takes you straight back to its Master

How to use

  1. Build a Master Portal, press E and type its name (e.g. home).
  2. Build the Minor Portals. Pressing E opens a window with two fields:
    • Master: which Master to link to. The Masters already built are listed below the field, just click one;
    • Name of this portal: how it will appear in the Master's list (e.g. Mine). Enter saves, Esc cancels.
  3. After a few seconds the portal activates: on the Master the beams light up and the purple bubble rises from the center; on the Minor the veil opens and the runes glow.
  4. Step into the Master's bubble: the list of Minors appears, with their distance. Pick one with the mouse, the mouse wheel scrolls the list, keys 1-9 pick directly, Esc closes. Shift+E on the Master also opens the list.
  5. Step into a Minor: you are taken to its Master.

Every player can have their own Master (home-bob, home-alice...). Names are not case sensitive (Home = home). If two Masters share a name, a Minor leads to the nearest one (the portal warns you).

Like the wooden portal, ores and metals cannot pass (configurable).

Installation

BepInEx is required (the BepInExPack_Valheim package), as for every mod.

  • With r2modman / Thunderstore Mod Manager: Settings > Import local mod > pick MasterPortal-<version>.zip.
  • By hand (also on a dedicated server): unzip and copy MasterPortal.dll into BepInEx\plugins (optionally in a MasterPortal subfolder). The other files are not needed.

All players and the server must run the same version.

Multiplayer

The mod must be installed on the server and on every client. Only the server knows every portal in the world (a client only sees the ones nearby): it rechecks them every few seconds and sends the list to the players, who use it for the menu, for travelling and to light up the portals. The Minor limit and the allowed items come from the server's config. When a player hosts the game, their game is the server.

If a portal keeps saying "Waiting for the portal list from the server..." for more than a few seconds, the server is missing the mod or runs a different version.

Configuration

BepInEx\config\gfrascarelli.valheim.masterportal.cfg (created on first launch):

  • MaxMinorsPerMaster - 0 = unlimited; with a value above 0 the extra Minors stay dark.
  • AllowAllItems - true to let ores and metals through.
  • ScanInterval - how often the server refreshes the list.
  • For each portal: name, description and requirements (Prefab:Amount,...). Defaults: Master FineWood:40,GreydwarfEye:20,SurtlingCore:4, Minor FineWood:20,GreydwarfEye:10,SurtlingCore:2.
  • EnergyColor (purple): color of bubble, veil, beams, crystals and runes on both portals.
  • Section 4 - Visuals (applies on the next world load): CustomModels (false = vanilla model), radius of the Master platform and height of its pillars (the bubble follows the pillars' height), radius of the Minor ring (MinorRingRadius, default 1.75 m = 3.5 m across).

Building

dotnet build -c Release

This also copies MasterPortal.dll into ...\profiles\Default\BepInEx\plugins\MasterPortal. Other paths: -p:ValheimDir=... and -p:BepInExDir=....

For the package to hand out: .\package.ps1 creates dist\MasterPortal-<version>.zip (bump the version in manifest.json and src\Plugin.cs; the script checks they match).

Technical notes

  • Both prefabs are clones of portal_wood with a HubPortal component; the TeleportWorld patches replace hover text, interaction, teleport and on/off state for these two prefabs only.
  • They are not in Game.m_portalPrefabs, so vanilla tag pairing never touches them.
  • Master and Minor names live in two ZDO values (MasterPortal_Network, MasterPortal_Name); portals built with 1.0.0 (everything in the tag, network/name) are still read.
  • The models are generated in code (src/Visuals): vanilla dark wood and crystal, stone and metal with textures generated in code (the vanilla materials are atlases). Bubble, veil and beams use Sprites/Default and are animated by MasterEnergy/MinorEnergy; the vanilla vortex is hidden (its light and sound stay) and the teleport area is enlarged to the bubble and the veil.
  • The hammer icons are rendered from the models when the game starts; if that fails the vanilla icon stays.
  • The menu and the name window are IMGUI: no controller support.
Thunderstore development is made possible with ads. Please consider making an exception to your adblock.