All things farmable!

I’ve been wanted to add some new farmable crops to 7 days to die for quite a while now and I finally got around to doing it.

If you follow the instructions below you will be able to add:

  • Working ovens
  • Farmable Aloe
  • Farmable Cactus (Saguaro)
  • Farmable mushrooms
  • Recipes for:
    • French fries
    • Grilled mushrooms
    • Mushroom stew
    • Grilled corn

The first step is to add a recipe to turn mushrooms and aloe into seeds:

<recipe name=”aloeSeed” count=”4″ scrapable=”False” craft_time=”5″ craft_exp_gain=”2″ learn_exp_gain=”20″ >
<ingredient name=”plantAloe” count=”1″ grid=”0, 0″/>
</recipe>
<recipe name=”mushroomSeed” count=”4″ scrapable=”False” craft_time=”5″ craft_exp_gain=”2″ learn_exp_gain=”20″ >
<ingredient name=”mushrooms” count=”1″ grid=”0, 0″/>
</recipe>

This is simply the right item in the center of your crafting table and you get seeds back, like everything else.

The saguaro cactus are different and instead I treat them like trees, so in the destroy event, we spawn in some seeds:

<block id=”668″ name=”cactus01″>
<property name=”Class” value=”Cactus” />
<property name=”Material” value=”cactus” />
<property name=”Shape” value=”ModelEntity” />
<property name=”Texture” value=”390″ />
<property name=”Model” value=”Entities/Trees/Saguaro_Cactus_20Prefab” />
<property name=”Tag” value=”TreeTrunk” />
<property name=”Damage” value=”5″ />
<property name=”UpwardsCount” value=”2″ />
<property name=”IsPlant” value=”true” />
<drop event=”Destroy” name=”foodYuccaFruit” count=”1,2″ prob=”1″ />
<drop event=”Destroy” name=”cactusSeed” count=”1,2″ prob=”1″ /> <!– this is the line you need to add –>
</block>

You’ll want to add that drop event to cactus01, 02 and 03.

You’ll next need to make sure you have items in your items.xml to represent all these new seeds.

<item id=”752″ name=”aloeSeed”>
<property name=”Meshfile” value=”Items/Food/seed_blueberry” />
<property name=”Material” value=”organic” />
<property name=”HoldType” value=”21″ />
<property name=”CustomIcon” value=”mapleSeed” />
<property name=”CustomIconTint” value=”bac4c8″ />
<property class=”Action1″>
<!– UseAction –>
<property name=”Class” value=”PlaceAsBlock” />
<property name=”Delay” value=”0.5″ />
<property name=”Blockname” value=”aloeSprout” />
</property>
<property name=”Group” value=”Food/Cooking” />
<property class=”Preview”>
<property name=”Zoom” value=”25″ />
<property name=”Pos” value=”0,-0.05″ />
<property name=”Rot” value=”90,45,0″ />
</property>
</item>
<item id=”753″ name=”mushroomSeed”>
<property name=”Meshfile” value=”Items/Food/seed_blueberry” />
<property name=”Material” value=”organic” />
<property name=”HoldType” value=”21″ />
<property name=”CustomIcon” value=”mapleSeed” />
<property name=”CustomIconTint” value=”bac4c8″ />
<property class=”Action1″>
<!– UseAction –>
<property name=”Class” value=”PlaceAsBlock” />
<property name=”Delay” value=”0.5″ />
<property name=”Blockname” value=”mushroomSprout” />
</property>
<property name=”Group” value=”Food/Cooking” />
<property class=”Preview”>
<property name=”Zoom” value=”25″ />
<property name=”Pos” value=”0,-0.05″ />
<property name=”Rot” value=”90,45,0″ />
</property>
</item>

<item id=”758″ name=”cactusSeed”>
<property name=”Meshfile” value=”Items/Food/seed_blueberry” />
<property name=”Material” value=”organic” />
<property name=”HoldType” value=”21″ />
<property name=”CustomIcon” value=”mapleSeed” />
<property name=”CustomIconTint” value=”bac4c8″ />
<property class=”Action1″>
<property name=”Class” value=”PlaceAsBlock” />
<property name=”Delay” value=”0.5″ />
<property name=”Blockname” value=”cactus03_growing” />
</property>
<property name=”Group” value=”Food/Cooking” />
<property class=”Preview”>
<property name=”Zoom” value=”25″ />
<property name=”Pos” value=”0,-0.05″ />
<property name=”Rot” value=”90,45,0″ />
</property>
</item>

These are basically duplicates of the maple seed item. Please make sure your item IDs are unique and in sequence. The key for each of these seeds lie in the Action1 property of “PlaceAsBlock”. It comes down to the blockname value for each seed. That controls what block is placed into the world and starts the growing process that will be continued in the blocks.xml file.

