Mods / Animal cages

Category: #Creatures #Storage #Utility
Author: Gerste
Side: Both
Created: Aug 23rd at 9:49 PM
Last modified: Oct 8th at 1:16 PM
Downloads: 972

Disclaimer: Version 2.0.1 is not downward-compatible, as I changed the domain from smallanimalcage to animalcages!

Small utility mod that adds cages for capturing, transporting and releasing animals. 

Contents:

Spoiler!

Adds two new Blocks to the game:

  • Small animal cage:
    • Attack a small animal with the cage equipped to catch it
    • Place the cage and break it to release the animal. Right click to pick it back up
  • Medium animal cage:
    • Attack an animal with the cage equipped to catch it
    • Animal can only be catched, if it is either a small animal, a domesticated animal or has less then one third hp
    • A full medium cage can only be placed in a backpack slot

Supported animals:

Spoiler!

Supports a variety of vanilla and modded animals:

  • Small animals:
    • sheep-bighorn-lamb
    • deer-fawn
    • chicken-baby
    • chicken-hen
    • chicken-henpoult
    • chicken-rooster
    • chicken-roosterpoult
    • hare-baby
    • pig-wild-piglet
    • wolf-pup
    • fox-pup-forest
    • fox-pup-arctic
    • aurochs-lamb
    • raccoon-male
    • raccoon-female
    • raccoon-pub
    • hyena-pup
    • hare-female-arctic
    • hare-female-ashgrey
    • hare-female-darkbrown
    • hare-female-desert
    • hare-female-gold
    • hare-female-lightbrown
    • hare-female-lightgrey
    • hare-female-silver
    • hare-female-smokegrey
    • hare-male-arctic
    • hare-male-ashgrey
    • hare-male-darkbrown
    • hare-male-desert
    • hare-male-gold
    • hare-male-lightbrown
    • hare-male-lightgrey
    • hare-male-silver
    • hare-male-smokegrey
  • Medium animals:
    • wolf-male
    • wolf-female
    • pig-wild-male
    • pig-wild-female
    • sheep-bighorn-male
    • sheep-bighorn-female
    • hyena-male
    • hyena-female
    • fox-male
    • fox-female
    • fox-arctic-male
    • fox-arctic-female
    • aurochs-female
    • aurochs-male
    • deer-female
    • deer-male
    • white-hart

Config:

Spoiler!

You can configure which entities are catchable by modifying the configuration file.

For example, if you want to make the buildingmaterials trader catchable, you have to do the following things:

  • open the animalcagesconfig.json file, located in your ModConfig folder
  • add the new animal:
    • ...{
      "name": "humanoid-trader-buildmaterials", // entity code of the new "animal"
      "scale": 0.4 // display scale (as the trader is to big for the small cage, we scale him down to 40% size)
      },...
  • Restart the game and capture the new entity
    • image

Version For Game version Downloads Release date Changelog Download
v2.0.3 167 Oct 8th at 1:16 PM Show animalcages_v2.0.3.zip
v2.0.2 347 Sep 10th at 7:53 PM Show animalcages_v2.0.2.zip
v2.0.1 76 Sep 8th at 11:14 PM Show animalcages_v2.0.1.zip
v2.0.0 28 Sep 8th at 11:13 PM Show animalcages_v2.0.0.zip
v1.0.1 271 Aug 24th at 10:32 PM Show animalcages_v1.0.1.zip
v1.0.0 83 Aug 23rd at 9:50 PM Show animalcages_v1.0.0.zip

16 Comments (oldest first | newest first)

WickedSchnitzel, Oct 8th at 6:15 PM

Could you add an option to define for each animal if it has to be hurt to be able to catch it? Because i dont think that players would like to beat up their private dogs until they are able to pick them up in order to replace them. :) Gerste

melodelic, Oct 8th at 4:23 PM

Yeah, the chickens are running away from me so I'll try to catch it while not moving.

Gerste, Oct 8th at 1:12 PM

The first time this issue arised I had a conversation with Fulgen in the VintageStory discord, he told about how to use the different mod paths.

I uploaded a new precompiled version to hopefully fix this as i can not reproduce the error. If the issue persists, feel free to contact me on discord WickedSchnitzel

WickedSchnitzel, Oct 8th at 12:40 PM

I am running a server for one and a half years and always dropped our mods into VintageStory/Mods and we never had any problems. So far i thought the VintageStoryData folder is for singleplayer servers. Gerste

