You are viewing a potentially older version of this package. View all versions.
Cartur-Carturs_Feeding_Trough-1.2.0 icon

Carturs Feeding Trough

A buildable trough your animals eat out of. Fill it and they come, so taming and breeding stop needing food thrown on the floor. Optional: more animals per breeding pen, more tameable animals, drops from fed animals. Taming bar with the time left.

Date uploaded 2 weeks ago
Version 1.2.0
Download link Cartur-Carturs_Feeding_Trough-1.2.0.zip
Downloads 232
Dependency string Cartur-Carturs_Feeding_Trough-1.2.0

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2333 icon
denikson-BepInExPack_Valheim

BepInEx pack for Valheim. Preconfigured with the correct entry point for mods and preferred defaults for the community.

Preferred version: 5.4.2333
ValheimModding-Jotunn-2.30.2 icon
ValheimModding-Jotunn

Jötunn (/ˈjɔːtʊn/, 'giant'), the Valheim Library was created with the goal of making the lives of mod developers easier. It enables you to create mods for Valheim using an abstracted API so you can focus on the actual content creation.

Preferred version: 2.30.2

README

Cartur's Feeding Trough

A trough your animals eat out of, so you stop throwing food on the floor.

Build it with the hammer under Furniture. It costs 10 wood and needs a workbench. It opens like a chest. Fill it and walk away.

Tamed boars gathered at a feeding trough

What it does

A hungry boar, wolf, lox, hen or any other tameable animal looks for food the way it normally would. If there is none on the ground, it tries the troughs in range, nearest first, and eats from the first one that holds something it will eat. The trough puts one item in the bowl for it, so the animal eats it exactly as it would eat food dropped on the floor. Everything that follows from a meal follows from this one too, so taming progresses, breeding is unblocked and tamed animals stay fed. How far an animal will look is the game's own food search range for that animal. The mod has no range setting for that search.

The bowl shows what is in it. Put berries in and you see berries. It is drawn from the items' own models and is local decoration only, so there is nothing to pick up and nothing to desync.

A buildable piece is something the AI can decide to attack, and a plain chest is on the "walk over and break it" list, which is the one thing you do not want from the object you use to lure animals in. That is turned off here, so animals won't go out of their way to smash the trough. A raid that is already fighting you can still wreck it.

An animal that is being tamed gets a yellow bar under its health bar, and its hover text gains the time left. Both read the game's own taming countdown, so the bar stalls exactly when the taming does, while the animal is hungry or frightened. Vanilla already tells you which of those it is. This only tells you how long.

Eight slots

The inventory is four by two. A trough is a meal, not a pantry. Any food the animal eats works. It is the game's own list per creature and not one written down in the mod, so a modded animal that eats something new eats it out of the trough too.

Multiplayer

It works. The trough is a container like any other. Whichever player's client is running a hungry animal feeds it from the trough. If the trough is not open, that client takes ownership of it first, so two animals do not eat the same berry twice. Nothing is taken out of a trough somebody else has open.

Settings

All in BepInEx/config/cartur.feedingtrough.cfg. Nothing below changes the game until you change it. Breeding and drops run on whichever machine owns the animal, so on a dedicated server the mod has to be installed on the server too.