For example, the cactusSeed gets placed into the world as a cactus03_growing block.

Let’s turn now to the blocks.xml file to look at these changes. Keep in mind that you need to also make sure that your block ids are unique and in sequence here as well. For each of my plants, I’ve set up a “sprout” that is planted, and a second stage of growing, except for the cactus since there isn’t a small cactus that I liked (instead it starts out 13′ tall :P).

These sprouts are simply copied from the potatoSprout item and renamed. Here the important item is the plantGrowing class object that specifies what the next stage of growth is and how long it will take to get there. You’ll also see a “FertileLevel” that controls what minimum level of ground it can be placed on, in this case 0, which is untilled or better. GrowthRate is set to 60 which is 60-120 minutes of real time (1 tick is commented in the file to be 1-2 minutes of real time). The IsRandom is set to false and I’m not sure if that is implemented or not, or if it is implemented, what effect it may have.

At the last “growing stage” of the plant, the “next” stage is simply set to the final plant.

<block id=”1408″ name=”aloeSprout”>
<property name=”Class” value=”PlantGrowing” />
<property name=”Material” value=”plants” />
<property name=”Shape” value=”BillboardPlant” />
<property name=”Mesh” value=”cutoutmoveable” />
<property name=”Texture” value=”296″ />
<property name=”Collide” value=”melee” />
<property name=”IsTerrainDecoration” value=”true” />
<drop event=”Destroy” count=”0″ />
<property class=”PlantGrowing”>
<property name=”Next” value=”aloeYoung” />
<property name=”GrowthRate” value=”60″ />
<property name=”FertileLevel” value=”0″ />
<property name=”IsRandom” value=”false” />
</property>
</block>
<block id=”1409″ name=”aloeYoung”>
<property name=”Class” value=”PlantGrowing” />
<property name=”Material” value=”plants” />
<property name=”Shape” value=”BillboardPlant” />
<property name=”Mesh” value=”cutoutmoveable” />
<property name=”Texture” value=”297″ />
<property name=”Collide” value=”melee” />
<property name=”IsTerrainDecoration” value=”true” />
<drop event=”Destroy” count=”0″ />
<property class=”PlantGrowing”>
<property name=”Next” value=”plantAloe” />
<property name=”GrowthRate” value=”60″ />
<property name=”FertileLevel” value=”0″ />
<property name=”IsRandom” value=”false” />
</property>
</block>
<block id=”1410″ name=”mushroomSprout”>
<property name=”Class” value=”PlantGrowing” />
<property name=”Material” value=”plants” />
<property name=”Shape” value=”BillboardPlant” />
<property name=”Mesh” value=”cutoutmoveable” />
<property name=”Texture” value=”296″ />
<property name=”Collide” value=”melee” />
<property name=”IsTerrainDecoration” value=”true” />
<drop event=”Destroy” count=”0″ />
<property class=”PlantGrowing”>
<property name=”Next” value=”mushroomYoung” />
<property name=”GrowthRate” value=”60″ />
<property name=”FertileLevel” value=”0″ />
<property name=”IsRandom” value=”false” />
</property>
</block>
<block id=”1411″ name=”mushroomYoung”>
<property name=”Class” value=”PlantGrowing” />
<property name=”Material” value=”plants” />
<property name=”Shape” value=”BillboardPlant” />
<property name=”Mesh” value=”cutoutmoveable” />
<property name=”Texture” value=”297″ />
<property name=”Collide” value=”melee” />
<property name=”IsTerrainDecoration” value=”true” />
<drop event=”Destroy” count=”0″ />
<property class=”PlantGrowing”>
<property name=”Next” value=”mushroom01″ />
<property name=”GrowthRate” value=”60″ />
<property name=”FertileLevel” value=”0″ />
<property name=”IsRandom” value=”false” />
</property>
</block>
<block id=”1412″ name=”cactus03_growing”>
<property name=”Class” value=”Cactus” />
<property name=”Material” value=”cactus” />
<property name=”Shape” value=”ModelEntity” />
<property name=”Texture” value=”390″ />
<property name=”Model” value=”Entities/Trees/Saguaro_Cactus_13Prefab” />
<property name=”Tag” value=”TreeTrunk” />
<property name=”Damage” value=”5″ />
<property name=”UpwardsCount” value=”1″ />
<property name=”IsPlant” value=”true” />
<property class=”PlantGrowing”>
<property name=”Next” value=”cactus02_growing” />
<property name=”GrowthRate” value=”30″ />
<property name=”FertileLevel” value=”0″ />
<property name=”IsRandom” value=”false” />
</property>
</block>
<block id=”1413″ name=”cactus02_growing”>
<property name=”Class” value=”Cactus” />
<property name=”Material” value=”cactus” />
<property name=”Shape” value=”ModelEntity” />
<property name=”Texture” value=”390″ />
<property name=”Model” value=”Entities/Trees/Saguaro_Cactus_16Prefab” />
<property name=”Tag” value=”TreeTrunk” />
<property name=”Damage” value=”5″ />
<property name=”UpwardsCount” value=”1″ />
<property name=”IsPlant” value=”true” />
<property class=”PlantGrowing”>
<property name=”Next” value=”cactus01″ />
<property name=”GrowthRate” value=”30″ />
<property name=”FertileLevel” value=”0″ />
<property name=”IsRandom” value=”false” />
</property>
</block>

