You are viewing a potentially older version of this package. View all versions.
BatBoys-TownPortal-1.0.39 icon

TownPortal

Open a blue wood portal home to your bed or Runic Spawn Point. Allies can follow. The finished tome also teaches the Runic Spawn Point, a respawn stone you can build anywhere, even on a ValheimRAFT boat. Tomes drop in early chests or from Haldor.

By BatBoys
Date uploaded 20 hours ago
Version 1.0.39
Download link BatBoys-TownPortal-1.0.39.zip
Downloads 30
Dependency string BatBoys-TownPortal-1.0.39

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2333 icon
denikson-BepInExPack_Valheim

BepInEx pack for Valheim. Preconfigured with the correct entry point for mods and preferred defaults for the community.

Preferred version: 5.4.2333
ValheimModding-Jotunn-2.30.2 icon
ValheimModding-Jotunn

Jötunn (/ˈjɔːtʊn/, 'giant'), the Valheim Library was created with the goal of making the lives of mod developers easier. It enables you to create mods for Valheim using an abstracted API so you can focus on the actual content creation.

Preferred version: 2.30.2

README

Town Portal

Find a ruined old book, restore it at a workbench, and use it to open a portal home from anywhere in the world.

The Tome of Town Portal opens a temporary portal back to the bed you have claimed. Friends can follow you through, and a return gate at your bed takes everyone back to where you opened it. It doesn't join the normal portal network, and it follows the same cargo rules as a wood portal.

Needs BepInEx and Jötunn. In multiplayer, every player and the server need the mod installed.

Features

  • A way home. With the tome anywhere in your inventory, press Left Alt + H. On a controller, hold L2 and click the right stick. A blue-lit wood portal opens beside you.
  • Bring your friends. Anyone can walk through your portal. They arrive at your bed, not their own, and they don't need a tome.
  • A way back. A blue return gate appears at your bed. Press E on it to go back to the portal.
  • Know whose gate it is. Each return gate shows its owner's name when you hover it, and a small floating name when you are close, so you can tell gates apart in a busy base.
  • Home can be your Runic Spawn Point. The finished tome also teaches you a respawn stone. Claim one and the portal takes you there instead of your bed. See below.
  • Fair limits. By default a portal lasts 15 minutes, and the tome needs 5 minutes to rest before you can open another one. A server can change both. Ore, metal bars and anything else a wood portal won't take are refused here as well. World settings that turn off portals, or block them during boss fights, apply to the tome too.
  • Something to find. Mysterious Tomes turn up in Meadows and Black Forest chests, and Haldor sells them once the Elder is dead.
  • Matches the game's look. Both books use pixel-style textures like Valheim's own items. The finished tome is warm brown leather with glowing cyan runes. The Mysterious Tome is the same book, dusty and worn.
  • Works on existing worlds. You don't need a new world.

Getting the tome

1. Find a Mysterious Tome

  • Chests: about 1 in 4 loot chests in the Meadows and Black Forest also have one. It's added on top of the normal loot, so nothing else is replaced.
  • Haldor: sells one for 250 coins (by default) after the Elder is dead. If you find one in a chest before that, you can still use it.

Each chest gets one chance the first time it loads with the mod installed, even chests you've already looted. Barrels and chests that players built don't count.

2. Restore it at a workbench

Craft the Tome of Town Portal at a level 1 workbench:

Ingredient Amount
Mysterious Tome 1
Surtling core 10
Greydwarf eye 25
Leather scraps 15
Deer hide 5

You keep the finished tome. Opening a portal doesn't use it up, and you don't need to equip it.

Runic Spawn Point

Runic Spawn Point used to be a separate mod. It is now part of Town Portal.

  • Unlocked by the tome. The first time the finished Tome of Town Portal is in your inventory, you learn the Runic Spawn Point and get the usual "new piece" message. The Mysterious Tome doesn't count. Once learned, it stays learned for that character, even if you put the tome away.
  • Build it anywhere. Find it in the Hammer under Furniture. It costs the same as a bed and needs no roof.
  • Claim it. Press E on the stone to make it your spawn point. Shift + E releases it. When you die, you wake up beside it, however far away it is.
  • Sails with you. Build it on a ValheimRAFT boat and you respawn on deck wherever the boat has gone, and get put back on the deck if you land in the water.
  • Town Portal opens to it first. With a stone claimed, your portal goes to the stone. If the stone is gone, it goes to your bed, and then to the starting stones.
  • On your map. Your claimed stone shows on the map as "Your spawn point" with the bed icon, even while it sails around on a boat. Only you see it, and it isn't saved into your map. Turn it off with ShowSpawnPointPin.
  • Can count as a base. If the server turns on RunicSpawnPointIsBase, each stone keeps monsters from spawning right next to it, the same way a workbench does. It doesn't give comfort. It's off by default, and it doesn't apply to stones on a boat.
  • Lost track of it? Type townportal_spawnpoint in the console (F5) to see where your stone is, whether it's loaded, and whether it's on a boat. townportal_spawnpoint clear drops your claim.

