StructureDamageManager
Your buildings take no rain damage; optionally no hits from creatures and players or no damage at all, and damaged pieces repair themselves while you are near. Client-side.StructureDamageManager
Your buildings stop taking rain damage. Optionally they shrug off hits from creatures and players, or become immune to every kind of damage, and damaged pieces repair themselves while you are around. Each of these is a setting in the config file or, in game, in the ModSettings mod. Out of the box only the rain protection is on.
What it does
Rain and water. In the game an unroofed piece that gets wet loses 5% of its health every minute, down to half. With PreventRainDamage on (the default) a player-built piece never loses health to rain or to standing in water. It still looks wet, and a wet piece still does not catch fire, exactly as before.
Damage mode. DamageMode picks what else the pieces are immune to:
| Value | Blocked | Still vanilla |
|---|---|---|
Off (default) |
Nothing beyond the rain setting. | Everything. |
NonEnvironment |
Hits from enemy creatures, tamed creatures and players, yourself included. | Loss of support, ash, lava, snow, falling trees, fire. |
Friendly |
Hits from tamed creatures and players, yourself included. | Enemy hits and everything environmental. |
All |
Every hit and every kind of wear: rain, water, loss of support, Ashlands ash and lava, Deep North snow, falling trees, fire, events. | Nothing. A piece in the air stays in the air. |
A blocked hit shows no damage number and no hit effect. Raids still spawn and the creatures still attack; they just do not get anywhere. Taking a piece down with the hammer works as always.
Auto-repair. With AutoRepair.Enabled on, a damaged player-built piece anywhere in the loaded world around you is repaired to full health once it has been damaged for AutoRepair.DelaySeconds (60 by default). The delay lets a raid leave its marks until it is over, instead of healing a wall between two troll swings; set it to 0 to repair at once. The repair is silent: no sparkle, no sound, no message, no stamina, no hammer, and no workbench needed, so roads, outposts and portals far from any bench are covered too. A piece inside a ward you have no access to is left alone, as the hammer would leave it.
Which pieces. Everything a player has placed, by you or by anyone else: walls, floors, roofs, furniture, workbenches, portals, torches, the lot. Ruins, dungeons and other structures the world spawned are never touched, and neither are ships and carts.
Multiplayer
Client-side only. Only the player who wants the protection needs the mod; the server and other players need nothing.
One thing to know: in Valheim every world object is simulated by one client, normally the player nearest to it. Rain and damage protection apply to the pieces your client simulates. Playing alone that is every piece around you. On a shared server a piece that another player stands closer to is run by that player's game, and its damage is decided there, with or without your mod. Auto-repair does not have this limit: a repair is a request to whoever runs the piece, so it works on any loaded piece you have ward access to.
Config
BepInEx\config\rhenn.structuredamagemanager.cfg, created on the first start. Every change applies at once, from the file or from the ModSettings window.
| Key | Default | Meaning |
|---|---|---|
General.PreventRainDamage |
true |
Player-built pieces take no rain or water damage. |
General.DamageMode |
Off |
Off, NonEnvironment, Friendly or All; see the table above. |
AutoRepair.Enabled |
false |
Damaged player-built pieces repair themselves. |
AutoRepair.DelaySeconds |
60 |
Seconds a piece must stay damaged before it is repaired (0 to 600). 0 repairs at once. |
[General]
PreventRainDamage = true
DamageMode = Off
[AutoRepair]
Enabled = false
DelaySeconds = 60
Performance
The mod adds no loop of its own. The game already visits every loaded piece in batches of fifty a frame to apply wear; the mod does its checks inside those visits, a few field reads per piece. Hits are looked at only when they land. Nothing runs per frame for a piece that is not being visited.
Seeing what the mod decided
With Debug added to LogLevels in BepInEx\config\BepInEx.cfg, BepInEx\LogOutput.log gets a line for every blocked hit (Blocked 40 damage to wood_wall from Troll (enemy, NonEnvironment)) and every repair (Repaired wood_wall at (x, y, z) after 61 s (owner: True)). Rain protection logs nothing; it would be a line every few seconds per piece.
Known limits
- On a shared server, protection covers the pieces your client simulates (see Multiplayer). Auto-repair covers every loaded piece.
Allkeeps unsupported pieces up but does not change the support colours the hammer shows; a red piece is still red, it just does not fall.- The vanilla world modifier "No building damage" switches off every kind of wear for the whole world. With it on, this mod's rain setting and
Allmode have nothing left to do, andNonEnvironmentandFriendlystill block hits.
Bugs and feedback
Found a bug? Email a screenshot and the steps to reproduce it to [email protected], with the mod version and your BepInEx\LogOutput.log attached. I check that inbox once a week.
