Valheim
Install with App

Details

Latest version
1.4.0
Last Updated
First Uploaded
Downloads
93
Likes
0
Size
78KB
Dependants
ADDatHost Valheim hosting
30% off

MasterPortal-Ymiron

A BepInEx mod for Valheim that adds three 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
Stone Minor Portal The same ring in dark stone, with an ember-orange veil and runes Like a Minor, but ores and metals can pass (like the Ashlands stone portal)

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: a window opens with the world map (the same map as the M key, fog of war included) showing the Master and every linked Minor as a numbered marker, and next to it the list of Minors with distance and direction. Click a marker on the map or a card in the list to travel; keys 1-9 pick directly, Esc closes. On the map the mouse wheel zooms, dragging moves it and the buttons in the corner zoom or frame every portal; on the list the wheel scrolls. Shift+E on the Master also opens the window. In worlds without a map only the list is shown.
  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).

Ores and metals: the Stone Minor Portal

Like the wooden portal, Master and Minor do not let ores and metals pass (configurable with AllowAllItems). The Stone Minor Portal does, like the vanilla stone portal of the Ashlands, and it costs the same (its recipe is copied from the vanilla stone portal, unless you set one in the config). It links to a Master like any Minor and the same rules apply, including the Minor limit:

  • from the Stone Minor to its Master, ores and metals pass;
  • from the Master to a Stone Minor, ores and metals pass;
  • from the Master to a normal Minor (and back), they don't.

In the Master's window the Stone Minors have their own color (orange) and show "ores & metals". If you carry ores or metals, the normal Minors are greyed out with "Ores and metals can't pass" and cannot be picked.

Installation

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

  • With r2modman / Thunderstore Mod Manager: Settings > Import local mod > pick MasterPortal_Ymiron-<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\ymiron.valheim.masterportal.cfg (created on first launch). Upgrading from 1.2.1 or earlier: the file used to be gfrascarelli.valheim.masterportal.cfg; copy your values over, then delete the old file. Entries:

  • MaxMinorsPerMaster - 0 = unlimited; with a value above 0 the extra Minors stay dark.
  • AllowAllItems - true to let ores and metals through every portal of the mod.
  • 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, Stone Minor empty (= the vanilla stone portal's recipe; if that portal is missing, the Minor's recipe).
  • EnergyColor (purple): color of bubble, veil, beams, crystals and runes on Master and Minor. The Stone Minor has its own EnergyColor (orange, #FF6A1A) in section 3b - Stone Minor Portal.
  • 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; the Stone Minor uses it too).

Technical notes

  • The three prefabs (MasterPortal, MinorPortal, StoneMinorPortal) are clones of portal_wood with a HubPortal component; the TeleportWorld patches replace hover text, interaction, teleport and on/off state for these prefabs only. The Stone Minor's recipe is read from portal_stone when the world loads.
  • The portal list sent by the server is in format 2 since 1.4.0 (it carries the Stone Minor flag): a 1.3.x client and a 1.4.0 server (or vice versa) do not understand each other.
  • 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. The Master's map is drawn with a copy of the large map's material (Minimap.m_mapLargeShader), so biomes, water and fog look like the in-game map; if that material is missing the plain biome texture is used.
Thunderstore development is made possible with ads. Please consider making an exception to your adblock.