If you still have the old Runic Spawn Point mod installed, remove it. Stones you already built and claimed keep working.

How it works

  1. Carry the Tome of Town Portal and press Left Alt + H (or L2 + right stick click). The portal opens on the nearest clear spot beside you. It won't open in open water.
  2. Walk through. You arrive at your claimed bed, or at the starting stones if you haven't claimed one.
  3. Anyone else can press E on the return gate to go back to the portal, and come home again as often as they like while it's open.
  4. When you press E on the return gate, it says Return and close. You go back and both ends close. They don't wait for anyone, so send your friends through first.
  5. If nobody closes it, the portal and return gate disappear after 15 minutes. The timer runs in real time, so sleeping doesn't shorten it, and logging out doesn't close it early.

While the portal is open, the map shows a marker labeled "[name]'s town portal". The marker is hidden while the person who opened it is offline, but the portal stays open until its time runs out.

Opening a new portal replaces your old one.

The portal uses the game's own wood portal model, loaded from your game when you play. No Valheim files are included in this package.

Settings

Settings are in BepInEx/config/com.townportal.mod.cfg, which is created the first time you start the game with the mod.

On a server, the gameplay settings come from the server. When you join, the server's values replace yours for as long as you're connected, and changes an admin makes on the server reach everyone right away. You don't have to copy the file to every PC or restart anything. In single player your own file is used. The settings marked "This PC" are yours to set however you like.

Setting Default Who sets it What it does
Open Left Alt + H This PC The key that opens a portal. The tome's tooltip shows whatever you pick.
ShowGateNames true This PC Shows the owner's name floating above return gates.
ShowSpawnPointPin true This PC Shows your claimed Runic Spawn Point on the map as "Your spawn point".
CooldownSeconds 300 Server How long the tome rests before you can open another portal.
DurationSeconds 900 Server How long a portal and its return gate stay open.
MysteriousTomeDropChance 0.25 Server Chance, from 0 to 1, that a Meadows or Black Forest chest also has a Mysterious Tome.
HaldorPrice 250 Server What Haldor charges for a Mysterious Tome.
HaldorRequiresElder true Server Haldor only sells the tome after the Elder is dead.
SearchRadius 6 Server How far from you, in meters, the portal can open.
PortalYawOffset 0 Server Turns the portal. Set it to 180 if the frame faces the wrong way.
RunicSpawnPointIsBase false Server Makes every Runic Spawn Point count as a player base, so monsters don't spawn close to it. No comfort.
RunicSpawnPointBaseRadius 10 Server How far that base area reaches, in meters.
ServerLookupTimeout 10 This PC Runic Spawn Point. Seconds to wait for the server to say where your stone is.
AreaLoadTimeout 45 This PC Runic Spawn Point. Seconds to wait for the area and the boat to load when you respawn.
ResnapSeconds 5 This PC Runic Spawn Point. How long after a respawn you get put back on deck if you fall off.
VerboseLog false This PC Runic Spawn Point. Logs every respawn step, for troubleshooting.
LogChestPrefabs false This PC Writes chest names to the log, for troubleshooting.

Console commands

Anyone can use these:

Command What it does
townportal_spawnpoint Shows where your Runic Spawn Point is, whether it's loaded, and whether it's on a boat or on land.
townportal_spawnpoint clear Clears your claim and releases your stones, so you respawn at your bed again.

Server admins (listed in adminlist.txt) can also name another player:

Command What it does
townportal_spawnpoint <player name> Shows every Runic Spawn Point stone that player owns.
townportal_spawnpoint clear <player name> Releases that player's stones. If they're online, their claim clears right away.

With devcommands turned on:

Command What it does
spawn TownPortal_MysteriousTome 1 Drops a Mysterious Tome at your feet
spawn TownPortal_Tome 1 Drops a finished Tome of Town Portal
townportal_spawnstone Places a Runic Spawn Point stone in front of you, standing on the ground
townportal_clear Removes every town portal, return gate and map marker, and resets the timers. Save the world afterwards.

Known limitations

  • There is no PvP lock yet. Anyone who reaches your portal can follow you home until it closes.
  • The mod's own text is English only.

CHANGELOG

Changelog