Breeding (restart the game after changing)

  • MaxCreaturesMultiplier (default 1, the game's own limit). How many animals of one kind breed in one spot: the game stops breeding when adults plus young reach 4 to 10 depending on the animal, which is why a well-fed pen quietly stops. 4 takes a boar pen from 5 to 20, and a hen run from 10 to 40.
  • MaxCreaturesMinimum (0), TotalCheckRangeOverride (0, up to 64 m) and PartnerCheckRangeMultiplier (1) tune the same check. The count range is capped at 64 m because the game only counts animals that happen to be loaded beyond that.

Taming (restart the game after changing)

  • MoreTameableAnimals (default false). The bear (Bjorn), Neck, Hatchling and Deathsquito become tameable and breed into more of themselves, eating foods the mod lists.
  • ExtraTameables (empty). More animals, including ones from other mods, written Prefab:Donor:Food,Food and separated by semicolons, for example Neck:Boar:FishRaw,RawMeat. The donor is a vanilla tameable (Boar, Wolf or Lox) whose taming effects and numbers are copied. Only creatures with MonsterAI and Humanoid can eat, so deer, hares and seals cannot be added.
  • ListTameCandidates (false). Writes the prefab names of every creature that could be made tameable, other mods' included, to the BepInEx log at startup.

Production (restart the game after turning it on)

  • PassiveProduction (default false). A fed, tame animal periodically drops a share of what it would give if killed: hide, pelt, feathers, fangs. Meat and trophies never come this way. A few well-kept animals instead of a big farm. ProductionInterval (600 s) is how long it must stay fed between drops, going hungry restarts the count, and ProductionPercent (0.25) is the share of a kill's drops.

Reach

  • ConfinedReach (default 0, off). For pens and towers where an animal sits in a tight cell beside the trough and never eats. Above 0, an animal that many metres or closer, with nothing solid between it and the bowl, is fed even when the game finds no walking path to the trough. Try 3 for a 2x1 or 2x2 cell.

Compatibility and known issues

Requires Jötunn, which registers the piece and renders its build-menu icon.

The trough is a reskinned wood chest under the hood, so it inherits the chest's build snapping and destroy behaviour. That is deliberate. It is what keeps the mod small enough to survive a game update.

Install

Use a mod manager (r2modman, Thunderstore or Gale) and it pulls in BepInEx and Jötunn for you. To install by hand, drop CarturFeedingTrough.dll into BepInEx/plugins along with Jötunn.


Discord: bug reports, install help, and mod requests. Bug reports get their own thread so nothing is lost in a chat scroll, and requests are voted on.

Free, and always will be. If it improved your game you can tip me on Patreon.

More from Cartur: HD Blood · Map Pins · Compass and Clock · Safe Stamina · Follow Command · Flooring · UI HUD · Waste Management · Combat Text

CHANGELOG

Changelog

1.2.1

  • Animals that eat Raw Fish now eat caught fish. A fish caught with a rod (Perch, Pike, Tuna and the rest) is a different item from Raw Fish, so a Neck, a bear or a Hatchling given one walked past it. Anything that eats Raw Fish now eats every fish the game counts as a fish, from a trough or off the ground. A fish lying on the ground also sits on a layer the animals' food search never looks at, so loose fish are now looked for as well, only while they are out of water (a live fish in a pond is left alone).
  • Tested in the game (Valheim 1.0.20, Release build): a tamed Neck ate a caught fish off the ground in 12 seconds, the same as Raw Fish, and out of a trough (6 fish in it, then 5, and the animal stopped being hungry). Not tested: the other kinds of caught fish, other animals eating fish, multiplayer.

1.2.0

Cartur's Husbandry, which was never released on its own, is part of the trough now. Every new setting is off or at the game's own value, so an existing trough, pen and config behave as before.

  • Breeding limits. MaxCreaturesMultiplier (1 = the game's limit), MaxCreaturesMinimum, TotalCheckRangeOverride and PartnerCheckRangeMultiplier. The game stops breeding when the adults plus the young near a pen reach 4 to 10 depending on the animal (Procreation.Procreate, read from the game's code); this lifts that. Applied when an animal loads, so restart the game after changing them.
  • More tameable animals. MoreTameableAnimals makes the bear (Bjorn), Neck, Hatchling and Deathsquito tameable and able to breed into more of themselves. ExtraTameables adds any other creature, ones from other mods included, as Prefab:Donor:Food,Food;.... ListTameCandidates writes the creatures that could be added to the log. Creatures without MonsterAI and Humanoid (deer, hares, seals) cannot eat and cannot be added.
  • Passive drops. PassiveProduction, ProductionInterval, ProductionPercent. A fed tame animal gives a share of its non-food, non-trophy drops on a timer, without being killed. Going hungry restarts the count.
  • Tested in the game (Valheim 1.0.20; the first runs on a Debug build, the last ones on the Release build): with the multiplier at 4, 8 tamed boars made 19 young and stopped near the cap (14 young on the Release build), and at 1 they made none; the live cap read 5 at 1 and 20 at 4 for a boar and 40 at 4 for a hen; six animals of each of the bear, Neck, Hatchling and Deathsquito bred into 18, 21, 13 and 15; a vanilla boar, then the bear, Neck, Hatchling and Deathsquito, each placed untamed 70 m from the player with one food item beside it, ate it and were tamed within 6 s (taming time cut to 6 s for the test); with PassiveProduction on and a 30 s interval a boar dropped one LeatherScraps about 30 s after its timer started (on the Release build too) and no meat or trophy, and the timer restarted after the animal went hungry (27 s old after 14 s of hunger, 9 s old 12 s after it was fed again); ListTameCandidates listed 140 creatures; the existing ConfinedReach test still has a boar eating within about 2 s at 3. Closer than that the bear, Hatchling and Deathsquito stayed alerted to the player and were not tamed: the game only counts taming time while the animal is not alerted, as for a wolf. Not tested: a real creature from another mod (Neck stood in for one), so ExtraTameables may not work for every creature; a dedicated server; other languages' food names.

1.1.0

  • New setting ConfinedReach (default 0, which changes nothing). For pens and towers where an animal sits in a tight cell beside the trough and never eats from it. In the game's own code the animal walks to the food along a path, the food sits inside the trough's collider, and in a small cell that path leaves the cell, so the animal stands still facing away from the trough. With ConfinedReach above 0, an animal that many metres or closer, with nothing solid between it and the bowl, is offered food and treated as having arrived, and the game then turns it to the food and lets it eat. 3 suits a 2x1 or 2x2 cell. It is in BepInEx/config/cartur.feedingtrough.cfg and takes effect at once.
  • Tested with a boar in a 2x1 wall cell on the ground, on a floor 6 m up, and on a floor with the trough tilted 26 degrees: with the setting at 3 it ate within a second every time; with it at 0 it did not eat on the ground. Not tested on a dedicated server, or with real sloped roof pieces.

1.0.5

  • Large animals, such as the horse from OdinHorse, are now offered food from the trough. Before, the trough's reachability check failed for them, so they were never offered food unless they were already within about 2 m.

1.0.4

  • New icon in the Cartur's Mods style. The mod itself is unchanged from 1.0.3 (BepInEx still reports 1.0.3).

1.0.3

  • In-game screenshots in the README. No code changes.

1.0.2

  • The README is rewritten: a fuller description of what the mod does, every setting and default checked against the code, and image captions that match the pictures. No code changes.

1.0.1

  • Multiplayer: animals eat from a trough another player owns. Before, an animal only ate if the same player owned both it and the trough, so animals could go hungry beside a full trough. A trough that someone has open is still left alone.
  • Animals try every trough in range, nearest first, so an empty trough no longer hides a stocked one a few metres further away.
  • Bait stays in the bowl after the area reloads.
  • Fixed a possible error in the taming bar.

1.0.0

First release.

  • A buildable Feeding Trough: hammer, Furniture, 10 wood at a workbench.
  • Animals walk to it and eat from it, which feeds taming, breeding and upkeep.
  • The bowl shows what is in it.
  • Animals no longer pick the trough as something to walk over and smash.
  • A taming bar under the health bar, and the time left in the hover text.