Lets go back to the items.xml file and define a few more items, namely the new foods. These are grilled mushrooms, grilled corn and a mushroom stew and the prize food item, french fries. For the most part, I just used the base item as the icon, with a custom tint to make it stand out a bit. I found a decent icon for the french fries by using the most destroyed version of the stick spikes.

Here we can see the item definitions, where I define health, food, water, wellness and any smell buffs to apply. Obviously you can adjust these values to whatever you think is appropriate. As usual, remember to change the item ids to match whatever sequence is in your items.xml file.

<item id=”751″ name=”mushroomStew”>
<property name=”Meshfile” value=”Items/Food/venison_stew” />
<property name=”Material” value=”organic” />
<property name=”HoldType” value=”23″ />
<property name=”CustomIcon” value=”venisonStew” />
<property name=”CustomIconTint” value=”bac4c8″ />
<property class=”Action1″>
<!– UseAction –>
<property name=”Class” value=”Eat” />
<property name=”Delay” value=”1.0″ />
<property name=”Use_time” value=”…” />
<property name=”Gain_health” value=”10″ />
<property name=”Gain_food” value=”30″ />
<property name=”Gain_water” value=”25″ />
<property name=”Gain_wellness” value=”1.6″ />
<property name=”Sound_start” value=”UseActions/player_drinking” />
</property>
<property name=”Smell” value=”exLargeSmell” />
<property name=”Group” value=”Food/Cooking” />
<property class=”Preview”>
<property name=”Zoom” value=”30″ />
<property name=”Pos” value=”0,-0.03″ />
<property name=”Rot” value=”90,45,0″ />
</property>
</item>

<item id=”756″ name=”mushroomGrilled”>
<property name=”Meshfile” value=”Items/Food/vegetable_potato_baked” />
<property name=”Material” value=”organic” />
<property name=”HoldType” value=”15″ />
<property name=”CustomIcon” value=”mushrooms” />
<property name=”CustomIconTint” value=”b4895a” />
<property class=”Action1″>
<!– UseAction –>
<property name=”Class” value=”Eat” />
<property name=”Delay” value=”1.0″ />
<property name=”Use_time” value=”…” />
<property name=”Gain_health” value=”1″ />
<property name=”Gain_food” value=”4″ />
<property name=”Gain_water” value=”3″ />
<property name=”Gain_stamina” value=”3″ />
<property name=”Gain_wellness” value=”.1″ />
<property name=”Sound_start” value=”UseActions/player_eating” />
</property>
<property name=”Group” value=”Food/Cooking” />
<property class=”Preview”>
<property name=”Zoom” value=”30″ />
<property name=”Pos” value=”0,-0.03″ />
<property name=”Rot” value=”90,45,0″ />
</property>
</item>
<item id=”757″ name=”cornGrilled”>
<property name=”Meshfile” value=”Items/Food/corn_cooked” />
<property name=”Material” value=”organic” />
<property name=”HoldType” value=”15″ />
<property name=”CustomIcon” value=”cornOnTheCob” />
<property name=”CustomIconTint” value=”ffd700″ />
<property class=”Action1″>
<!– UseAction –>
<property name=”Class” value=”Eat” />
<property name=”Delay” value=”1.0″ />
<property name=”Use_time” value=”…” />
<property name=”Gain_health” value=”0″ />
<property name=”Gain_food” value=”4″ />
<property name=”Gain_water” value=”2″ />
<property name=”Gain_stamina” value=”2″ />
<property name=”Gain_wellness” value=”0.08″ />
<property name=”Sound_start” value=”UseActions/player_eating” />
</property>
<property name=”Group” value=”Food/Cooking” />
<property class=”Preview”>
<property name=”Zoom” value=”28″ />
<property name=”Pos” value=”0,-0.2″ />
<property name=”Rot” value=”90,45,0″ />
</property>
</item>
<item id=”759″ name=”frenchFries”>
<property name=”Meshfile” value=”Items/Food/vegetable_potato_baked” />
<property name=”Material” value=”organic” />
<property name=”HoldType” value=”16″ />
<property name=”CustomIcon” value=”trapSpikesDamage05″ />
<property name=”CustomIconTint” value=”ffd700″ />
<property class=”Action1″>
<property name=”Class” value=”Eat” />
<property name=”Delay” value=”1.0″ />
<property name=”Use_time” value=”…” />
<property name=”Gain_health” value=”1″ />
<property name=”Gain_food” value=”4″ />
<property name=”Gain_water” value=”-2″ />
<property name=”Gain_stamina” value=”2″ />
<property name=”Gain_gas” value=”10″ />
<property name=”Sound_start” value=”UseActions/player_eating” />
</property>
<property name=”Smell” value=”exLargeSmell” />
<property name=”Group” value=”Food/Cooking” />
<property class=”Preview”>
<property name=”Zoom” value=”28″ />
<property name=”Pos” value=”0,-0.2″ />
<property name=”Rot” value=”90,45,0″ />
</property>
</item>

