Jump to content

A15 (A16?) Animal Snares


Recommended Posts

This is a trap you can place to capture animals.


The chicken coop will give you two options. You can either wait for it to spawn a chicken nest that you can loot for eggs and feathers or you can destroy the coop before it gets the nest to kill the chicken and get some meat.



I also include an optional recipe book if you want to have it gated. If you have questions or discover any problems please let me know.



This code can just be added to the items.xml:










Loot.xml (NOTE: You'll want to put this near the bottom of your loot.xml. If you place this above the file's rabbit+hide or pig+hide loot groups then it will not work.)






     <!--Animal Snare-->
  <material id="snare">
     <property name="Hardness" type="float" value="0.2" />
     <property name="explosionresistance" value="0" />
     <property name="stepsound" value="cloth" />
     <property name="lightopacity" value="4" />
     <property name="stability_glue" value="2" />
     <property name="Mass" type="int" value="1" />
     <property name="StabilitySupport" value="false" />
     <!--Animal Snare END -->	  



Custom Icons:



Optional: Recipe Book



<item id="2015" name="recipebookAnimalTraps">
	<property name="DescriptionKey" value="recipebookAnimalTrapsDesc"/>
	<property name="Extends" value="schematicMaster" />
	<property class="Action1">
		<property name="Recipes_to_learn" value="animalSnare,chickenCoop" />



Loot.xml add this line to either your rareBooks or commonBooks lootgroup, according to which one you want it classed as.


	<item name="recipebookAnimalTraps"/>




Optional 2:

Add this to your localization text file in the config folder.


recipebookAnimalTrapsDesc,items,Item Book,,This book teaches you how to make animal snares and chicken coops.,,
chickenCoop,blocks,Traps,,Chicken Coop,,
chickenCoopDesc,blocks,Traps,,Place this outside and wait for it attract a chicken to build a nest or destroy the block to kill the attracted chicken to get meat.,,
animalSnare,blocks,Traps,,Animal Snare,,
animalSnareDesc,blocks,Traps,,Place this outside and wait for it to spring up and catch an animal.,,

Link to comment
Share on other sites


Sorry if I wasn't clear. Make the snare and place it. When you first make it, its baited. So you're good. Now you just have to wait. Once the food is caught and you loot it THEN you need to rebait it with corn. When you first craft it though it's already baited as corn is part of its recipe. I've added a picture to the OP so hopefully that helps.




Interesting, I never considered the shopping baskets. Makes sense.

Link to comment
Share on other sites

The loot container the captured version uses to give you loot is set to destroy on close - like animals are.


<lootcontainer id="90" count="1" size="3,1" destroy_on_close="true" sound_open="UseActions/open_animal" sound_close="UseActions/close_animal" open_time="2.5" loot_quality_template="baseTemplate">

<item group="rabbit+hide" />

<item group="pig+hide" prob="0.3" />




I give the Captured version no drop event and set it to "downgrade" into the unbaited version.


<block id="1731" name="Animal Snare (Captured)">

<property name="CustomIcon" value="poleBlockWoodPainted1" />

<property name="Class" value="Loot" />

<property name="LootList" value="90" />

<property name="Material" value="snare" />

<property name="Shape" value="Pole" />

<property name="Texture" value="56" />

<property name="FuelValue" value="9" />

<property name="HeatMapStrength" value="5"/>

<property name="HeatMapTime" value="1200"/>

<property name="HeatMapFrequency" value="1"/>

<property name="DowngradeBlock" value="Animal Snare (No Bait)" />

<drop event="Destroy" count="0" />





What this means is that the block destroys itself after looting but since it has a downgrade block it turns into that. Think of it like reinforced wood frames and how you can never completely destroy them with one hit - you have to cycle through its downgrade stages (reinforced wood - wood frames).

Link to comment
Share on other sites

  • 1 month later...

Val i think your a great modder and everything you have made is a welcome addition. I use all your mods except the exp book one, your instructions are always clear and easy to follow and this one was no exception except i cant seem to find the recipe after reading the trapping book. Iv'e searched for Animal, Animals, animal, Snare and snare etc and dont see them. Im quite sure ive installed it correctly, its pretty straight forward but just can't seem to see it for some odd reason. Any idea's??

Link to comment
Share on other sites

