Vmod field manual

No. 04

Valheim · Jötunn · 1.0.15

Town Portal

A blue wood portal back to the bed you have claimed. Anyone can follow. The caster's trip home closes both ends.

Download 1.0.15

Thunderstore package. The dll is already inside. Upload the zip as-is.

Spawn

Turn on devcommands, open the console, and drop either book at your feet. No Elder, chest, or workbench required.

spawn TownPortal_MysteriousTome 1
spawn TownPortal_Tome 1

The first is the ruined Mysterious Tome, the recipe piece. The second is the finished Tome of Town Portal.

If a door, the cooldown, or an old map marker gets stuck, the same console clears every town portal in the world, both buffs, and the markers. Save once afterward. They stay gone.

townportal_clear

Use it

  1. Keep the Tome of Town Portal anywhere in your inventory. It is not equipped, and the door does not consume it.
  2. Press Left Alt + H.
  3. A wood portal opens on the nearest clear spot beside you. The glow is blue. It has no tag and does not pair with other portals. While it is up, the map shows a blue circle labeled with the caster's name.
  4. Walk through. You arrive at the caster's claimed bed, or the starting stones if they never claimed one.
  5. A blue field about one Viking tall stands there. It does not push players, creatures, or furniture. The hover text shows the time left.
  6. Anyone else presses E to go back to the door, and the pair stays up. They can walk through again.
  7. If you opened it, the hover says Return and close. You go back, and both ends disappear. Send visitors through first.
  8. If nobody closes it, the door, the field, and Nowhere Like Home all end together at 15 minutes. Logging out does not remove them early.

Opening a door starts The Tome Rests for 5 minutes. A new door replaces your previous one, including a return field in an unloaded area. Followers go to your bed, not theirs. Each person is checked for portal-blocked cargo.

Recipe

Craft Tome of Town Portal at a level 1 workbench. There are no upgrade levels.

IngredientAmount
Mysterious Tome1, consumed
Surtling core10
Greydwarf eye25
Leather scraps15
Deer hide5
Restored to its former glory. While it is in your inventory, Alt+H opens a door back to the bed you have claimed.

Mysterious Tome

A ruined book. The way home is still written in it, for someone willing to make it whole.
  • It does not stack. Each copy takes its own inventory slot.
  • Extra roll on loot chests in the Meadows and the Black Forest. About 1 in 4 also contain one tome.
  • The roll is separate. Axe heads and every other drop stay on their own tables.
  • Barrels are skipped. Chests a player placed are skipped.
  • Chests that already exist roll once, the first time they load with this mod, including chests you have opened before.
  • Haldor sells one for 250 coins after the Elder is dead. A tome found earlier still crafts.

On the ground both tomes are the strapped leather book. The finished tome uses that icon. The mysterious tome keeps a plain brown icon so the two are easy to tell apart.

Rules

These match a wood portal. The mod does not call portal code to do it.

  • NoPortals seals the tome. The deny sound plays and nothing is placed.
  • NoBossPortals seals it while a boss is loaded.
  • TeleportAll lets every item through. Otherwise each item's own teleport flag is checked.
  • Open water is refused. The door still opens beside you at the starting stones, inside a camp, or in grass. The deny sound is only "The door has nowhere to open."
  • The wood frame keeps its collision. Only the return field is non-solid.
  • The timer is real time. Sleeping does not burn it down.
  • The caster's return removes Nowhere Like Home immediately. The Tome Rests still finishes its 5 minutes.

Config

BepInEx/config/com.townportal.mod.cfg. The server's copy wins for every row except the open key. A saved Alt+T or Shift+T binding is switched to H + LeftAlt the next time the game starts. Restart after changing cooldown or duration.

SectionKeyDefault
ClientOpenLeft Alt + H
ServerCooldownSeconds300
ServerDurationSeconds900
ServerMysteriousTomeDropChance0.25
ServerHaldorPrice250
ServerHaldorRequiresEldertrue
ServerSearchRadius6
ServerPortalYawOffset0
DebugLogChestPrefabsfalse

If the wood frame faces the wrong way, set PortalYawOffset to 180. LogChestPrefabs writes one line per container prefab the first time it is seen.

Install

Requires denikson-BepInExPack_Valheim 5.4.2333 and ValheimModding-Jotunn 2.30.2. The download is the Thunderstore zip. Upload it as-is. r2modman places plugins/TownPortal.dll under BepInEx/plugins. Install the same dll on a dedicated server. Everyone connected needs the mod.

Test pass

  1. spawn TownPortal_Tome 1, then Alt+H. The blue wood frame is not on the portal list and has no tag.
  2. Walk through. You arrive at your bed, the return field is there, and its countdown matches Nowhere Like Home.
  3. A second character presses E and the door stays. You press E, it says Return and close, and both ends vanish. The tome is still resting.
  4. After 5 minutes a new door replaces any previous one, even if that field was far away.
  5. Ore is refused with the same message a wood portal uses. Drop it and the door works.
  6. On a world with portals disabled, Alt+H plays the deny sound and places nothing.
  7. After the Elder, Haldor sells a Mysterious Tome for 250 coins.
  8. Meadows and Black Forest loot chests sometimes hold an extra tome. Axe heads that were there are still there.
  9. A follower who walks through arrives at the caster's bed, not their own.

Not in this version: a PVP lock, a custom book mesh, and translations. Custom lines are English. The cargo refusal uses the game's own message.