We also need recipes for these new foods, and that’s pretty straightforward as well.

<recipe name=”mushroomStew” count=”1″ scrapable=”False” craft_area=”campfire” craft_tool=”cookingPot” craft_time=”30″ craft_exp_gain=”2″ learn_exp_gain=”20″ >
<ingredient name=”bottledWater” count=”1″/>
<ingredient name=”mushrooms” count=”1″/>
<ingredient name=”potato” count=”1″/>
<ingredient name=”corn” count=”1″/>
</recipe>
<recipe name=”mushroomGrilled” count=”1″ scrapable=”False” craft_area=”campfire” craft_tool=”cookingGrill” craft_time=”15″ craft_exp_gain=”2″ learn_exp_gain=”20″ >
<ingredient name=”mushrooms” count=”1″/>
</recipe>
<recipe name=”cornGrilled” count=”1″ scrapable=”False” craft_area=”campfire” craft_tool=”cookingGrill” craft_time=”15″ craft_exp_gain=”2″ learn_exp_gain=”20″ >
<ingredient name=”corn” count=”1″/>
</recipe>
<recipe name=”frenchFries” count=”4″ scrapable=”False” craft_area=”campfire” craft_tool=”cookingPot” craft_time=”15″ craft_exp_gain=”2″ learn_exp_gain=”20″ >
<ingredient name=”potato” count=”1″/>
<ingredient name=”animalFat” count=”1″/>
</recipe>

Finally, let’s show the working ovens. This was actually really simple. Just set the class to “campfire”, given them custom icons, add a heat map like the regular campfire as well as a particle name and offset and it just works :)

<block id=”1414″ name=”ovenWorking”>
<property name=”Class” value=”Campfire” />
<property name=”Material” value=”wood” />
<property name=”CustomIcon” value=”oven” />
<property name=”CustomIconTint” value=”ffd700″ />
<property name=”Shape” value=”Ext3dModel” />
<property name=”Mesh” value=”models” />
<property name=”Model” value=”Appliances/oven” param1=”main_mesh” />
<property name=”IsTerrainDecoration” value=”true” />
<property name=”ParticleName” value=”campfire” />
<property name=”ParticleOffset” value=”0.5,0,0.5″ />
<property name=”HeatMapStrength” value=”2″/>
<property name=”HeatMapTime” value=”600″/>
<property name=”HeatMapFrequency” value=”20″/>
<property name=”BuffsWhenWalkedOn” value=”burningSmall”/>
<drop event=”Destroy” count=”1″ />
<property name=”Group” value=”Food/Cooking” />
</block>
<block id=”1415″ name=”wallOvenWorking”>
<property name=”Class” value=”Campfire” />
<property name=”Material” value=”wood_weak” />
<property name=”CustomIcon” value=”wallOven” />
<property name=”CustomIconTint” value=”ffd700″ />
<property name=”Texture” value=”346,345,341,345,262,345″ />
<property name=”IsTerrainDecoration” value=”true” />
<property name=”ParticleName” value=”campfire” />
<property name=”ParticleOffset” value=”0.5,0,0.5″ />
<property name=”HeatMapStrength” value=”2″/>
<property name=”HeatMapTime” value=”600″/>
<property name=”HeatMapFrequency” value=”20″/>
<property name=”BuffsWhenWalkedOn” value=”burningSmall”/>
<drop event=”Destroy” count=”1″ />
<property name=”Group” value=”Food/Cooking” />
</block>

As always, you assume all the risk of breaking your game when you mod, but these are pretty easy changes to make. I always suggest making a backup of your original files before you begin. Also, remember that when you visit a server, it’s going to push it’s files down to you, over-writing your modded files, so keep a backup of those files as well!

If you have any questions, I’d be happy to answer them for you!

Rongo

About

Oldschool gamer. Professional developer by day, gamer by night. I try to keep myself young through lots and lots and lots of game playing. So far I've been successful.

Leave a Reply

more stuf?