1.0.40

  • The Tome of Town Portal now works on dedicated servers. Opening a door, stepping through it, using the return gate and the map markers all work the same on a dedicated server, a hosted game and single player.
  • The door's spot is now picked on your own PC, using the server's search radius and portal turn. The server makes the door, keeps one door per player, finds your Runic Spawn Point and handles the trip.
  • The tome no longer fails silently. If it can't open, you see why. With the build tool out it says "Put away your build tool first." If the server doesn't answer, it tells you.
  • Each open, trip and refusal writes one line to the log on your PC and one on the server, which makes problems easier to track down.
  • Return gates on a boat's Runic Spawn Point still follow the stone. Gate names, map markers and the way back are unchanged.
  • townportal_clear from a client now needs admin rights on the server. It also clears the tome cooldown for everyone online.
  • Every player and the server need 1.0.40.

1.0.39

  • Server settings now sync. When you join a server, its gameplay settings (cooldown, duration, drop chance, Haldor's price and Elder rule, search radius, portal turn, and the new base options) replace yours while you're connected, and changes reach everyone without a restart. Your key, gate names, map pin and log settings stay your own. Every player and the server need 1.0.39.
  • The tome's tooltip shows the key you actually set, plus the controller combo, and updates when you change it.
  • Your claimed Runic Spawn Point shows on your map as "Your spawn point", even on a moving boat. Only you see it. Turn it off with ShowSpawnPointPin.
  • New server option RunicSpawnPointIsBase (off by default) makes each stone count as a player base, so monsters don't spawn next to it. RunicSpawnPointBaseRadius sets how far that reaches.
  • New console command townportal_spawnpoint shows where your stone is, whether it's loaded and whether it's on a boat. townportal_spawnpoint clear drops your claim. Admins can add a player name to check or clear someone else's.
  • New devcommands command townportal_spawnstone places a Runic Spawn Point in front of you.
  • Text says "return gate" everywhere. Setting descriptions are rewritten, and the settings table in the README lists every setting.
  • The mod no longer uses reflection to save chests or check chat focus.
  • The website link is removed.

1.0.38

  • Runic Spawn Point is now built into Town Portal. You learn it the first time the finished tome is in your inventory. Remove the old Runic Spawn Point mod; your stones and claims keep working.

1.0.37

  • BoatSpawn is now called Runic Spawn Point. Town Portal's messages use the new name.
  • Return gates show whose they are. Hovering one reads "[name]'s return gate", and a small name floats above it when you are close. The floating name can be turned off with the ShowGateNames setting.

1.0.36

  • With BoatSpawn (now Runic Spawn Point) 1.0.2 or newer, the portal opens at your claimed spawn point, on deck wherever the boat is, and falls back to your bed if it's gone.

1.0.35

  • Book textures load through Unity's own image loader. The plugin no longer loads a DLL by name at runtime.

1.0.34

  • Republish for Thunderstore. The field manual link is on the package page.

1.0.33

  • Same package layout as the earlier releases.

1.0.32

  • Both tomes use a Valheim-style pixel look. The eight material textures are 128×128, and the cover runes are drawn as pixel art. Book textures use point filtering. Inventory icons are unchanged.

1.0.31

  • The book is no longer mirrored. The runes read the right way and the spine is on the correct side. X is negated on positions and normals when the mesh is built. The triangle flip from 1.0.30 is not used.

1.0.30

  • The book renders lit and brown. The mesh had every triangle wound inside-out, so the cover was lit from behind. This winding change was replaced by the un-mirror in 1.0.31.

1.0.29

  • The artist's brighter leather is in. The cover is no longer boosted in code. Metal stays off the leather, and only the iron caps use the metal map.

1.0.28

  • The inventory icons use a softer edge. The hard black outline is gone.

1.0.27

  • The leather was rendering as metal, so the cover stayed black in daylight while the runes glowed. Metal is off, the shine is low, and the cover color is lifted a little.

1.0.26

  • Removed the color processing on both books. They use the artist's textures as painted. Nothing in the plugin shifts them toward blue. The finished tome's runes still glow the color in the emission map.

1.0.25

  • The mysterious tome was still a dark block in daylight. Its leather is brighter, and it is no longer rendered as metal.

1.0.24

  • Both books were too dark on an item stand. The leather is brighter. The rune glow is unchanged.

1.0.23

  • The finished tome and the mysterious tome use the artist's own textures. The finished cover is blue leather with glowing runes. The mysterious tome is the grey book. Nothing is recolored in the plugin.

1.0.22

  • The finished book keeps its leather grain. The blue shift was turning the dark cover into a near-black slab. Stitches were the only part still bright enough to see.

1.0.21

  • The finished book was a flat blue with no leather. The color sliders were pinned to the end of their range, which wiped the texture. They sit at neutral now.

1.0.20

  • The controller chord is L2 + right stick click. L1 was opening the radial menu. That click does not crouch.

1.0.19

  • The leather texture shows on the dropped book. It was rendering as a black shell.
  • A book on an item stand uses the same model. The stand was still showing the empty amber attach.
  • The controller chord is L1 + D-pad down (LB + D-pad down). L2 + X was too close to Use.

1.0.18

  • The book on the ground keeps its leather, pages included. The cover was rendering black because the normal map was read in the wrong channels.

1.0.17

  • A controller opens the door with L2 + Square. That is LT + X on an Xbox pad or Steam Deck. Left Alt + H still works.

1.0.16

  • The finished tome is the strapped book with a blue hue, in the inventory and on the ground.
  • The mysterious tome is that same book, grey and faded. It no longer uses the old icon.

1.0.15

  • The finished tome uses the strapped leather book, in the inventory and on the ground. That art is inside the plugin now. The mysterious tome keeps the plain brown icon.

1.0.14

  • The return gate stays until the timer ends, including after you log out and come back. It was removed on load.
  • Using the return gate after a relog still closes the door.

1.0.13

  • Old town portal markers are deleted with the portal record, not just hidden. That includes duplicates and portals that already expired. A player who is offline does not get a marker unless their door is still open and they are back in the world.
  • townportal_clear removes those records from the world save and the markers from the map. Run it once, then save. They do not come back after you exit.

1.0.12

  • townportal_clear removes the portal mist with the door. It was left behind in the world.
  • A portal opened inside a crypt, cave, or other dungeon goes to your bed. It no longer drops you on the dungeon roof outside the map.

1.0.11

  • The tome on the ground is the strapped leather book. The finished tome uses that icon. The mysterious tome keeps the plain brown icon.

1.0.10

  • A tome another player picked up now opens a door. The bag on their screen had the book, but the server's copy of that inventory did not, so the shortcut was refused.

1.0.9

  • Another player can open a door with a Tome of Town Portal they picked up. The hotkey was only looking at the prefab pointer, which a traded or spawned tome often does not have, and it failed without a message.

1.0.8

  • An active town portal places a blue circle on the map, labeled with the caster's name. The pin goes away when the door closes, expires, or is cleared.

1.0.7

  • Added the devcommands console command townportal_clear. It destroys every town portal door and return gate, including unloaded ones, and clears The Tome Rests and Nowhere Like Home.

1.0.6

  • The return gate is blue instead of magenta, and a bit shorter. The pale block at the bottom was the leftover cube from the prefab.

1.0.5

  • The return gate is a pale gray field with a blue base, and more transparent. The magenta was a missing shader.
  • Arrival is a short step above the floor by the bed. It no longer puts you on the roof, and it does not drop you through the floor.

1.0.4

  • Fixed the world load hanging on ZDO not used when creating object TownPortal_Door. The door prefab stays active so a saved portal claims its ZDO.

1.0.3

  • The wood door shows the connected-portal swirl and a blue glow. It still does not join the portal tag network.
  • Arrival stands a meter above the floor you land on, including wooden floors, instead of the terrain underneath. You no longer drop through the floor.
  • The return gate hover shows your mapped Use key instead of $KEY_Use.

1.0.2

  • Fixed the door failing to open on every spot. The wood frame is switched on when it is created, so it gets a network id.
  • Removed the lookup of Player.m_placeDenied. That field is gone from Valheim and was logging a Harmony warning whenever the tome was refused.

1.0.1

  • Tome of Town Portal, crafted at a workbench. Left Alt + H opens a blue wood portal beside you. A saved Alt+T or Shift+T binding is switched to that chord on launch.
  • Console spawn names are TownPortal_MysteriousTome and TownPortal_Tome.
  • The portal uses the wood portal model only. It is not on the stone-portal network and does not pair with tagged portals.
  • Walking through sends you to the caster's claimed bed, or the starting stones if they never claimed one. Other players can follow.
  • A return field, about one Viking tall, appears at that spawn the first time someone goes through. It does not push players or furniture. Press E. The hover text shows the time left.
  • Both ends last 15 minutes, then disappear together. The Nowhere Like Home buff tracks that same timer. If the caster uses the return gate, both ends close immediately and the buff ends. Everyone else can pass until then.
  • The tome rests for 5 minutes after a successful open. Opening again replaces your previous door.
  • The door opens on the nearest ground beside you, including at the starting stones and in grass. It refuses only open water.
  • Ore and other cargo follow the same rule as a wood portal, including the world's portal setting.
  • Mysterious Tome is an extra 1-in-4 roll on Meadows and Black Forest loot chests. It does not take a slot from anything already in the chest, including axe heads. Barrels and chests you placed are left alone. It does not stack.
  • Haldor sells a Mysterious Tome for 250 coins after the Elder is dead.