joeyparrish-FarmCounter icon

FarmCounter

FarmCounter lets you add special tags to a sign that will be replaced with counts of nearby creatures.

Last updated 2 years ago
Total downloads 2325
Total rating 5 
Categories Tweaks Misc Tools Crafting Client-side Utility
Dependency string joeyparrish-FarmCounter-1.0.5
Dependants 9 other packages depend on this package

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.1901 icon
denikson-BepInExPack_Valheim

BepInEx pack for Valheim. Preconfigured and includes unstripped Unity DLLs.

Preferred version: 5.4.1901

README

FarmCounter - A Valheim Mod by Joey Parrish

Source: https://github.com/joeyparrish/valheim-farmcounter

FarmCounter Preview Video
FarmCounter Preview Video

About

FarmCounter lets you add special tags to a sign that will be replaced with counts of nearby creatures.

For example, $tame_boar would be replaced with a count of "nearby" tamed boars, while $wild_deer would be replaced with a count of "nearby" wild deer.

See the definition of "nearby" below.

Installation

FarmCounter is published on both ThunderStore and Nexus Mods. Install using your favorite mod manager.

Tags for vanilla tameable creatures

Creature Tag
Tame Boar $tame_boar
Tame Piggy $tame_boarpiggy
Tame Wolf $tame_wolf
Tame Wolf Cub $tame_wolfcub
Tame Lox $tame_lox
Tame Lox Calf $tame_loxcalf

Tag construction

A tag has a prefix and a suffix.

The prefix is either $tame_ to count tame creatures, $wild_ to count wild creatures, or $all_ to count both.

The suffix is the untranslated name of a creature. A full list can be found in Jotunn's docs on translation data. If the name is $enemy_boar, the suffix is simply boar.

So, for example, $all_goblin would count all nearby Fulings. If you're using a mod like AllTameable or Pokéheim, then any creature could be considered tame.

Extended tag syntax for modded creatures

Modded creatures that don't follow the normal $enemy_ pattern in m_name can still be counted. There is an extended syntax that you can use for names that contain spaces or don't follow normal patterns.

Extended tags take the form of ${tame_...}, ${wild_...}, or ${all_...}, where the ... part is the exact m_name for the modded creature. It can contain any character but }.

For example, when using the OdinHorse mod, there is a creature with m_name set to $odin_horse. To count tame horses, use the tag ${tame_$odin_horse}.

For another example, AllTameable creates baby deer with m_name set to Mini $enemy_deer. To count tame baby deer, use the tag ${tame_Mini $enemy_deer}.

Defining "nearby"

Valheim defines your "base" as anything in range of your workbenches, so this mod uses a similar definition.

A creature is in range of your sign if it is range of any workbench in range of your sign.

In vanilla Valheim, workbenches have a 20 meter range. If you're using a mod such as Valheim Plus, FarmCounter will detect the overridden distance from the other mod and use that instead.

To determine the number of nearby workbenches, you can use the special debugging tag $all_workbench.

Dependencies

Just BepInEx.

Incompatibilities

None that we know of!

Multiplayer

If someone is not using the mod, they will simply see the raw tag on the sign.

Links

Credits

FarmCounter was created by Joey Parrish.