Valheim

File information

Last updated

Original upload

Created by

SKKmods

Uploaded by

SKKmods

Virus scan

Safe to use

Tags for this mod

About this mod

Replace any common in game actor(s) with nothing, or any other actor in realtime. Deathsquitos a speciality, but it's an open world of opportunity to mix things up in. Replace everything with Chicken to remember the MW2019 "enemy at the chickens" callout.

Requirements
Permissions and credits
Changelogs
Replace any common in game actor(s) with nothing, or any other actor in realtime. Deathsquitos a speciality, but it's an open world of opportunity to mix things up in.  Replace everything with Chicken to remember the MW2019 "enemy at the chickens" callout.


Installation 

This solution depends on BepInEx for Valheim which must be installed first. Unzip the download file and copy SKKReplaceAnyActor.DLL to the BepInEx/Plugins folder. 


Configuration

A config file BepInEx/config/SKKReplaceAnyActor.cfg is created on the first run. Default configuration is active, but it does nothing to your game until you feed it some prefab names.

PluginEnabled [ *true | false ] totally disables all mod functions without having to remove from load order.

DebugOutput [ true | *false ] this also traps F12 hotkey to pop an on screen actor count.

PrefabNamesToRemove [ *None | Blank | Comma separated list of one or more case sensitive actor prefab names from the ValidPrefabNames list ]

RemoveChance [ Integer from 1 to *100 ] the chance that an actor will be removed. Use  -1 for totally random.

ReplacementPrefabNames  [ *None | Blank | Comma separated list of one or more case sensitive actor prefab names from the ValidPrefabNames list ] these are created totally standard matching the star level and hunt player/patrol AI of the original actor. As many biome actors are hostile to other biomes they will mostly attack each other if spawned out of biome. This does not replace event spawned actors to avoid breaking the event.

ReplaceChance [ Integer from 1 to *100 ] the chance that a replacement will be generated. Use  -1 for totally random.

ReplacementMultiplier [ Integer from 1 to madness, default 1 ]  All testing was done with values of 1 or 2. Setting higher will need the LoadedActorLimit increased if your system has the minerals for it.

LoadedActorLimit [ Integer from 1 to madness, default 48 ]  The limit of instatiated actors in the active area around the local player. Once this is reached actors will still be removed, but replacements will not be generated until existing actors can be destroyed. If Notifications are enabled there are on screen warnings when replacements suspend/resume. The base game seems to run around 20 to 40 loaded actors. Large volumes of actors can cause issues with both script processing time for AI behavior updates and frame rates.

Notifications [ *true | false ] show on screen notifications when actor replacement suspends and resumes at LoadedActorLimit  count to help tune your settings.

TerminalDumpCommand [ SKKDump ] case insensative, dumps the active game character list to debug log.

TerminalReloadCommand [ SKKReload ] case insensative, reloads configuration settings. 

ReplacementAutoTame [ true | *false ] if the replacement is tameable to sort of create unlimited follower armies.

ValidPrefabNames  This list is dynamically generated at each game load from all valid <Character> prefabs in the game. DO NOT EDIT !!! It is for reference only for your PrefabNamesToRemove and ReplacementPrefabName plus checking the prefab names of other mod added actors/characters.


Things I have used it for

Replace Greyling with Boar,Deer to reduce flint tech grind.
Replace Greydwarf_Shaman with Troll for more amusing Tin and Copper mob auto mining.
Replace Deathsquito with anything for quality of life.
Replace Everything with Chicken because why not.


Cleanup & revert to base game

If you mess up your game world with too many/unwanted actors and want to return to the base game, you can clean up in real time;

(1) Edit SKK.ReplaceAnyActor.cfg set PrefabNamesToReplace to the replacement names you don't want around, set ReplacementPrefabName to blank/none, set RemoveChance to 100, set Debug true.

(2) If the world is loaded with -console enabled then F5 console [ SKKReload ]. If not, save and load the world.

(3) Visit over-run areas to destroy the unwanted actors as the player moves through them, press the F12 key to check actor counts, should be less than 30. 

(4) Edit SKK.ReplaceAnyActor.cfg set PrefabNamesToReplace to blank/none set Debug false.

(5) If the world is loaded with -console enabled then F5 console [ SKKReload ]. If not, save and load the world. Normal base game actor spawns will resume.


Multiplayer servers

This is a client-side mod. To avoid conflicts in a multiplayer environment, it will only run on the server/host game instance. It will automatically disable itself (MultiplayerLock) with a notification on any clients running the solution that join a server for that session. There has been no design consideration or testing of dedicated servers.


Compatibility

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


Known Issues

(1) This works by destroying actors to be removed via ZnetView. Sometimes that cleanup can queue forever whilst loaded (around 1%), so if an actor that is queued for destruction is still in the active character list at the next trigger, its drops are disabled and it is killed to force the GameObject destruction. You may occasionally see/hear those random death FX in the distance.


Support

1. Validate the solution is running in your game by (a) the presence of the config file and (b) using the TerminalCommand 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.ReplaceAnyActor.***********************************************
SKK.ReplaceAnyActor.Settings.PluginEnabled,True
SKK.ReplaceAnyActor.Settings.DebugOuput,True
SKK.ReplaceAnyActor.Settings.DebugHotkey,F12
SKK.ReplaceAnyActor.Settings.TerminalDumpCommand,SKKDump
SKK.ReplaceAnyActor.Settings.TerminalReloadCommand,SKKReload
SKK.ReplaceAnyActor.Settings.PrefabNamesToRemove,Greyling
SKK.ReplaceAnyActor.Settings.ReplacementPrefabNames,Boar
SKK.ReplaceAnyActor.Settings.ReplacementPrefabNames,Deer
SKK.ReplaceAnyActor.Settings.ReplacementPrefabNames,Chicken
SKK.ReplaceAnyActor.Settings.RemoveChance,100
SKK.ReplaceAnyActor.Settings.ReplaceChance,-1
SKK.ReplaceAnyActor.Settings.ReplacementMultiplier,1
SKK.ReplaceAnyActor.Settings.Notifications,True
SKK.ReplaceAnyActor.LoadedActorLimit,48,False
SKK.ReplaceAnyActor.MultiplayerLock,False
SKK.ReplaceAnyActor.NothingToDo,False
SKK.ReplaceAnyActor.***********************************************
 


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