I thank you for your kind words, Hadez. I'm glad you enjoy them.


Searching for snare should be all that is required. If the recipe does not work I typically suspect the fault is another recipe. You see the recipe file is one of the few files that you can break but still run the game fine. The break isn't made obvious. Though you can sometimes see it in the console if you manually open it and look. If just one recipe is broken it will effect all the recipes bellow it.


Think of it like this:









Imagine those are all recipes and the order above is the order for which they are presented in the xml. If the Bed recipe is broken it will also break all the ones beneath it, even if they are not broken themselves. It only takes one broken link for the chain to fail.


I would look at the recipes.xml and find the last recipe that works. Find the last recipe that works then you know the one beneath it is the trouble-maker.


Of course the problem could be unrelated to the recipes.xml. To help confirm can you open the creative menu and see if it shows up there? If the block exists then it is just an issue with the recipe. If you can't find the snare in the creative menu then there is a problem with the block itself. If that was the case I'd make sure you remembered to add the material to the material.xml



Finally if you have any trouble with this you can send me a zip file of your config folder and I can look at it personally to scout out the problem. :)

Link to comment
Share on other sites

Well duh on me, lol.. I completely overlooked the materials entry. Amazing how that works like a charm when i actually input the entire code where it belongs. Now sure how i did that but everything working as advertised now :) Much appreciated man. May i ask a few parting questions?? How do the snares work exactly? For instance do they need to be near an area with animals or is it just a random over time thing. And what time frame we talking, a day, several etc etc?

Link to comment
Share on other sites

I wish they had to be near animals. Sadly that's a mechanic that would require a lot more than just xml modding. They work no matter where you place them and you can place them anywhere.


The time they take is, sadly, not terribly long. There a is a limit to how long "upgraderate" can tick, according to XML. It is why I made an extra one just to artificially add time to it. I'm not positive what the number represents. I suspect real-world minutes. So in this case it would take 30 minutes. Or whatever 30 rate equals. For context I believe it takes 15 ticks for animal goreblocks to turn to dirt and for reinforced concrete to harden, I believe.


I could had perhaps made them plants instead of 'upgraderated" to have access to longer timers and only work in the sunlight. I might at some point, should the current version not suffice.



For more general instructions: Make the snare and place it. When you first make it, its baited. Now you just have to wait. Once the food is caught and you loot it THEN you need to rebait it with corn (hold corn and act like you're repeating it).


Does that answer your questions?

Link to comment
Share on other sites

  • 5 weeks later...
  • 1 month later...
  • 3 months later...

That has always been my dream for this game as well. It would be so cool to have to take care of a small village of people. I would like to see progression and skill s tied to it as well. Perhaps the NPC you rescued and brought home used to be a carpenter before the apocalypse. Keep him alive and fed and he will slowly teach you skills of the carpentry trade.


As soon as NPC's are added if it's not like that I will mod it that way if at all possible

Link to comment
Share on other sites

Its possible you added the recipes incorrectly. Next time you start the game open the console with the ~ key and scroll up. Do you see any red text telling you of a recipes.xml error? If not send a copy of your config folder and I'll see if I can spot the issue for you.

Link to comment
Share on other sites

Ideally you'd zip the folder up and share it via some online storage provider.


If I knew what gave the error I wouldn't need the entire files to find out.


But if not sharing the folder is not possible then load up the game and then close it. Then share a pastebin.com link with the output log the game generated. Its in the 7DaysToDie_Data folder. Hopefully it will have the problem in it somewhere.

Link to comment
Share on other sites

  • 1 month later...

I am trying to use this on 14.6. I am not getting any errors on start up and I can see the items in the craft menu and make everything.


1. When I place the chicken coop and animal snare on the ground I have animalFeed in my inventory I use a wrench right click to repair and I see the icon show in the bottom right that I am missing animalFeed. I have the code for loot.xml at the very bottom of the list. Any ideas on how I can get this working?


2. On the first page it talks about corn as the feed but the code has me making animalFeed from pine and maple seeds is that how it is intended?

Link to comment
Share on other sites

1. Its because you are trying to upgrade it using a wrench. Use the animal feed directly.


2. This topic was created last year. While the code is updated for the A14.6 alpha many of the posts beneath the original post in this topic are referring how it was "back in the day". At one point in time the recipe for animal feed was corn.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...