<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.play.eco/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Felipe</id>
	<title>Eco - English Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.play.eco/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Felipe"/>
	<link rel="alternate" type="text/html" href="https://wiki.play.eco/en/Special:Contributions/Felipe"/>
	<updated>2026-06-04T05:15:16Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://wiki.play.eco/en/index.php?title=Corn-on-the-cob_example_mod&amp;diff=8633</id>
		<title>Corn-on-the-cob example mod</title>
		<link rel="alternate" type="text/html" href="https://wiki.play.eco/en/index.php?title=Corn-on-the-cob_example_mod&amp;diff=8633"/>
		<updated>2022-07-11T17:59:44Z</updated>

		<summary type="html">&lt;p&gt;Felipe: modified link description&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://drive.google.com/drive/u/1/folders/1coxU8BGCyjKS52eOphCIMWX7ULiCEgac End result after building Modkit]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/StrangeLoopGames/EcoModKit/tree/main Download the example files]&lt;br /&gt;
===&#039;&#039;&#039;Server&#039;&#039;&#039;===&lt;br /&gt;
Create a class library project in the latest version of Visual Studio with .Net 6.0 as the target framework. Then right-click dependencies and add project reference, on it browse for the downloaded reference assemblies dlls.[[File:COTCmodguide ServerSetup.jpg|617x617px]]&lt;br /&gt;
&lt;br /&gt;
Right click project then add a new Item → add a new code file, name it appropriately.&lt;br /&gt;
&lt;br /&gt;
[[File:Modguide_pt2.jpg|925x925px]]&lt;br /&gt;
&lt;br /&gt;
On the code file use the following namespaces that should cover all of the definitions used when creating a new Food Item.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using System;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using System.Collections.Generic;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using System.Linq;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using Eco.Core.Items;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using Eco.Gameplay.Components;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using Eco.Gameplay.Items;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using Eco.Gameplay.Players;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using Eco.Gameplay.Skills;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using Eco.Shared.Localization;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using Eco.Shared.Serialization;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After that create the CornOnTheCobItem partial class inside the namespace Eco.Mods.TechTree, make sure that it is named appropriately by having the suffix “Item”. Also that it inherits from FoodItem class. Implement abstract members of &#039;&#039;&#039;Nutrition&#039;&#039;&#039;, &#039;&#039;&#039;Calories&#039;&#039;&#039; and &#039;&#039;&#039;ShelfLife&#039;&#039;&#039; and add [Serialized],[LocDisplayName()] attributes to the class as shown in the image.&lt;br /&gt;
[[File:COTCmodguide ClassSetup 1.png|none|thumb|862x862px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After adding the necessary stuff we can add the [Weight] and [Tag] attributes to the class, which are not necessarily required but rather recommended. Also, override &#039;&#039;&#039;DisplayNamePlural&#039;&#039;&#039; and &#039;&#039;&#039;DisplayDescription&#039;&#039;&#039; so that the item can display in the interface a name and a description, like so.&lt;br /&gt;
[[File:COTCmodguide ClassSetup 2.png|none|thumb|607x607px]]&lt;br /&gt;
===&#039;&#039;&#039;Client&#039;&#039;&#039;===&lt;br /&gt;
First things first Import the modkit into your unity project.&lt;br /&gt;
[[File:COTCmodguide ClientSetup 1.png|none|thumb|455x455px]]&lt;br /&gt;
Import the assets you’re going to use. In this case, I’m importing the corn mesh divided into parts, the FPV hands necessary animations, and the corn Icon, I’m not importing the TPV hands animations to show how you can use animations already found within the game. Either way, you can create your own hand animations by using the .FBX hands model found in &#039;&#039;&#039;Assets/EcoModKit/Assets/Food/HandsModel/[/cdn-cgi/l/email-protection &amp;lt;nowiki&amp;gt;[email protected]&amp;lt;/nowiki&amp;gt;]_Hands_Tpose.FBX&#039;&#039;&#039; in 3d animation software such as blender.&lt;br /&gt;
&lt;br /&gt;
[[File:COTCmodguide ClientSetup 2.png|370x370px]]&lt;br /&gt;
&lt;br /&gt;
Finally, delete all the objects by default in the sample scene.&lt;br /&gt;
----&lt;br /&gt;
===&#039;&#039;&#039;Base object setup&#039;&#039;&#039;===&lt;br /&gt;
We want to first build the base of our food object, from which we can use as the TPV version and then override it and create the FPV version.&lt;br /&gt;
[[File:COTCmodguide ClassSetup 3.png|thumb]]&lt;br /&gt;
Import FoodItemTemplate into the scene, Import TMP essentials if a popup appears, then after getting to &#039;&#039;&#039;FoodItemTemplate&#039;&#039;&#039; prefab on the scene we’re going to Unpack it completely and rename it correctly, in this case, &#039;&#039;&#039;CornOnTheCobItem(the same as the partial class in Server side of things that represents the item)&#039;&#039;&#039;, it is important to keep the naming convention to end in “Item”&lt;br /&gt;
[[File:COTCmodguide unpacking template.png|none|thumb|494x494px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is the structure we’re left with after importing the prefab into the scene , unpacking it and renaming it.&lt;br /&gt;
[[File:COTCmodguide foodItemTemplateStructure.jpg|none|thumb|461x461px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Change the sprite on the &#039;&#039;&#039;Image&#039;&#039;&#039; Component in both the &#039;&#039;&#039;Foreground&#039;&#039;&#039; object and &#039;&#039;&#039;FullImage&#039;&#039;&#039; object, as well as write the correct name on the &#039;&#039;&#039;TextMeshPro&#039;&#039;&#039; component in the &#039;&#039;&#039;IconName&#039;&#039;&#039; object&lt;br /&gt;
[[File:COTCmodguide ComponentsSetup 1.png|none|thumb|969x969px]]&lt;br /&gt;
----&#039;&#039;&#039;Components Setup&#039;&#039;&#039;&lt;br /&gt;
Now let’s focus on the tool object, specifically the Food_FPV object, there we will find the following components: &#039;&#039;&#039;BiteableFoodObject&#039;&#039;&#039;, &#039;&#039;&#039;ToolInteraction&#039;&#039;&#039;, and &#039;&#039;&#039;Food Effects.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Biteable Food Object&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Property&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|Food Parts *&lt;br /&gt;
|Reference to all the GameObjects that represent all the different bites that it takes to consume. E.G the different meshes of the corn.&lt;br /&gt;
|-&lt;br /&gt;
|Bite Sequence *&lt;br /&gt;
|Refers to how the GameObjects that compose meshes will behave with each bite, you could have a tomato for example which is just various types of the same mesh in different states or a salad which is composed of various parts. There are already 2 options defined for you to choose on Assets/EcoModKit/Assets/Food, or alternatively, create a new one inheriting from FoodBiteSequence class.&lt;br /&gt;
|-&lt;br /&gt;
|Plate Template&lt;br /&gt;
|It refers as its name implies to the object in your food that sort of acts like a container, E.G: a bowl in a salad.&lt;br /&gt;
|-&lt;br /&gt;
|Default Animation Override&lt;br /&gt;
|It refers to the hand&#039;s animations to be used when eating, you can either create a Custom one using Custom Animsets Override or choose one of the already predefined animations that we already have in ECO.&lt;br /&gt;
|-&lt;br /&gt;
|Utensil Config&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Utensil Template&lt;br /&gt;
|refers to the model used as a utensil like a fork or a spoon&lt;br /&gt;
|-&lt;br /&gt;
|Use Auto Utensil Part Placement&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Custom Food Chunk for utensils&lt;br /&gt;
|refers to the model used when grabbing pieces of chunk from the food&lt;br /&gt;
|-&lt;br /&gt;
|Utensil Part Position Offset&lt;br /&gt;
|Helper to better adjust the utensil position within the hands model.&lt;br /&gt;
|-&lt;br /&gt;
|Utensil Part Rotation Offset&lt;br /&gt;
|Helper to better adjust the utensil rotation within the hands model.&lt;br /&gt;
|-&lt;br /&gt;
|Utensil Scale&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Misc Config&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Position Offset&lt;br /&gt;
|Helper to better adjust the food position within the hands model .&lt;br /&gt;
|-&lt;br /&gt;
|Rotation Offset&lt;br /&gt;
|Helper to better adjust the food rotation within the hands model .&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Default Animation Override options&#039;&#039;&#039;&lt;br /&gt;
[[File:COTCmodguide DefaultAnimationOverrideOptions.png|none|thumb|418x418px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Lastly, there are tools to help you set up the object as well as visualize it. &#039;&#039;&#039;Add FPV components&#039;&#039;&#039; will add &#039;&#039;&#039;Tool Interaction&#039;&#039;&#039;, &#039;&#039;&#039;Food Effects&#039;&#039;&#039; and &#039;&#039;&#039;Perform Interaction. While Add TPV components&#039;&#039;&#039; will only add &#039;&#039;&#039;Tool Interaction&#039;&#039;&#039; and &#039;&#039;&#039;Food Effects.&#039;&#039;&#039;&lt;br /&gt;
[[File:COTCmodguide CustomEditorTools.png|none|thumb|801x801px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Food Effects&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Sequence Interaction Effects&lt;br /&gt;
!Should the interaction effects play all at once or in a sequence with each bite?&lt;br /&gt;
|-&lt;br /&gt;
|Interaction Particle Systems&lt;br /&gt;
|Interaction Particles are for when the player interacts with the food before taking a bite. eg. spoon entering the soup&lt;br /&gt;
|-&lt;br /&gt;
|Sequence Bite Effects&lt;br /&gt;
|Should the bite effects play all at once or in a sequence with each bite?&lt;br /&gt;
|-&lt;br /&gt;
|Bite Effect Particle Systems&lt;br /&gt;
|Bite Particles are for when the player actually takes a bite.&lt;br /&gt;
|-&lt;br /&gt;
|Food Sound Type&lt;br /&gt;
|audio category for the chewing sounds on each bite&lt;br /&gt;
|-&lt;br /&gt;
|Interaction Sound Type&lt;br /&gt;
|Sound to play when the player interacts with the food eg. Spoon entering soup&lt;br /&gt;
|-&lt;br /&gt;
|Mouth Effect Transform&lt;br /&gt;
|Optional: If sequencing mouth effects then you can parent the individual effects to this transformation and it will be positioned to the mouth instead of the parent effect&lt;br /&gt;
|-&lt;br /&gt;
|Mouth Offset&lt;br /&gt;
|When passing an InteractionVFX through the Animation event(see animation events down below), the bite effects are moved to the camera’s position plus this offset in order to simulate mouth position&lt;br /&gt;
|-&lt;br /&gt;
|Mouth Spray Random Angle&lt;br /&gt;
|How much variety is there in the angle of juicy mouth effects&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Tool Interaction&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Property&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|Custom Animset Override&lt;br /&gt;
|Assets that allow for the FPV or TPV hands animations to be overridden by custom ones.&lt;br /&gt;
|}&lt;br /&gt;
----Continuing making the corn on the cob mod…, First I’ll rename Food_Base object into something more appropriate like &#039;&#039;&#039;CornOnTheCob_Eatable&#039;&#039;&#039; and import the food parts mesh as a child of this object. Remember that this will constitute the base for our food object.&lt;br /&gt;
[[File:COTCmodguide ImportingFoodModel.png|none|thumb|846x846px]]&lt;br /&gt;
*After importing the mesh into the scene you can add the parts automatically by pressing the &#039;&#039;&#039;TryAutoSetupParts&#039;&#039;&#039; button, in this case, I removed the last part since that is the stem of the corn.&lt;br /&gt;
*I Set Bite Sequence to OneByOne since the corn mesh will disappear piece by piece after each bite.&lt;br /&gt;
*Default animation override is set to Eat_Corn, those animations are already defined in Eco.&lt;br /&gt;
*Lastly some adjustments to the object’s position and it’s offsetsin order to fit the corn correctly in the hands of the player while it plays the animations.&lt;br /&gt;
You can see the final result of how I ended setting up the BiteableFoodObject.&lt;br /&gt;
[[File:COTCmodguide BiteableFoodObjectSetup 1.png|none|thumb|921x921px]]&lt;br /&gt;
[[File:COTCmodguide BiteableFoodObjectSetup 2.png|none|thumb|571x571px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Regarding &#039;&#039;&#039;ToolInteraction,&#039;&#039;&#039; I left it as it is for now.&lt;br /&gt;
&lt;br /&gt;
On Food Effects I changed the &#039;&#039;&#039;Food Sound Type&#039;&#039;&#039; to Hard and the Interaction Sound Type to Nibbles.&lt;br /&gt;
[[File:COTCmodguide FoodEffects.png|none|thumb|702x702px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once this is done we can turn &#039;&#039;&#039;CornOntheCob_Eatable&#039;&#039;&#039; into a prefab and delete it from the scene, this prefab will be useful for TPV Food, from this prefab we will create a Prefab variant renaming it in the process to &#039;&#039;&#039;CornOntheCob_Eatable_FPV&#039;&#039;&#039; which will, in turn, be our FPV food.&lt;br /&gt;
[[File:COTCmodguide CreatePrefabVariant.png|none|thumb|766x766px]]&lt;br /&gt;
[[File:COTCmodguide Prefabs.png|none|thumb|677x677px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now let’s modify &#039;&#039;&#039;CornOnTheCob_Eatable_FPV :&#039;&#039;&#039;&lt;br /&gt;
*I’ll press the “Add FPV components” button which will add the &#039;&#039;&#039;PerfomInteraction&#039;&#039;&#039; component.&lt;br /&gt;
*Change &#039;&#039;&#039;DefaultAnimationOverride&#039;&#039;&#039; in &#039;&#039;&#039;BiteableFoodObject&#039;&#039;&#039; to &#039;&#039;&#039;Custom.&#039;&#039;&#039;&lt;br /&gt;
*Change &#039;&#039;&#039;CustomAnimset&#039;&#039;&#039; in &#039;&#039;&#039;ToolInteraction&#039;&#039;&#039; to a new &#039;&#039;&#039;CustomAnimset Override&#039;&#039;&#039; asset. Which contains the necessary FPV hand animations related to eating the Corn On The Cob.&lt;br /&gt;
*Lastly, I modified the position offset and rotation offset of the &#039;&#039;&#039;BitableFoodObject&#039;&#039;&#039; component&lt;br /&gt;
[[File:COTCmodguide BiteableFoodObject prefabvariant.png|none|thumb|739x739px]]&lt;br /&gt;
[[File:COTCmodguide ToolInteraction prefabVariant.png|none|thumb|932x932px]]&lt;br /&gt;
===&#039;&#039;&#039;Overriding Custom Animations&#039;&#039;&#039;===&lt;br /&gt;
*On the project tab right click Create → Eco → Animation → Animset Override, you will get this asset, in the example mod I choose to override the FPV animations&lt;br /&gt;
[[File:COTCmodguide CustomAnimsetOverride.png|none|thumb|974x974px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the mod example, I pressed the “Food_FPV” button which will automatically add the name of the animations to override(shown in the image), and then set the correspondent animation clips.&lt;br /&gt;
&lt;br /&gt;
(A reminder that these animations clips can be created by yourself via the &#039;&#039;&#039;[/cdn-cgi/l/email-protection &amp;lt;nowiki&amp;gt;[email protected]&amp;lt;/nowiki&amp;gt;]_Hands_tpose.fbx)&#039;&#039;&#039;&lt;br /&gt;
===&#039;&#039;&#039;Adding Events to Animations&#039;&#039;&#039;===&lt;br /&gt;
After creating your &#039;&#039;&#039;CustomAnimsetOverride&#039;&#039;&#039; to add your own animations it is &#039;&#039;&#039;VERY&#039;&#039;&#039; important to add the following events to the correspondent animation clips since this is how the game actually knows the timing of when bites happen, when and what effects occur, and lastly when the food is consumed, all timed according to your animation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: Without these your mod won’t work.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Loop Events&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These events are primarily placed on the “&#039;&#039;&#039;Eat_Loop&#039;&#039;&#039;” animations whether is FPV or TPV&lt;br /&gt;
*&#039;&#039;&#039;BiteEvent&#039;&#039;&#039;: Refers to every time it takes a bite in the animations, it is done this way so you can customize and time correctly when on your loop eating animation does the player actually takes a bite.&lt;br /&gt;
*&#039;&#039;&#039;BiteEffectsEvent&#039;&#039;&#039;: It represents multiple types of effects, it receives an integer as a parameter. The integer represents the FoodEffectType, which can be found here.&lt;br /&gt;
**[[File:COTCmodguide BiteEffectEvents.jpg|none|thumb|629x629px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Exit Event&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These events are primarily placed on the “&#039;&#039;&#039;Eat_Loop_Exi&#039;&#039;&#039;t” animations whether is FPV or TPV&lt;br /&gt;
*FoodConsumedEvent: Placed after eating it determines if the BiteableFoodObject has been consumed in its entirety, adding then calories and nutrients.&lt;br /&gt;
&#039;&#039;&#039;Last step:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After having created the &#039;&#039;&#039;CornOnTheCob_Eatable.prefab&#039;&#039;&#039; and &#039;&#039;&#039;CornOnTheCob_Eatable_FPV.prefab,&#039;&#039;&#039; we will then place &#039;&#039;&#039;CornOnTheCob_Eatable_FPV.prefab&#039;&#039;&#039; as a child of Tool object , then we go to Avatar object in &#039;&#039;&#039;AvatarAttachedPart&#039;&#039;&#039; component ****and set the &#039;&#039;&#039;Male prefab&#039;&#039;&#039; and &#039;&#039;&#039;Female prefab&#039;&#039;&#039; fields both to &#039;&#039;&#039;CornOnTheCob_Eatable.prefab.&#039;&#039;&#039; The object under tool will be used for the FPV of the food, and the object reference in male and female fields on AvatarAttachedPart will be used for the TPV of the food.&lt;br /&gt;
[[File:COTCmodguide FinalSetup.png|none|thumb|509x509px]]&lt;br /&gt;
[[File:COTCmodguide AvatarAttachedPart.png|none|thumb|503x503px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, Deactivate CornOnTheCobItem and build the modkit, then you’re set to go!&lt;br /&gt;
----Some further notes: This guide explains how the CornOnTheCob Food Mod was created and explains the critical processes involved in it that relate to food modding. It isn’t therefore a strict guide on how to make your food mod. You can technically deviate from the guide, create different prefabs for the FPV and TPV, or even different prefabs for Male and Female, it’s all up to the modder.&lt;br /&gt;
Keep in mind:&lt;br /&gt;
*If you want to make your custom animations make sure to add the animation events&lt;br /&gt;
*Name the Item correctly so that it coincides with the item class in Server&lt;br /&gt;
*Have the correct component on your FPV food and your TPV food.&lt;br /&gt;
===&#039;&#039;&#039;Errors and Warnings&#039;&#039;&#039;===&lt;br /&gt;
You might have wondered what those error signs and warning signs mean allow me to explain&lt;br /&gt;
*When setting the DefaultAnimationOverride to &#039;&#039;&#039;Custom&#039;&#039;&#039; it is expected for you to fill the field of &#039;&#039;&#039;Custom Animset&#039;&#039;&#039; in Tool Interaction, if this isn’t the case the next error message will appear, which indicates that you should add a &#039;&#039;&#039;Custom Animset&#039;&#039;&#039; because otherwise there wouldn’t be an animation&lt;br /&gt;
[[File:COTCmodguide ErrorPopUp.png|none|thumb|434x434px]]&lt;br /&gt;
*When setting the &#039;&#039;&#039;DefaultAnimationOverride&#039;&#039;&#039; to anything other than &#039;&#039;&#039;Custom&#039;&#039;&#039;, and also having the &#039;&#039;&#039;Custom Animset&#039;&#039;&#039; on &#039;&#039;&#039;Tool Interaction&#039;&#039;&#039; set, the latter one will be used instead of the specified one in &#039;&#039;&#039;DefaultAnimationOverride,&#039;&#039;&#039; for the warning to disappear you should change &#039;&#039;&#039;DefaultAnimationOverride&#039;&#039;&#039; to Custom or unset the &#039;&#039;&#039;Custom Animset&#039;&#039;&#039; value&lt;br /&gt;
[[File:COTCmodguide WarningPopup.png|none|thumb|443x443px]]&lt;/div&gt;</summary>
		<author><name>Felipe</name></author>
	</entry>
	<entry>
		<id>https://wiki.play.eco/en/index.php?title=Corn-on-the-cob_example_mod&amp;diff=8632</id>
		<title>Corn-on-the-cob example mod</title>
		<link rel="alternate" type="text/html" href="https://wiki.play.eco/en/index.php?title=Corn-on-the-cob_example_mod&amp;diff=8632"/>
		<updated>2022-07-11T17:59:13Z</updated>

		<summary type="html">&lt;p&gt;Felipe: modified link description&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://drive.google.com/drive/u/1/folders/1coxU8BGCyjKS52eOphCIMWX7ULiCEgac End result after building Modkit]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/StrangeLoopGames/EcoModKit/tree/main Download the example files here]&lt;br /&gt;
===&#039;&#039;&#039;Server&#039;&#039;&#039;===&lt;br /&gt;
Create a class library project in the latest version of Visual Studio with .Net 6.0 as the target framework. Then right-click dependencies and add project reference, on it browse for the downloaded reference assemblies dlls.[[File:COTCmodguide ServerSetup.jpg|617x617px]]&lt;br /&gt;
&lt;br /&gt;
Right click project then add a new Item → add a new code file, name it appropriately.&lt;br /&gt;
&lt;br /&gt;
[[File:Modguide_pt2.jpg|925x925px]]&lt;br /&gt;
&lt;br /&gt;
On the code file use the following namespaces that should cover all of the definitions used when creating a new Food Item.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using System;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using System.Collections.Generic;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using System.Linq;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using Eco.Core.Items;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using Eco.Gameplay.Components;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using Eco.Gameplay.Items;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using Eco.Gameplay.Players;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using Eco.Gameplay.Skills;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using Eco.Shared.Localization;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using Eco.Shared.Serialization;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After that create the CornOnTheCobItem partial class inside the namespace Eco.Mods.TechTree, make sure that it is named appropriately by having the suffix “Item”. Also that it inherits from FoodItem class. Implement abstract members of &#039;&#039;&#039;Nutrition&#039;&#039;&#039;, &#039;&#039;&#039;Calories&#039;&#039;&#039; and &#039;&#039;&#039;ShelfLife&#039;&#039;&#039; and add [Serialized],[LocDisplayName()] attributes to the class as shown in the image.&lt;br /&gt;
[[File:COTCmodguide ClassSetup 1.png|none|thumb|862x862px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After adding the necessary stuff we can add the [Weight] and [Tag] attributes to the class, which are not necessarily required but rather recommended. Also, override &#039;&#039;&#039;DisplayNamePlural&#039;&#039;&#039; and &#039;&#039;&#039;DisplayDescription&#039;&#039;&#039; so that the item can display in the interface a name and a description, like so.&lt;br /&gt;
[[File:COTCmodguide ClassSetup 2.png|none|thumb|607x607px]]&lt;br /&gt;
===&#039;&#039;&#039;Client&#039;&#039;&#039;===&lt;br /&gt;
First things first Import the modkit into your unity project.&lt;br /&gt;
[[File:COTCmodguide ClientSetup 1.png|none|thumb|455x455px]]&lt;br /&gt;
Import the assets you’re going to use. In this case, I’m importing the corn mesh divided into parts, the FPV hands necessary animations, and the corn Icon, I’m not importing the TPV hands animations to show how you can use animations already found within the game. Either way, you can create your own hand animations by using the .FBX hands model found in &#039;&#039;&#039;Assets/EcoModKit/Assets/Food/HandsModel/[/cdn-cgi/l/email-protection &amp;lt;nowiki&amp;gt;[email protected]&amp;lt;/nowiki&amp;gt;]_Hands_Tpose.FBX&#039;&#039;&#039; in 3d animation software such as blender.&lt;br /&gt;
&lt;br /&gt;
[[File:COTCmodguide ClientSetup 2.png|370x370px]]&lt;br /&gt;
&lt;br /&gt;
Finally, delete all the objects by default in the sample scene.&lt;br /&gt;
----&lt;br /&gt;
===&#039;&#039;&#039;Base object setup&#039;&#039;&#039;===&lt;br /&gt;
We want to first build the base of our food object, from which we can use as the TPV version and then override it and create the FPV version.&lt;br /&gt;
[[File:COTCmodguide ClassSetup 3.png|thumb]]&lt;br /&gt;
Import FoodItemTemplate into the scene, Import TMP essentials if a popup appears, then after getting to &#039;&#039;&#039;FoodItemTemplate&#039;&#039;&#039; prefab on the scene we’re going to Unpack it completely and rename it correctly, in this case, &#039;&#039;&#039;CornOnTheCobItem(the same as the partial class in Server side of things that represents the item)&#039;&#039;&#039;, it is important to keep the naming convention to end in “Item”&lt;br /&gt;
[[File:COTCmodguide unpacking template.png|none|thumb|494x494px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is the structure we’re left with after importing the prefab into the scene , unpacking it and renaming it.&lt;br /&gt;
[[File:COTCmodguide foodItemTemplateStructure.jpg|none|thumb|461x461px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Change the sprite on the &#039;&#039;&#039;Image&#039;&#039;&#039; Component in both the &#039;&#039;&#039;Foreground&#039;&#039;&#039; object and &#039;&#039;&#039;FullImage&#039;&#039;&#039; object, as well as write the correct name on the &#039;&#039;&#039;TextMeshPro&#039;&#039;&#039; component in the &#039;&#039;&#039;IconName&#039;&#039;&#039; object&lt;br /&gt;
[[File:COTCmodguide ComponentsSetup 1.png|none|thumb|969x969px]]&lt;br /&gt;
----&#039;&#039;&#039;Components Setup&#039;&#039;&#039;&lt;br /&gt;
Now let’s focus on the tool object, specifically the Food_FPV object, there we will find the following components: &#039;&#039;&#039;BiteableFoodObject&#039;&#039;&#039;, &#039;&#039;&#039;ToolInteraction&#039;&#039;&#039;, and &#039;&#039;&#039;Food Effects.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Biteable Food Object&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Property&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|Food Parts *&lt;br /&gt;
|Reference to all the GameObjects that represent all the different bites that it takes to consume. E.G the different meshes of the corn.&lt;br /&gt;
|-&lt;br /&gt;
|Bite Sequence *&lt;br /&gt;
|Refers to how the GameObjects that compose meshes will behave with each bite, you could have a tomato for example which is just various types of the same mesh in different states or a salad which is composed of various parts. There are already 2 options defined for you to choose on Assets/EcoModKit/Assets/Food, or alternatively, create a new one inheriting from FoodBiteSequence class.&lt;br /&gt;
|-&lt;br /&gt;
|Plate Template&lt;br /&gt;
|It refers as its name implies to the object in your food that sort of acts like a container, E.G: a bowl in a salad.&lt;br /&gt;
|-&lt;br /&gt;
|Default Animation Override&lt;br /&gt;
|It refers to the hand&#039;s animations to be used when eating, you can either create a Custom one using Custom Animsets Override or choose one of the already predefined animations that we already have in ECO.&lt;br /&gt;
|-&lt;br /&gt;
|Utensil Config&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Utensil Template&lt;br /&gt;
|refers to the model used as a utensil like a fork or a spoon&lt;br /&gt;
|-&lt;br /&gt;
|Use Auto Utensil Part Placement&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Custom Food Chunk for utensils&lt;br /&gt;
|refers to the model used when grabbing pieces of chunk from the food&lt;br /&gt;
|-&lt;br /&gt;
|Utensil Part Position Offset&lt;br /&gt;
|Helper to better adjust the utensil position within the hands model.&lt;br /&gt;
|-&lt;br /&gt;
|Utensil Part Rotation Offset&lt;br /&gt;
|Helper to better adjust the utensil rotation within the hands model.&lt;br /&gt;
|-&lt;br /&gt;
|Utensil Scale&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Misc Config&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Position Offset&lt;br /&gt;
|Helper to better adjust the food position within the hands model .&lt;br /&gt;
|-&lt;br /&gt;
|Rotation Offset&lt;br /&gt;
|Helper to better adjust the food rotation within the hands model .&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Default Animation Override options&#039;&#039;&#039;&lt;br /&gt;
[[File:COTCmodguide DefaultAnimationOverrideOptions.png|none|thumb|418x418px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Lastly, there are tools to help you set up the object as well as visualize it. &#039;&#039;&#039;Add FPV components&#039;&#039;&#039; will add &#039;&#039;&#039;Tool Interaction&#039;&#039;&#039;, &#039;&#039;&#039;Food Effects&#039;&#039;&#039; and &#039;&#039;&#039;Perform Interaction. While Add TPV components&#039;&#039;&#039; will only add &#039;&#039;&#039;Tool Interaction&#039;&#039;&#039; and &#039;&#039;&#039;Food Effects.&#039;&#039;&#039;&lt;br /&gt;
[[File:COTCmodguide CustomEditorTools.png|none|thumb|801x801px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Food Effects&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Sequence Interaction Effects&lt;br /&gt;
!Should the interaction effects play all at once or in a sequence with each bite?&lt;br /&gt;
|-&lt;br /&gt;
|Interaction Particle Systems&lt;br /&gt;
|Interaction Particles are for when the player interacts with the food before taking a bite. eg. spoon entering the soup&lt;br /&gt;
|-&lt;br /&gt;
|Sequence Bite Effects&lt;br /&gt;
|Should the bite effects play all at once or in a sequence with each bite?&lt;br /&gt;
|-&lt;br /&gt;
|Bite Effect Particle Systems&lt;br /&gt;
|Bite Particles are for when the player actually takes a bite.&lt;br /&gt;
|-&lt;br /&gt;
|Food Sound Type&lt;br /&gt;
|audio category for the chewing sounds on each bite&lt;br /&gt;
|-&lt;br /&gt;
|Interaction Sound Type&lt;br /&gt;
|Sound to play when the player interacts with the food eg. Spoon entering soup&lt;br /&gt;
|-&lt;br /&gt;
|Mouth Effect Transform&lt;br /&gt;
|Optional: If sequencing mouth effects then you can parent the individual effects to this transformation and it will be positioned to the mouth instead of the parent effect&lt;br /&gt;
|-&lt;br /&gt;
|Mouth Offset&lt;br /&gt;
|When passing an InteractionVFX through the Animation event(see animation events down below), the bite effects are moved to the camera’s position plus this offset in order to simulate mouth position&lt;br /&gt;
|-&lt;br /&gt;
|Mouth Spray Random Angle&lt;br /&gt;
|How much variety is there in the angle of juicy mouth effects&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Tool Interaction&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Property&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|Custom Animset Override&lt;br /&gt;
|Assets that allow for the FPV or TPV hands animations to be overridden by custom ones.&lt;br /&gt;
|}&lt;br /&gt;
----Continuing making the corn on the cob mod…, First I’ll rename Food_Base object into something more appropriate like &#039;&#039;&#039;CornOnTheCob_Eatable&#039;&#039;&#039; and import the food parts mesh as a child of this object. Remember that this will constitute the base for our food object.&lt;br /&gt;
[[File:COTCmodguide ImportingFoodModel.png|none|thumb|846x846px]]&lt;br /&gt;
*After importing the mesh into the scene you can add the parts automatically by pressing the &#039;&#039;&#039;TryAutoSetupParts&#039;&#039;&#039; button, in this case, I removed the last part since that is the stem of the corn.&lt;br /&gt;
*I Set Bite Sequence to OneByOne since the corn mesh will disappear piece by piece after each bite.&lt;br /&gt;
*Default animation override is set to Eat_Corn, those animations are already defined in Eco.&lt;br /&gt;
*Lastly some adjustments to the object’s position and it’s offsetsin order to fit the corn correctly in the hands of the player while it plays the animations.&lt;br /&gt;
You can see the final result of how I ended setting up the BiteableFoodObject.&lt;br /&gt;
[[File:COTCmodguide BiteableFoodObjectSetup 1.png|none|thumb|921x921px]]&lt;br /&gt;
[[File:COTCmodguide BiteableFoodObjectSetup 2.png|none|thumb|571x571px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Regarding &#039;&#039;&#039;ToolInteraction,&#039;&#039;&#039; I left it as it is for now.&lt;br /&gt;
&lt;br /&gt;
On Food Effects I changed the &#039;&#039;&#039;Food Sound Type&#039;&#039;&#039; to Hard and the Interaction Sound Type to Nibbles.&lt;br /&gt;
[[File:COTCmodguide FoodEffects.png|none|thumb|702x702px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once this is done we can turn &#039;&#039;&#039;CornOntheCob_Eatable&#039;&#039;&#039; into a prefab and delete it from the scene, this prefab will be useful for TPV Food, from this prefab we will create a Prefab variant renaming it in the process to &#039;&#039;&#039;CornOntheCob_Eatable_FPV&#039;&#039;&#039; which will, in turn, be our FPV food.&lt;br /&gt;
[[File:COTCmodguide CreatePrefabVariant.png|none|thumb|766x766px]]&lt;br /&gt;
[[File:COTCmodguide Prefabs.png|none|thumb|677x677px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now let’s modify &#039;&#039;&#039;CornOnTheCob_Eatable_FPV :&#039;&#039;&#039;&lt;br /&gt;
*I’ll press the “Add FPV components” button which will add the &#039;&#039;&#039;PerfomInteraction&#039;&#039;&#039; component.&lt;br /&gt;
*Change &#039;&#039;&#039;DefaultAnimationOverride&#039;&#039;&#039; in &#039;&#039;&#039;BiteableFoodObject&#039;&#039;&#039; to &#039;&#039;&#039;Custom.&#039;&#039;&#039;&lt;br /&gt;
*Change &#039;&#039;&#039;CustomAnimset&#039;&#039;&#039; in &#039;&#039;&#039;ToolInteraction&#039;&#039;&#039; to a new &#039;&#039;&#039;CustomAnimset Override&#039;&#039;&#039; asset. Which contains the necessary FPV hand animations related to eating the Corn On The Cob.&lt;br /&gt;
*Lastly, I modified the position offset and rotation offset of the &#039;&#039;&#039;BitableFoodObject&#039;&#039;&#039; component&lt;br /&gt;
[[File:COTCmodguide BiteableFoodObject prefabvariant.png|none|thumb|739x739px]]&lt;br /&gt;
[[File:COTCmodguide ToolInteraction prefabVariant.png|none|thumb|932x932px]]&lt;br /&gt;
===&#039;&#039;&#039;Overriding Custom Animations&#039;&#039;&#039;===&lt;br /&gt;
*On the project tab right click Create → Eco → Animation → Animset Override, you will get this asset, in the example mod I choose to override the FPV animations&lt;br /&gt;
[[File:COTCmodguide CustomAnimsetOverride.png|none|thumb|974x974px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the mod example, I pressed the “Food_FPV” button which will automatically add the name of the animations to override(shown in the image), and then set the correspondent animation clips.&lt;br /&gt;
&lt;br /&gt;
(A reminder that these animations clips can be created by yourself via the &#039;&#039;&#039;[/cdn-cgi/l/email-protection &amp;lt;nowiki&amp;gt;[email protected]&amp;lt;/nowiki&amp;gt;]_Hands_tpose.fbx)&#039;&#039;&#039;&lt;br /&gt;
===&#039;&#039;&#039;Adding Events to Animations&#039;&#039;&#039;===&lt;br /&gt;
After creating your &#039;&#039;&#039;CustomAnimsetOverride&#039;&#039;&#039; to add your own animations it is &#039;&#039;&#039;VERY&#039;&#039;&#039; important to add the following events to the correspondent animation clips since this is how the game actually knows the timing of when bites happen, when and what effects occur, and lastly when the food is consumed, all timed according to your animation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: Without these your mod won’t work.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Loop Events&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These events are primarily placed on the “&#039;&#039;&#039;Eat_Loop&#039;&#039;&#039;” animations whether is FPV or TPV&lt;br /&gt;
*&#039;&#039;&#039;BiteEvent&#039;&#039;&#039;: Refers to every time it takes a bite in the animations, it is done this way so you can customize and time correctly when on your loop eating animation does the player actually takes a bite.&lt;br /&gt;
*&#039;&#039;&#039;BiteEffectsEvent&#039;&#039;&#039;: It represents multiple types of effects, it receives an integer as a parameter. The integer represents the FoodEffectType, which can be found here.&lt;br /&gt;
**[[File:COTCmodguide BiteEffectEvents.jpg|none|thumb|629x629px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Exit Event&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These events are primarily placed on the “&#039;&#039;&#039;Eat_Loop_Exi&#039;&#039;&#039;t” animations whether is FPV or TPV&lt;br /&gt;
*FoodConsumedEvent: Placed after eating it determines if the BiteableFoodObject has been consumed in its entirety, adding then calories and nutrients.&lt;br /&gt;
&#039;&#039;&#039;Last step:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After having created the &#039;&#039;&#039;CornOnTheCob_Eatable.prefab&#039;&#039;&#039; and &#039;&#039;&#039;CornOnTheCob_Eatable_FPV.prefab,&#039;&#039;&#039; we will then place &#039;&#039;&#039;CornOnTheCob_Eatable_FPV.prefab&#039;&#039;&#039; as a child of Tool object , then we go to Avatar object in &#039;&#039;&#039;AvatarAttachedPart&#039;&#039;&#039; component ****and set the &#039;&#039;&#039;Male prefab&#039;&#039;&#039; and &#039;&#039;&#039;Female prefab&#039;&#039;&#039; fields both to &#039;&#039;&#039;CornOnTheCob_Eatable.prefab.&#039;&#039;&#039; The object under tool will be used for the FPV of the food, and the object reference in male and female fields on AvatarAttachedPart will be used for the TPV of the food.&lt;br /&gt;
[[File:COTCmodguide FinalSetup.png|none|thumb|509x509px]]&lt;br /&gt;
[[File:COTCmodguide AvatarAttachedPart.png|none|thumb|503x503px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, Deactivate CornOnTheCobItem and build the modkit, then you’re set to go!&lt;br /&gt;
----Some further notes: This guide explains how the CornOnTheCob Food Mod was created and explains the critical processes involved in it that relate to food modding. It isn’t therefore a strict guide on how to make your food mod. You can technically deviate from the guide, create different prefabs for the FPV and TPV, or even different prefabs for Male and Female, it’s all up to the modder.&lt;br /&gt;
Keep in mind:&lt;br /&gt;
*If you want to make your custom animations make sure to add the animation events&lt;br /&gt;
*Name the Item correctly so that it coincides with the item class in Server&lt;br /&gt;
*Have the correct component on your FPV food and your TPV food.&lt;br /&gt;
===&#039;&#039;&#039;Errors and Warnings&#039;&#039;&#039;===&lt;br /&gt;
You might have wondered what those error signs and warning signs mean allow me to explain&lt;br /&gt;
*When setting the DefaultAnimationOverride to &#039;&#039;&#039;Custom&#039;&#039;&#039; it is expected for you to fill the field of &#039;&#039;&#039;Custom Animset&#039;&#039;&#039; in Tool Interaction, if this isn’t the case the next error message will appear, which indicates that you should add a &#039;&#039;&#039;Custom Animset&#039;&#039;&#039; because otherwise there wouldn’t be an animation&lt;br /&gt;
[[File:COTCmodguide ErrorPopUp.png|none|thumb|434x434px]]&lt;br /&gt;
*When setting the &#039;&#039;&#039;DefaultAnimationOverride&#039;&#039;&#039; to anything other than &#039;&#039;&#039;Custom&#039;&#039;&#039;, and also having the &#039;&#039;&#039;Custom Animset&#039;&#039;&#039; on &#039;&#039;&#039;Tool Interaction&#039;&#039;&#039; set, the latter one will be used instead of the specified one in &#039;&#039;&#039;DefaultAnimationOverride,&#039;&#039;&#039; for the warning to disappear you should change &#039;&#039;&#039;DefaultAnimationOverride&#039;&#039;&#039; to Custom or unset the &#039;&#039;&#039;Custom Animset&#039;&#039;&#039; value&lt;br /&gt;
[[File:COTCmodguide WarningPopup.png|none|thumb|443x443px]]&lt;/div&gt;</summary>
		<author><name>Felipe</name></author>
	</entry>
	<entry>
		<id>https://wiki.play.eco/en/index.php?title=Corn-on-the-cob_example_mod&amp;diff=8631</id>
		<title>Corn-on-the-cob example mod</title>
		<link rel="alternate" type="text/html" href="https://wiki.play.eco/en/index.php?title=Corn-on-the-cob_example_mod&amp;diff=8631"/>
		<updated>2022-07-11T17:45:41Z</updated>

		<summary type="html">&lt;p&gt;Felipe: /* Base object setup */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://drive.google.com/drive/u/1/folders/1coxU8BGCyjKS52eOphCIMWX7ULiCEgac End result after building Modkit]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/StrangeLoopGames/EcoModKit/tree/main Find the example files here]&lt;br /&gt;
===&#039;&#039;&#039;Server&#039;&#039;&#039;===&lt;br /&gt;
Create a class library project in the latest version of Visual Studio with .Net 6.0 as the target framework. Then right-click dependencies and add project reference, on it browse for the downloaded reference assemblies dlls.[[File:COTCmodguide ServerSetup.jpg|617x617px]]&lt;br /&gt;
&lt;br /&gt;
Right click project then add a new Item → add a new code file, name it appropriately.&lt;br /&gt;
&lt;br /&gt;
[[File:Modguide_pt2.jpg|925x925px]]&lt;br /&gt;
&lt;br /&gt;
On the code file use the following namespaces that should cover all of the definitions used when creating a new Food Item.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using System;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using System.Collections.Generic;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using System.Linq;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using Eco.Core.Items;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using Eco.Gameplay.Components;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using Eco.Gameplay.Items;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using Eco.Gameplay.Players;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using Eco.Gameplay.Skills;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using Eco.Shared.Localization;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using Eco.Shared.Serialization;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After that create the CornOnTheCobItem partial class inside the namespace Eco.Mods.TechTree, make sure that it is named appropriately by having the suffix “Item”. Also that it inherits from FoodItem class. Implement abstract members of &#039;&#039;&#039;Nutrition&#039;&#039;&#039;, &#039;&#039;&#039;Calories&#039;&#039;&#039; and &#039;&#039;&#039;ShelfLife&#039;&#039;&#039; and add [Serialized],[LocDisplayName()] attributes to the class as shown in the image.&lt;br /&gt;
[[File:COTCmodguide ClassSetup 1.png|none|thumb|862x862px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After adding the necessary stuff we can add the [Weight] and [Tag] attributes to the class, which are not necessarily required but rather recommended. Also, override &#039;&#039;&#039;DisplayNamePlural&#039;&#039;&#039; and &#039;&#039;&#039;DisplayDescription&#039;&#039;&#039; so that the item can display in the interface a name and a description, like so.&lt;br /&gt;
[[File:COTCmodguide ClassSetup 2.png|none|thumb|607x607px]]&lt;br /&gt;
===&#039;&#039;&#039;Client&#039;&#039;&#039;===&lt;br /&gt;
First things first Import the modkit into your unity project.&lt;br /&gt;
[[File:COTCmodguide ClientSetup 1.png|none|thumb|455x455px]]&lt;br /&gt;
Import the assets you’re going to use. In this case, I’m importing the corn mesh divided into parts, the FPV hands necessary animations, and the corn Icon, I’m not importing the TPV hands animations to show how you can use animations already found within the game. Either way, you can create your own hand animations by using the .FBX hands model found in &#039;&#039;&#039;Assets/EcoModKit/Assets/Food/HandsModel/[/cdn-cgi/l/email-protection &amp;lt;nowiki&amp;gt;[email protected]&amp;lt;/nowiki&amp;gt;]_Hands_Tpose.FBX&#039;&#039;&#039; in 3d animation software such as blender.&lt;br /&gt;
&lt;br /&gt;
[[File:COTCmodguide ClientSetup 2.png|370x370px]]&lt;br /&gt;
&lt;br /&gt;
Finally, delete all the objects by default in the sample scene.&lt;br /&gt;
----&lt;br /&gt;
===&#039;&#039;&#039;Base object setup&#039;&#039;&#039;===&lt;br /&gt;
We want to first build the base of our food object, from which we can use as the TPV version and then override it and create the FPV version.&lt;br /&gt;
[[File:COTCmodguide ClassSetup 3.png|thumb]]&lt;br /&gt;
Import FoodItemTemplate into the scene, Import TMP essentials if a popup appears, then after getting to &#039;&#039;&#039;FoodItemTemplate&#039;&#039;&#039; prefab on the scene we’re going to Unpack it completely and rename it correctly, in this case, &#039;&#039;&#039;CornOnTheCobItem(the same as the partial class in Server side of things that represents the item)&#039;&#039;&#039;, it is important to keep the naming convention to end in “Item”&lt;br /&gt;
[[File:COTCmodguide unpacking template.png|none|thumb|494x494px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is the structure we’re left with after importing the prefab into the scene , unpacking it and renaming it.&lt;br /&gt;
[[File:COTCmodguide foodItemTemplateStructure.jpg|none|thumb|461x461px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Change the sprite on the &#039;&#039;&#039;Image&#039;&#039;&#039; Component in both the &#039;&#039;&#039;Foreground&#039;&#039;&#039; object and &#039;&#039;&#039;FullImage&#039;&#039;&#039; object, as well as write the correct name on the &#039;&#039;&#039;TextMeshPro&#039;&#039;&#039; component in the &#039;&#039;&#039;IconName&#039;&#039;&#039; object&lt;br /&gt;
[[File:COTCmodguide ComponentsSetup 1.png|none|thumb|969x969px]]&lt;br /&gt;
----&#039;&#039;&#039;Components Setup&#039;&#039;&#039;&lt;br /&gt;
Now let’s focus on the tool object, specifically the Food_FPV object, there we will find the following components: &#039;&#039;&#039;BiteableFoodObject&#039;&#039;&#039;, &#039;&#039;&#039;ToolInteraction&#039;&#039;&#039;, and &#039;&#039;&#039;Food Effects.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Biteable Food Object&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Property&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|Food Parts *&lt;br /&gt;
|Reference to all the GameObjects that represent all the different bites that it takes to consume. E.G the different meshes of the corn.&lt;br /&gt;
|-&lt;br /&gt;
|Bite Sequence *&lt;br /&gt;
|Refers to how the GameObjects that compose meshes will behave with each bite, you could have a tomato for example which is just various types of the same mesh in different states or a salad which is composed of various parts. There are already 2 options defined for you to choose on Assets/EcoModKit/Assets/Food, or alternatively, create a new one inheriting from FoodBiteSequence class.&lt;br /&gt;
|-&lt;br /&gt;
|Plate Template&lt;br /&gt;
|It refers as its name implies to the object in your food that sort of acts like a container, E.G: a bowl in a salad.&lt;br /&gt;
|-&lt;br /&gt;
|Default Animation Override&lt;br /&gt;
|It refers to the hand&#039;s animations to be used when eating, you can either create a Custom one using Custom Animsets Override or choose one of the already predefined animations that we already have in ECO.&lt;br /&gt;
|-&lt;br /&gt;
|Utensil Config&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Utensil Template&lt;br /&gt;
|refers to the model used as a utensil like a fork or a spoon&lt;br /&gt;
|-&lt;br /&gt;
|Use Auto Utensil Part Placement&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Custom Food Chunk for utensils&lt;br /&gt;
|refers to the model used when grabbing pieces of chunk from the food&lt;br /&gt;
|-&lt;br /&gt;
|Utensil Part Position Offset&lt;br /&gt;
|Helper to better adjust the utensil position within the hands model.&lt;br /&gt;
|-&lt;br /&gt;
|Utensil Part Rotation Offset&lt;br /&gt;
|Helper to better adjust the utensil rotation within the hands model.&lt;br /&gt;
|-&lt;br /&gt;
|Utensil Scale&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Misc Config&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Position Offset&lt;br /&gt;
|Helper to better adjust the food position within the hands model .&lt;br /&gt;
|-&lt;br /&gt;
|Rotation Offset&lt;br /&gt;
|Helper to better adjust the food rotation within the hands model .&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Default Animation Override options&#039;&#039;&#039;&lt;br /&gt;
[[File:COTCmodguide DefaultAnimationOverrideOptions.png|none|thumb|418x418px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Lastly, there are tools to help you set up the object as well as visualize it. &#039;&#039;&#039;Add FPV components&#039;&#039;&#039; will add &#039;&#039;&#039;Tool Interaction&#039;&#039;&#039;, &#039;&#039;&#039;Food Effects&#039;&#039;&#039; and &#039;&#039;&#039;Perform Interaction. While Add TPV components&#039;&#039;&#039; will only add &#039;&#039;&#039;Tool Interaction&#039;&#039;&#039; and &#039;&#039;&#039;Food Effects.&#039;&#039;&#039;&lt;br /&gt;
[[File:COTCmodguide CustomEditorTools.png|none|thumb|801x801px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Food Effects&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Sequence Interaction Effects&lt;br /&gt;
!Should the interaction effects play all at once or in a sequence with each bite?&lt;br /&gt;
|-&lt;br /&gt;
|Interaction Particle Systems&lt;br /&gt;
|Interaction Particles are for when the player interacts with the food before taking a bite. eg. spoon entering the soup&lt;br /&gt;
|-&lt;br /&gt;
|Sequence Bite Effects&lt;br /&gt;
|Should the bite effects play all at once or in a sequence with each bite?&lt;br /&gt;
|-&lt;br /&gt;
|Bite Effect Particle Systems&lt;br /&gt;
|Bite Particles are for when the player actually takes a bite.&lt;br /&gt;
|-&lt;br /&gt;
|Food Sound Type&lt;br /&gt;
|audio category for the chewing sounds on each bite&lt;br /&gt;
|-&lt;br /&gt;
|Interaction Sound Type&lt;br /&gt;
|Sound to play when the player interacts with the food eg. Spoon entering soup&lt;br /&gt;
|-&lt;br /&gt;
|Mouth Effect Transform&lt;br /&gt;
|Optional: If sequencing mouth effects then you can parent the individual effects to this transformation and it will be positioned to the mouth instead of the parent effect&lt;br /&gt;
|-&lt;br /&gt;
|Mouth Offset&lt;br /&gt;
|When passing an InteractionVFX through the Animation event(see animation events down below), the bite effects are moved to the camera’s position plus this offset in order to simulate mouth position&lt;br /&gt;
|-&lt;br /&gt;
|Mouth Spray Random Angle&lt;br /&gt;
|How much variety is there in the angle of juicy mouth effects&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Tool Interaction&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Property&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|Custom Animset Override&lt;br /&gt;
|Assets that allow for the FPV or TPV hands animations to be overridden by custom ones.&lt;br /&gt;
|}&lt;br /&gt;
----Continuing making the corn on the cob mod…, First I’ll rename Food_Base object into something more appropriate like &#039;&#039;&#039;CornOnTheCob_Eatable&#039;&#039;&#039; and import the food parts mesh as a child of this object. Remember that this will constitute the base for our food object.&lt;br /&gt;
[[File:COTCmodguide ImportingFoodModel.png|none|thumb|846x846px]]&lt;br /&gt;
*After importing the mesh into the scene you can add the parts automatically by pressing the &#039;&#039;&#039;TryAutoSetupParts&#039;&#039;&#039; button, in this case, I removed the last part since that is the stem of the corn.&lt;br /&gt;
*I Set Bite Sequence to OneByOne since the corn mesh will disappear piece by piece after each bite.&lt;br /&gt;
*Default animation override is set to Eat_Corn, those animations are already defined in Eco.&lt;br /&gt;
*Lastly some adjustments to the object’s position and it’s offsetsin order to fit the corn correctly in the hands of the player while it plays the animations.&lt;br /&gt;
You can see the final result of how I ended setting up the BiteableFoodObject.&lt;br /&gt;
[[File:COTCmodguide BiteableFoodObjectSetup 1.png|none|thumb|921x921px]]&lt;br /&gt;
[[File:COTCmodguide BiteableFoodObjectSetup 2.png|none|thumb|571x571px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Regarding &#039;&#039;&#039;ToolInteraction,&#039;&#039;&#039; I left it as it is for now.&lt;br /&gt;
&lt;br /&gt;
On Food Effects I changed the &#039;&#039;&#039;Food Sound Type&#039;&#039;&#039; to Hard and the Interaction Sound Type to Nibbles.&lt;br /&gt;
[[File:COTCmodguide FoodEffects.png|none|thumb|702x702px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once this is done we can turn &#039;&#039;&#039;CornOntheCob_Eatable&#039;&#039;&#039; into a prefab and delete it from the scene, this prefab will be useful for TPV Food, from this prefab we will create a Prefab variant renaming it in the process to &#039;&#039;&#039;CornOntheCob_Eatable_FPV&#039;&#039;&#039; which will, in turn, be our FPV food.&lt;br /&gt;
[[File:COTCmodguide CreatePrefabVariant.png|none|thumb|766x766px]]&lt;br /&gt;
[[File:COTCmodguide Prefabs.png|none|thumb|677x677px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now let’s modify &#039;&#039;&#039;CornOnTheCob_Eatable_FPV :&#039;&#039;&#039;&lt;br /&gt;
*I’ll press the “Add FPV components” button which will add the &#039;&#039;&#039;PerfomInteraction&#039;&#039;&#039; component.&lt;br /&gt;
*Change &#039;&#039;&#039;DefaultAnimationOverride&#039;&#039;&#039; in &#039;&#039;&#039;BiteableFoodObject&#039;&#039;&#039; to &#039;&#039;&#039;Custom.&#039;&#039;&#039;&lt;br /&gt;
*Change &#039;&#039;&#039;CustomAnimset&#039;&#039;&#039; in &#039;&#039;&#039;ToolInteraction&#039;&#039;&#039; to a new &#039;&#039;&#039;CustomAnimset Override&#039;&#039;&#039; asset. Which contains the necessary FPV hand animations related to eating the Corn On The Cob.&lt;br /&gt;
*Lastly, I modified the position offset and rotation offset of the &#039;&#039;&#039;BitableFoodObject&#039;&#039;&#039; component&lt;br /&gt;
[[File:COTCmodguide BiteableFoodObject prefabvariant.png|none|thumb|739x739px]]&lt;br /&gt;
[[File:COTCmodguide ToolInteraction prefabVariant.png|none|thumb|932x932px]]&lt;br /&gt;
===&#039;&#039;&#039;Overriding Custom Animations&#039;&#039;&#039;===&lt;br /&gt;
*On the project tab right click Create → Eco → Animation → Animset Override, you will get this asset, in the example mod I choose to override the FPV animations&lt;br /&gt;
[[File:COTCmodguide CustomAnimsetOverride.png|none|thumb|974x974px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the mod example, I pressed the “Food_FPV” button which will automatically add the name of the animations to override(shown in the image), and then set the correspondent animation clips.&lt;br /&gt;
&lt;br /&gt;
(A reminder that these animations clips can be created by yourself via the &#039;&#039;&#039;[/cdn-cgi/l/email-protection &amp;lt;nowiki&amp;gt;[email protected]&amp;lt;/nowiki&amp;gt;]_Hands_tpose.fbx)&#039;&#039;&#039;&lt;br /&gt;
===&#039;&#039;&#039;Adding Events to Animations&#039;&#039;&#039;===&lt;br /&gt;
After creating your &#039;&#039;&#039;CustomAnimsetOverride&#039;&#039;&#039; to add your own animations it is &#039;&#039;&#039;VERY&#039;&#039;&#039; important to add the following events to the correspondent animation clips since this is how the game actually knows the timing of when bites happen, when and what effects occur, and lastly when the food is consumed, all timed according to your animation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: Without these your mod won’t work.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Loop Events&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These events are primarily placed on the “&#039;&#039;&#039;Eat_Loop&#039;&#039;&#039;” animations whether is FPV or TPV&lt;br /&gt;
*&#039;&#039;&#039;BiteEvent&#039;&#039;&#039;: Refers to every time it takes a bite in the animations, it is done this way so you can customize and time correctly when on your loop eating animation does the player actually takes a bite.&lt;br /&gt;
*&#039;&#039;&#039;BiteEffectsEvent&#039;&#039;&#039;: It represents multiple types of effects, it receives an integer as a parameter. The integer represents the FoodEffectType, which can be found here.&lt;br /&gt;
**[[File:COTCmodguide BiteEffectEvents.jpg|none|thumb|629x629px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Exit Event&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These events are primarily placed on the “&#039;&#039;&#039;Eat_Loop_Exi&#039;&#039;&#039;t” animations whether is FPV or TPV&lt;br /&gt;
*FoodConsumedEvent: Placed after eating it determines if the BiteableFoodObject has been consumed in its entirety, adding then calories and nutrients.&lt;br /&gt;
&#039;&#039;&#039;Last step:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After having created the &#039;&#039;&#039;CornOnTheCob_Eatable.prefab&#039;&#039;&#039; and &#039;&#039;&#039;CornOnTheCob_Eatable_FPV.prefab,&#039;&#039;&#039; we will then place &#039;&#039;&#039;CornOnTheCob_Eatable_FPV.prefab&#039;&#039;&#039; as a child of Tool object , then we go to Avatar object in &#039;&#039;&#039;AvatarAttachedPart&#039;&#039;&#039; component ****and set the &#039;&#039;&#039;Male prefab&#039;&#039;&#039; and &#039;&#039;&#039;Female prefab&#039;&#039;&#039; fields both to &#039;&#039;&#039;CornOnTheCob_Eatable.prefab.&#039;&#039;&#039; The object under tool will be used for the FPV of the food, and the object reference in male and female fields on AvatarAttachedPart will be used for the TPV of the food.&lt;br /&gt;
[[File:COTCmodguide FinalSetup.png|none|thumb|509x509px]]&lt;br /&gt;
[[File:COTCmodguide AvatarAttachedPart.png|none|thumb|503x503px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, Deactivate CornOnTheCobItem and build the modkit, then you’re set to go!&lt;br /&gt;
----Some further notes: This guide explains how the CornOnTheCob Food Mod was created and explains the critical processes involved in it that relate to food modding. It isn’t therefore a strict guide on how to make your food mod. You can technically deviate from the guide, create different prefabs for the FPV and TPV, or even different prefabs for Male and Female, it’s all up to the modder.&lt;br /&gt;
Keep in mind:&lt;br /&gt;
*If you want to make your custom animations make sure to add the animation events&lt;br /&gt;
*Name the Item correctly so that it coincides with the item class in Server&lt;br /&gt;
*Have the correct component on your FPV food and your TPV food.&lt;br /&gt;
===&#039;&#039;&#039;Errors and Warnings&#039;&#039;&#039;===&lt;br /&gt;
You might have wondered what those error signs and warning signs mean allow me to explain&lt;br /&gt;
*When setting the DefaultAnimationOverride to &#039;&#039;&#039;Custom&#039;&#039;&#039; it is expected for you to fill the field of &#039;&#039;&#039;Custom Animset&#039;&#039;&#039; in Tool Interaction, if this isn’t the case the next error message will appear, which indicates that you should add a &#039;&#039;&#039;Custom Animset&#039;&#039;&#039; because otherwise there wouldn’t be an animation&lt;br /&gt;
[[File:COTCmodguide ErrorPopUp.png|none|thumb|434x434px]]&lt;br /&gt;
*When setting the &#039;&#039;&#039;DefaultAnimationOverride&#039;&#039;&#039; to anything other than &#039;&#039;&#039;Custom&#039;&#039;&#039;, and also having the &#039;&#039;&#039;Custom Animset&#039;&#039;&#039; on &#039;&#039;&#039;Tool Interaction&#039;&#039;&#039; set, the latter one will be used instead of the specified one in &#039;&#039;&#039;DefaultAnimationOverride,&#039;&#039;&#039; for the warning to disappear you should change &#039;&#039;&#039;DefaultAnimationOverride&#039;&#039;&#039; to Custom or unset the &#039;&#039;&#039;Custom Animset&#039;&#039;&#039; value&lt;br /&gt;
[[File:COTCmodguide WarningPopup.png|none|thumb|443x443px]]&lt;/div&gt;</summary>
		<author><name>Felipe</name></author>
	</entry>
	<entry>
		<id>https://wiki.play.eco/en/index.php?title=Corn-on-the-cob_example_mod&amp;diff=8630</id>
		<title>Corn-on-the-cob example mod</title>
		<link rel="alternate" type="text/html" href="https://wiki.play.eco/en/index.php?title=Corn-on-the-cob_example_mod&amp;diff=8630"/>
		<updated>2022-07-11T17:45:22Z</updated>

		<summary type="html">&lt;p&gt;Felipe: Added Corn on the cob mod example guide, end result bundle files link, and it&amp;#039;s link to the example in github.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://drive.google.com/drive/u/1/folders/1coxU8BGCyjKS52eOphCIMWX7ULiCEgac End result after building Modkit] &lt;br /&gt;
&lt;br /&gt;
[https://github.com/StrangeLoopGames/EcoModKit/tree/main Find the example files here]&lt;br /&gt;
&lt;br /&gt;
===&#039;&#039;&#039;Server&#039;&#039;&#039;===&lt;br /&gt;
Create a class library project in the latest version of Visual Studio with .Net 6.0 as the target framework. Then right-click dependencies and add project reference, on it browse for the downloaded reference assemblies dlls.[[File:COTCmodguide ServerSetup.jpg|617x617px]]&lt;br /&gt;
&lt;br /&gt;
Right click project then add a new Item → add a new code file, name it appropriately.&lt;br /&gt;
&lt;br /&gt;
[[File:Modguide_pt2.jpg|925x925px]]&lt;br /&gt;
&lt;br /&gt;
On the code file use the following namespaces that should cover all of the definitions used when creating a new Food Item.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using System;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using System.Collections.Generic;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using System.Linq;&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using Eco.Core.Items;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using Eco.Gameplay.Components;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using Eco.Gameplay.Items;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using Eco.Gameplay.Players;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using Eco.Gameplay.Skills;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using Eco.Shared.Localization;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;using Eco.Shared.Serialization;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After that create the CornOnTheCobItem partial class inside the namespace Eco.Mods.TechTree, make sure that it is named appropriately by having the suffix “Item”. Also that it inherits from FoodItem class. Implement abstract members of &#039;&#039;&#039;Nutrition&#039;&#039;&#039;, &#039;&#039;&#039;Calories&#039;&#039;&#039; and &#039;&#039;&#039;ShelfLife&#039;&#039;&#039; and add [Serialized],[LocDisplayName()] attributes to the class as shown in the image.&lt;br /&gt;
[[File:COTCmodguide ClassSetup 1.png|none|thumb|862x862px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After adding the necessary stuff we can add the [Weight] and [Tag] attributes to the class, which are not necessarily required but rather recommended. Also, override &#039;&#039;&#039;DisplayNamePlural&#039;&#039;&#039; and &#039;&#039;&#039;DisplayDescription&#039;&#039;&#039; so that the item can display in the interface a name and a description, like so.&lt;br /&gt;
[[File:COTCmodguide ClassSetup 2.png|none|thumb|607x607px]]&lt;br /&gt;
===&#039;&#039;&#039;Client&#039;&#039;&#039;===&lt;br /&gt;
First things first Import the modkit into your unity project.&lt;br /&gt;
[[File:COTCmodguide ClientSetup 1.png|none|thumb|455x455px]]&lt;br /&gt;
Import the assets you’re going to use. In this case, I’m importing the corn mesh divided into parts, the FPV hands necessary animations, and the corn Icon, I’m not importing the TPV hands animations to show how you can use animations already found within the game. Either way, you can create your own hand animations by using the .FBX hands model found in &#039;&#039;&#039;Assets/EcoModKit/Assets/Food/HandsModel/[/cdn-cgi/l/email-protection &amp;lt;nowiki&amp;gt;[email protected]&amp;lt;/nowiki&amp;gt;]_Hands_Tpose.FBX&#039;&#039;&#039; in 3d animation software such as blender.&lt;br /&gt;
&lt;br /&gt;
[[File:COTCmodguide ClientSetup 2.png|370x370px]]&lt;br /&gt;
&lt;br /&gt;
Finally, delete all the objects by default in the sample scene.&lt;br /&gt;
----&lt;br /&gt;
===Base object setup===&lt;br /&gt;
We want to first build the base of our food object, from which we can use as the TPV version and then override it and create the FPV version.&lt;br /&gt;
[[File:COTCmodguide ClassSetup 3.png|thumb]]&lt;br /&gt;
Import FoodItemTemplate into the scene, Import TMP essentials if a popup appears, then after getting to &#039;&#039;&#039;FoodItemTemplate&#039;&#039;&#039; prefab on the scene we’re going to Unpack it completely and rename it correctly, in this case, &#039;&#039;&#039;CornOnTheCobItem(the same as the partial class in Server side of things that represents the item)&#039;&#039;&#039;, it is important to keep the naming convention to end in “Item”&lt;br /&gt;
[[File:COTCmodguide unpacking template.png|none|thumb|494x494px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is the structure we’re left with after importing the prefab into the scene , unpacking it and renaming it.&lt;br /&gt;
[[File:COTCmodguide foodItemTemplateStructure.jpg|none|thumb|461x461px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Change the sprite on the &#039;&#039;&#039;Image&#039;&#039;&#039; Component in both the &#039;&#039;&#039;Foreground&#039;&#039;&#039; object and &#039;&#039;&#039;FullImage&#039;&#039;&#039; object, as well as write the correct name on the &#039;&#039;&#039;TextMeshPro&#039;&#039;&#039; component in the &#039;&#039;&#039;IconName&#039;&#039;&#039; object&lt;br /&gt;
[[File:COTCmodguide ComponentsSetup 1.png|none|thumb|969x969px]]&lt;br /&gt;
----&#039;&#039;&#039;Components Setup&#039;&#039;&#039;&lt;br /&gt;
Now let’s focus on the tool object, specifically the Food_FPV object, there we will find the following components: &#039;&#039;&#039;BiteableFoodObject&#039;&#039;&#039;, &#039;&#039;&#039;ToolInteraction&#039;&#039;&#039;, and &#039;&#039;&#039;Food Effects.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Biteable Food Object&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Property&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|Food Parts *&lt;br /&gt;
|Reference to all the GameObjects that represent all the different bites that it takes to consume. E.G the different meshes of the corn.&lt;br /&gt;
|-&lt;br /&gt;
|Bite Sequence *&lt;br /&gt;
|Refers to how the GameObjects that compose meshes will behave with each bite, you could have a tomato for example which is just various types of the same mesh in different states or a salad which is composed of various parts. There are already 2 options defined for you to choose on Assets/EcoModKit/Assets/Food, or alternatively, create a new one inheriting from FoodBiteSequence class.&lt;br /&gt;
|-&lt;br /&gt;
|Plate Template&lt;br /&gt;
|It refers as its name implies to the object in your food that sort of acts like a container, E.G: a bowl in a salad.&lt;br /&gt;
|-&lt;br /&gt;
|Default Animation Override&lt;br /&gt;
|It refers to the hand&#039;s animations to be used when eating, you can either create a Custom one using Custom Animsets Override or choose one of the already predefined animations that we already have in ECO.&lt;br /&gt;
|-&lt;br /&gt;
|Utensil Config&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Utensil Template&lt;br /&gt;
|refers to the model used as a utensil like a fork or a spoon&lt;br /&gt;
|-&lt;br /&gt;
|Use Auto Utensil Part Placement&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Custom Food Chunk for utensils&lt;br /&gt;
|refers to the model used when grabbing pieces of chunk from the food&lt;br /&gt;
|-&lt;br /&gt;
|Utensil Part Position Offset&lt;br /&gt;
|Helper to better adjust the utensil position within the hands model.&lt;br /&gt;
|-&lt;br /&gt;
|Utensil Part Rotation Offset&lt;br /&gt;
|Helper to better adjust the utensil rotation within the hands model.&lt;br /&gt;
|-&lt;br /&gt;
|Utensil Scale&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Misc Config&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Position Offset&lt;br /&gt;
|Helper to better adjust the food position within the hands model .&lt;br /&gt;
|-&lt;br /&gt;
|Rotation Offset&lt;br /&gt;
|Helper to better adjust the food rotation within the hands model .&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Default Animation Override options&#039;&#039;&#039;&lt;br /&gt;
[[File:COTCmodguide DefaultAnimationOverrideOptions.png|none|thumb|418x418px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Lastly, there are tools to help you set up the object as well as visualize it. &#039;&#039;&#039;Add FPV components&#039;&#039;&#039; will add &#039;&#039;&#039;Tool Interaction&#039;&#039;&#039;, &#039;&#039;&#039;Food Effects&#039;&#039;&#039; and &#039;&#039;&#039;Perform Interaction. While Add TPV components&#039;&#039;&#039; will only add &#039;&#039;&#039;Tool Interaction&#039;&#039;&#039; and &#039;&#039;&#039;Food Effects.&#039;&#039;&#039;&lt;br /&gt;
[[File:COTCmodguide CustomEditorTools.png|none|thumb|801x801px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Food Effects&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Sequence Interaction Effects&lt;br /&gt;
!Should the interaction effects play all at once or in a sequence with each bite?&lt;br /&gt;
|-&lt;br /&gt;
|Interaction Particle Systems&lt;br /&gt;
|Interaction Particles are for when the player interacts with the food before taking a bite. eg. spoon entering the soup&lt;br /&gt;
|-&lt;br /&gt;
|Sequence Bite Effects&lt;br /&gt;
|Should the bite effects play all at once or in a sequence with each bite?&lt;br /&gt;
|-&lt;br /&gt;
|Bite Effect Particle Systems&lt;br /&gt;
|Bite Particles are for when the player actually takes a bite.&lt;br /&gt;
|-&lt;br /&gt;
|Food Sound Type&lt;br /&gt;
|audio category for the chewing sounds on each bite&lt;br /&gt;
|-&lt;br /&gt;
|Interaction Sound Type&lt;br /&gt;
|Sound to play when the player interacts with the food eg. Spoon entering soup&lt;br /&gt;
|-&lt;br /&gt;
|Mouth Effect Transform&lt;br /&gt;
|Optional: If sequencing mouth effects then you can parent the individual effects to this transformation and it will be positioned to the mouth instead of the parent effect&lt;br /&gt;
|-&lt;br /&gt;
|Mouth Offset&lt;br /&gt;
|When passing an InteractionVFX through the Animation event(see animation events down below), the bite effects are moved to the camera’s position plus this offset in order to simulate mouth position&lt;br /&gt;
|-&lt;br /&gt;
|Mouth Spray Random Angle&lt;br /&gt;
|How much variety is there in the angle of juicy mouth effects&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Tool Interaction&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Property&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|Custom Animset Override&lt;br /&gt;
|Assets that allow for the FPV or TPV hands animations to be overridden by custom ones.&lt;br /&gt;
|}&lt;br /&gt;
----Continuing making the corn on the cob mod…, First I’ll rename Food_Base object into something more appropriate like &#039;&#039;&#039;CornOnTheCob_Eatable&#039;&#039;&#039; and import the food parts mesh as a child of this object. Remember that this will constitute the base for our food object.&lt;br /&gt;
[[File:COTCmodguide ImportingFoodModel.png|none|thumb|846x846px]]&lt;br /&gt;
*After importing the mesh into the scene you can add the parts automatically by pressing the &#039;&#039;&#039;TryAutoSetupParts&#039;&#039;&#039; button, in this case, I removed the last part since that is the stem of the corn.&lt;br /&gt;
*I Set Bite Sequence to OneByOne since the corn mesh will disappear piece by piece after each bite.&lt;br /&gt;
*Default animation override is set to Eat_Corn, those animations are already defined in Eco.&lt;br /&gt;
*Lastly some adjustments to the object’s position and it’s offsetsin order to fit the corn correctly in the hands of the player while it plays the animations.&lt;br /&gt;
You can see the final result of how I ended setting up the BiteableFoodObject.&lt;br /&gt;
[[File:COTCmodguide BiteableFoodObjectSetup 1.png|none|thumb|921x921px]]&lt;br /&gt;
[[File:COTCmodguide BiteableFoodObjectSetup 2.png|none|thumb|571x571px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Regarding &#039;&#039;&#039;ToolInteraction,&#039;&#039;&#039; I left it as it is for now.&lt;br /&gt;
&lt;br /&gt;
On Food Effects I changed the &#039;&#039;&#039;Food Sound Type&#039;&#039;&#039; to Hard and the Interaction Sound Type to Nibbles.&lt;br /&gt;
[[File:COTCmodguide FoodEffects.png|none|thumb|702x702px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once this is done we can turn &#039;&#039;&#039;CornOntheCob_Eatable&#039;&#039;&#039; into a prefab and delete it from the scene, this prefab will be useful for TPV Food, from this prefab we will create a Prefab variant renaming it in the process to &#039;&#039;&#039;CornOntheCob_Eatable_FPV&#039;&#039;&#039; which will, in turn, be our FPV food.&lt;br /&gt;
[[File:COTCmodguide CreatePrefabVariant.png|none|thumb|766x766px]]&lt;br /&gt;
[[File:COTCmodguide Prefabs.png|none|thumb|677x677px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now let’s modify &#039;&#039;&#039;CornOnTheCob_Eatable_FPV :&#039;&#039;&#039;&lt;br /&gt;
*I’ll press the “Add FPV components” button which will add the &#039;&#039;&#039;PerfomInteraction&#039;&#039;&#039; component.&lt;br /&gt;
*Change &#039;&#039;&#039;DefaultAnimationOverride&#039;&#039;&#039; in &#039;&#039;&#039;BiteableFoodObject&#039;&#039;&#039; to &#039;&#039;&#039;Custom.&#039;&#039;&#039;&lt;br /&gt;
*Change &#039;&#039;&#039;CustomAnimset&#039;&#039;&#039; in &#039;&#039;&#039;ToolInteraction&#039;&#039;&#039; to a new &#039;&#039;&#039;CustomAnimset Override&#039;&#039;&#039; asset. Which contains the necessary FPV hand animations related to eating the Corn On The Cob.&lt;br /&gt;
*Lastly, I modified the position offset and rotation offset of the &#039;&#039;&#039;BitableFoodObject&#039;&#039;&#039; component&lt;br /&gt;
[[File:COTCmodguide BiteableFoodObject prefabvariant.png|none|thumb|739x739px]]&lt;br /&gt;
[[File:COTCmodguide ToolInteraction prefabVariant.png|none|thumb|932x932px]]&lt;br /&gt;
===&#039;&#039;&#039;Overriding Custom Animations&#039;&#039;&#039;===&lt;br /&gt;
*On the project tab right click Create → Eco → Animation → Animset Override, you will get this asset, in the example mod I choose to override the FPV animations&lt;br /&gt;
[[File:COTCmodguide CustomAnimsetOverride.png|none|thumb|974x974px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On the mod example, I pressed the “Food_FPV” button which will automatically add the name of the animations to override(shown in the image), and then set the correspondent animation clips.&lt;br /&gt;
&lt;br /&gt;
(A reminder that these animations clips can be created by yourself via the &#039;&#039;&#039;[/cdn-cgi/l/email-protection &amp;lt;nowiki&amp;gt;[email protected]&amp;lt;/nowiki&amp;gt;]_Hands_tpose.fbx)&#039;&#039;&#039;&lt;br /&gt;
===&#039;&#039;&#039;Adding Events to Animations&#039;&#039;&#039;===&lt;br /&gt;
After creating your &#039;&#039;&#039;CustomAnimsetOverride&#039;&#039;&#039; to add your own animations it is &#039;&#039;&#039;VERY&#039;&#039;&#039; important to add the following events to the correspondent animation clips since this is how the game actually knows the timing of when bites happen, when and what effects occur, and lastly when the food is consumed, all timed according to your animation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: Without these your mod won’t work.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Loop Events&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These events are primarily placed on the “&#039;&#039;&#039;Eat_Loop&#039;&#039;&#039;” animations whether is FPV or TPV&lt;br /&gt;
*&#039;&#039;&#039;BiteEvent&#039;&#039;&#039;: Refers to every time it takes a bite in the animations, it is done this way so you can customize and time correctly when on your loop eating animation does the player actually takes a bite.&lt;br /&gt;
*&#039;&#039;&#039;BiteEffectsEvent&#039;&#039;&#039;: It represents multiple types of effects, it receives an integer as a parameter. The integer represents the FoodEffectType, which can be found here.&lt;br /&gt;
**[[File:COTCmodguide BiteEffectEvents.jpg|none|thumb|629x629px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Exit Event&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These events are primarily placed on the “&#039;&#039;&#039;Eat_Loop_Exi&#039;&#039;&#039;t” animations whether is FPV or TPV&lt;br /&gt;
*FoodConsumedEvent: Placed after eating it determines if the BiteableFoodObject has been consumed in its entirety, adding then calories and nutrients.&lt;br /&gt;
&#039;&#039;&#039;Last step:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After having created the &#039;&#039;&#039;CornOnTheCob_Eatable.prefab&#039;&#039;&#039; and &#039;&#039;&#039;CornOnTheCob_Eatable_FPV.prefab,&#039;&#039;&#039; we will then place &#039;&#039;&#039;CornOnTheCob_Eatable_FPV.prefab&#039;&#039;&#039; as a child of Tool object , then we go to Avatar object in &#039;&#039;&#039;AvatarAttachedPart&#039;&#039;&#039; component ****and set the &#039;&#039;&#039;Male prefab&#039;&#039;&#039; and &#039;&#039;&#039;Female prefab&#039;&#039;&#039; fields both to &#039;&#039;&#039;CornOnTheCob_Eatable.prefab.&#039;&#039;&#039; The object under tool will be used for the FPV of the food, and the object reference in male and female fields on AvatarAttachedPart will be used for the TPV of the food.&lt;br /&gt;
[[File:COTCmodguide FinalSetup.png|none|thumb|509x509px]]&lt;br /&gt;
[[File:COTCmodguide AvatarAttachedPart.png|none|thumb|503x503px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, Deactivate CornOnTheCobItem and build the modkit, then you’re set to go!&lt;br /&gt;
----Some further notes: This guide explains how the CornOnTheCob Food Mod was created and explains the critical processes involved in it that relate to food modding. It isn’t therefore a strict guide on how to make your food mod. You can technically deviate from the guide, create different prefabs for the FPV and TPV, or even different prefabs for Male and Female, it’s all up to the modder.&lt;br /&gt;
Keep in mind:&lt;br /&gt;
*If you want to make your custom animations make sure to add the animation events&lt;br /&gt;
*Name the Item correctly so that it coincides with the item class in Server&lt;br /&gt;
*Have the correct component on your FPV food and your TPV food.&lt;br /&gt;
===&#039;&#039;&#039;Errors and Warnings&#039;&#039;&#039;===&lt;br /&gt;
You might have wondered what those error signs and warning signs mean allow me to explain&lt;br /&gt;
*When setting the DefaultAnimationOverride to &#039;&#039;&#039;Custom&#039;&#039;&#039; it is expected for you to fill the field of &#039;&#039;&#039;Custom Animset&#039;&#039;&#039; in Tool Interaction, if this isn’t the case the next error message will appear, which indicates that you should add a &#039;&#039;&#039;Custom Animset&#039;&#039;&#039; because otherwise there wouldn’t be an animation&lt;br /&gt;
[[File:COTCmodguide ErrorPopUp.png|none|thumb|434x434px]]&lt;br /&gt;
*When setting the &#039;&#039;&#039;DefaultAnimationOverride&#039;&#039;&#039; to anything other than &#039;&#039;&#039;Custom&#039;&#039;&#039;, and also having the &#039;&#039;&#039;Custom Animset&#039;&#039;&#039; on &#039;&#039;&#039;Tool Interaction&#039;&#039;&#039; set, the latter one will be used instead of the specified one in &#039;&#039;&#039;DefaultAnimationOverride,&#039;&#039;&#039; for the warning to disappear you should change &#039;&#039;&#039;DefaultAnimationOverride&#039;&#039;&#039; to Custom or unset the &#039;&#039;&#039;Custom Animset&#039;&#039;&#039; value&lt;br /&gt;
[[File:COTCmodguide WarningPopup.png|none|thumb|443x443px]]&lt;/div&gt;</summary>
		<author><name>Felipe</name></author>
	</entry>
</feed>