Gerste, Oct 8th at 7:33 AM

Domesticated means the animal has a generation greater than zero, so yes, you should be able to catch your pigs with generation 1 or greater without nearly killing them.

Are your chicken standing still or running around while you are trying to catch them? When the chicken are moving, sometimes the server does not calculate a hit while the client does (so you need to consistently bash it until the server registers a hit).
If the chicken are standing still, please look inside the logs, if you can find any error-messages regarding cages. You can find the logs under /VintagestoryData/logs.

melodelic, Oct 7th at 11:17 PM

I've got two questions on how the cage works. The first is if wondering what "Animal can only be catched, if it is either a small animal, a domesticated animal or has less then one third hp"? means for large cages (and if that means I can make my gen 1+ pigs or sheep go in them without beating them to almost death). And the second is why I can't cage my gen 1 chickens into a small cage?
Gerste, Oct 7th at 8:04 PM

Do you keep your Mods in /VintageStory/Mods or /VintageStoryData/Mods?
Please make sure your Mods are placed in VintageStoryData/Mods as /VintageStory/Mods is only for the base game mods.

If this doesnt work, you can try this workaround right here.

I hope I get to releasing a precompiled version soon as I heard this might make things more stable.

WickedSchnitzel, Oct 6th at 4:57 PM

If i try to catch one of my modded pets (dog, cat etc) i'll get disconnected from the server with the following error message:

18:53:41 [Server Error] System.IO.FileNotFoundException: Could not load file or assembly 'VSEssentials, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'VSEssentials, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
   at Animalcages.BlockMediumCage.isCatchable(Entity attackedEntity)
   at Animalcages.BlockCage.OnAttackingWith(IWorldAccessor world, Entity byEntity, Entity attackedEntity, ItemSlot itemslot) in Data\Cache\unpack\animalcages_v2.0.2.zip_ff3664438b4f\src\blockcage.cs:line 38
   at Vintagestory.API.Common.EntityAgent.OnInteract(EntityAgent byEntity, ItemSlot slot, Vec3d hitPosition, EnumInteractMode mode)
   at Vintagestory.Server.ServerSystemEntitySimulation.HandleEntityInteraction(_pZfqca2BJhMktch0CcWjLhsEFXc packet, ConnectedClient client)
   at Vintagestory.Server.ServerMain.ProcessNetMessage(NetIncomingMessage msg, NetServer mainSocket)

I have already included them in the config file of your mod.
Gerste, Oct 2nd at 1:16 PM

You can find all trader files in your game folder under \assets\survival\entities\humanoid.
Then you need to open each of the files and copy the text labeled "code" into the modconfig as shown in the tutorial.

If you run into any problems, feel free to hit me up on discord: G3rste#1850

Malfiros, Oct 2nd at 12:38 PM

Whenever I edit the config file, it reverts back to the original file after loading the game. What am I doing wrong?

UPDATE: I was forgetting to put a comma after the last creature before adding any new ones.

What would you do if you wanted to be able to capture ALL traders? Would you have to list each type individually? If so, what are each of those entity names?

UPDATE: Thanks for your help! I've configured the file to my liking now. Great mod, thanks again!

Gerste, Sep 8th at 11:21 PM

I added a short tutorial on how to configure the mod.
I have tested around with some creatures. Mechanoids are not supported but drifters, traders and modded creatures should work fine.

Hope this helps :)

Braleth, Sep 6th at 3:21 PM

Neither of the posted versions contain a sample config file. Can you post a completed animalcagesconfig.json config file. The source code for the CageConfig class lists various animals, but would like to see what options you made availble via the config file.

Juliusvanvern, Sep 2nd at 10:40 AM

Would you like to know how you use it, whatch mei Video (german): 
https://www.youtube.com/watch?v=6XE5DUprSSA

Thanks for the Mod 😀

Gerste, Aug 25th at 9:15 PM

I have not played with XSkills myself. I know that Capture Animals by DArkHekRoMaNT implements something similar as well as Farm Life by jakecool19. I really liked the idea of DArkHekRoMaNT (in fact, i use the same method to capture the animal i learned by reading his code), but i wanted to try a more vanilla approach than his pokeball implementation.
Putting the animals in the already existing Cage Models just seemed right for me.

animatiV, Aug 25th at 10:19 AM

Is something like this not included in the XSkills modification?

Neerak, Aug 24th at 12:50 PM

I was just talking about needing a feature like this and bam!

delete edit