About this mod
Disable or enable each of the random attack events (aka "raids"). Avoid having to dig ditches or hoe up 8 level walls to protect your Meadows build from Trolls. Enjoy the silver age without a pack of woofs snapping at yo ass. Stop goblins appearing INSIDE YOUR BUILD AREA.
- Requirements
- Permissions and credits
- Changelogs
Disable or enable each of the random attack events (aka "raids"). Avoid having to dig ditches or hoe up 8 level walls to protect your Meadows build from Trolls. Enjoy the silver age without a pack of woofs snapping at yo ass. Stop goblins appearing INSIDE YOUR BUILD AREA.
Installation
This solution depends on BepInEx for Valheim which must be installed first. Unzip the download file and copy SKKDisableRandomEvents.DLL to the BepInEx/Plugins folder.
Configuration
A config file BepInEx/config/SKK.DisableRandomEvents.cfg is created on the first run. Default configuration is active, but it does nothing to your game until you set individual events to disabled in the configuration file.
Operation
Setting EventNameEnabled to false will prevent that event from being started whilst the mod is active, and shut down that event if it is running.
This does not stop random patrol spawns which increase at night.
Setting EventNameEnabled to true does not cause that event to be instantly available regardless of game state. There are other global game event trigger dependencies which you can read about on the wiki page (enabled by/disabled by).
There is some lightweight validation on the EventChance and EventIntervalMin values that should trap major issues to prevent them being applied.
For updates or hot changes to the configuration file whilst the game is running to take effect (e.g. dedicated servers) the TerminalDumpCommand needs to be used to load and apply the new config.
Multiplayer Servers
This simply flips exisiting attributes on the local events table and works in all game contexts: single player, player server and dedicated servers. Anyone can run it, but for multiplayer it MUST RUN ON THE HOST/SERVER as random events are only ever started on a host server:
StartRandomEvent() ... if (!ZNet.instance.IsServer()) return;
Dedicated Servers
The newer bats/gjall/seeker events are not added to the events table with all the original events but injected sometime later, probably a patch postscript. The late binding playerspawn events used to trap that on player servers are not available on dedicated servers so there is no way to individually disable those new events on dedicated servers. A user reported workaround is to blunt force trauma disable ALL random base attacks events by setting:
ModifyEventChance = true
EventChance = 0
ModifyEventIntervalMin = true
EventIntervalMin = 999999
Known Issues
none known.
Support
Validate the solution is running in your game by (a) the presence of the config file and (b) using the TerminalDumpCommand in the terminal (aka console). If the config file is not generated, the mod is not running for whatever reason is specific to your game config.
2. User posts are available here, or use the SKK Mods Discord Valheim channel at https://discord.gg/tgKNT77DC8