Valheim
0 of 0

File information

Last updated

Original upload

Created by

SKKmods

Uploaded by

SKKmods

Virus scan

Safe to use

Tags for this mod

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.

Spoiler:  
Show

## Enable/disable this solution.
# Setting type: Boolean
# Default value: true
PluginEnabled = true

## Enable/disable debug logging.
# Setting type: Boolean
# Default value: false
DebugOutput = false

## Terminal command to reload config and dump event info (can not switch PluginEnabled).
# Setting type: String
# Default value: SKKDisableRandomEvents
TerminalDumpCommand = SKKDisableRandomEvents

## Set the EventChance value (if valid)
# Setting type: Boolean
# Default value: false
ModifyEventChance = false

## Random Event base chance 0 to 100 (affects all enabled events).
# Setting type: Single
# Default value: 20
EventChance = 20

## Set the EventIntervalMin value (if valid).
# Setting type: Boolean
# Default value: false
ModifyEventIntervalMin = false

## Interval in real minutes to roll a new event >= 1 to set (affects all enabled events).
# Setting type: Single
# Default value: 46
EventIntervalMin = 46

## Eikthyr rallies the creatures of the forest
# Setting type: Boolean
# Default value: true
ArmyEikthyrEnabled = true

## The forest is moving...
# Setting type: Boolean
# Default value: true
ArmyElderEnabled = true

## A foul smell from the swamp
# Setting type: Boolean
# Default value: true
ArmyBonemassEnabled = true

## A cold wind blows from the mountains
# Setting type: Boolean
# Default value: true
ArmyModerEnabled = true

## The horde is attacking
# Setting type: Boolean
# Default value: true
ArmyYagluthEnabled = true

## The ground is shaking
# Setting type: Boolean
# Default value: true
TrollShakeEnabled = true

## Skeleton Surprise
# Setting type: Boolean
# Default value: true
SkeletonSurpriseEnabled = true

## There's a smell of sulfur in the air
# Setting type: Boolean
# Default value: true
SurtlingSmellEnabled = true

## A foul smell from the swamp
# Setting type: Boolean
# Default value: true
BlobSmellEnabled = true

## You are being hunted
# Setting type: Boolean
# Default value: true
WolfHuntEnabled = true

## You stirred the cauldron
# Setting type: Boolean
# Default value: true
BatsEnabled = true

## What's up, Gjall!?
# Setting type: Boolean
# Default value: true
ArmyGjallEnabled = true

## They sought you out
# Setting type: Boolean
# Default value: true
ArmySeekersEnabled = true



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 on dedicated servers by setting:

ModifyEventChance = true
EventChance = 0
ModifyEventIntervalMin = true
EventIntervalMin = 999999



Known Issues

none known.


Compatibility

Updated for 0.214.2 Mistlands 
Updated for 0.217.14 to disable [ TerminalCommand ] (Field 'Terminal._input' not found)


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.

Spoiler:  
Show

SKK.DisableRandomEvents *************************************** 
SKK.DisableRandomEvents,TerminalDumpCommand,SKKDisableRandomEvents
SKK.DisableRandomEvents,IsServer,True
SKK.DisableRandomEvents,IsDedicated,False
SKK.DisableRandomEvents,IsPointInsideArea,PlayerBase (EffectArea)
SKK.DisableRandomEvents,m_eventChance,20
SKK.DisableRandomEvents,m_eventIntervalMin,46
SKK.DisableRandomEvents,m_randomEventRange,96
SKK.DisableRandomEvents,army_eikthyr,m_enabled,True 
SKK.DisableRandomEvents,army_goblin,m_enabled,False 
SKK.DisableRandomEvents,army_theelder,m_enabled,False 
SKK.DisableRandomEvents,wolves,m_enabled,False 
SKK.DisableRandomEvents,skeletons,m_enabled,False 
SKK.DisableRandomEvents,army_bonemass,m_enabled,False 
SKK.DisableRandomEvents,army_moder,m_enabled,False 
SKK.DisableRandomEvents,blobs,m_enabled,False 
SKK.DisableRandomEvents,foresttrolls,m_enabled,False 
SKK.DisableRandomEvents,surtlings,m_enabled,False 
SKK.DisableRandomEvents,boss_eikthyr,m_enabled,True 
SKK.DisableRandomEvents,boss_bonemass,m_enabled,True 
SKK.DisableRandomEvents,boss_moder,m_enabled,True 
SKK.DisableRandomEvents,boss_gdking,m_enabled,True 
SKK.DisableRandomEvents,boss_goblinking,m_enabled,True 
SKK.DisableRandomEvents,bats,m_enabled,False 
SKK.DisableRandomEvents,army_gjall,m_enabled,False
SKK.DisableRandomEvents,army_seekers,m_enabled,False
SKK.DisableRandomEvents *************************************** 


2. User posts are available here, or use the SKK Mods Discord Valheim channel at https://discord.gg/tgKNT77DC8