From 3D Asset to Working Worktable

From Eco - English Wiki
Revision as of 03:39, 21 April 2026 by WugWugg (talk | contribs) (Finished Creating the Item section)

Introduction

Below is a guide on how to take an 3D asset from the Unity Store and make a working workbench in Eco. This includes:

  • Creating a recipe to craft the modded table
  • Creating recipes so the player can use the modded table to craft something
  • Using Blender to generate a modded icon (seen when holding it in inventory)
  • Using Blender to adjust the origin point of the model
  • How to setup all this in a Unity scene and package for Eco

Setup

  • Already have setup ModKit + Unity
  • Have a 3D model
    • Just following along? Find the one used here at https://assetstore.unity.com/packages/3d/props/low-poly-medieval-market-stalls-314286
  • A C# IDE (notepad++, Visual Studio, etc.)
    • Highly encouraged to have an Intellisense setup and linked to the Reference Assemblies. Optional, but its really worth the time to figure out because it will help quickly correct small typos and trivial mistakes.
    • See: Getting Started with Eco Modding in Visual Studio 2022 (generally the same steps apply if using a new version of Visual Studio)
  • Blender installed
    • Homepage: https://www.blender.org/

Importing the Assets

  1. Open the Unity editor to the project.
  2. From the top toolbar open the Window drop down.
  3. Hover Package Management to open sub-menu.
  4. Select Package Manager.
  5. The Package Manager window will pop-up.
  6. Install the package containing the assets you want to use...
    1. If not using Unity Registry...
      1. Find the +▾ button in the top left and open the drop down.
      2. Install the package from one of those options.
    2. If using Unity Registry...
      1. Visit https://assetstore.unity.com and sign in.
      2. Search for the asset desired.
      3. Go to it's page (e.g. https://assetstore.unity.com/packages/3d/props/low-poly-medieval-market-stalls-314286) and click the big blue button, Add to My Assets.
      4. Now, in the Unity editor and back at the Package Manager window.
      5. Find My Assets on the left menu and navigate to it.
      6. Click the button in the lower-right.
      7. The asset should be in the list now. Use the search to filter if needed.
      8. Click on the asset in the list. For those following along, Low Poly Medieval Market Stalls.
      9. In the right panel, find the Download ⤓ button. Click it.
      10. Once downloaded, a new button should show up, it'll say something like ⊕ Import 1.0 to project . Click it.
      11. The Import Unity Package window will pop-up.
      12. Select Import on it.
  7. Verify you can find your assets from the explorer. If following along, the assets are at Assets/PolyRonin/Medieval Market Stalls.
  8. Load in a demo scene, if provided, and make sure everything looks okay.
    1. For those following along, double click on the Demo scene at Assets/PolyRonin/Medieval Market Stalls/Demo.unity.
Underlined in red are the different draw mode buttons. 4/20/26

If something seems off, check the different draw modes and see if changing those allow the scene to render as expected (see picture).

With all that setup, it's time to get to the creation parts.

Creating The Worktable

This guide will create the worktable in this order:

  1. Create the item that represents the worktable
  2. Make a recipe to craft the worktable item
  3. Make the worktable item something that places a world object
  4. Give the worktable functionality by adding recipes to it

Creating the Item

Item Icon

A large (256x256px) icon created of Stall4 from the medieval assets.

This process is also explained here, https://mod.io/g/eco/r/origin-points-icon-images-with-blender, check it out if you need more visual reference points as that guide has a lot of pictures.

  1. Open Blender.
  2. Delete everything in the Scene Collection. Find this section in the top-right of the application.
  3. From the top toolbar, open the File drop down.
  4. Hover Import to open the sub-menu.
  5. Select the type of 3D asset. For those using medieval assets, select FBX (.fbx).
  6. Find the asset on the computer...
    1. Tip: Use Unity to find the .fbx asset. For the medieval assets, that's in Assets/PolyRonin/Medieval Market Stalls/Meshes/medieval-market-stalls-1.fbx.
    2. Right click on it and select Show in explorer.
    3. Now copy the address of that folder from Explorer. It might look like C:\Users\Wug\EcoMod--WikiDemo\WikiDemo\Assets\PolyRonin\Medieval Market Stalls\Meshes.
    4. Paste that in the address bar of the Blender import pop-up.
  7. Select the blue Import FBX button.
  8. From Layout mode, change the Viewport Shading to Material Preview or Rendered. This is on the second toolbar down, far right of center, but before Scene Collection section.
  9. If you see purple models, Blender will need help finding textures for these meshes...
    1. From the top toolbar, open the File drop down.
    2. Hover External Data to open the sub-menu.
    3. Select Find Missing Files...
    4. Point this to the whole directory that the 3D assets came in. For the medieval pack, C:\Users\Wug\EcoMod--WikiDemo\WikiDemo\Assets\PolyRonin.
    5. The proper textures/materials should have now loaded in. If it hasn't, consult Google because without the textures the following steps won't produce a usable icon.
  10. Add a source of light...
    1. Make sure the editor is in the Layout mode by checking the top most toolbar.
    2. From the toolbar just under that one, find and open the Add drop down.
    3. Hover Light to open that sub-menu.
    4. Click Sun.
  11. Add a camera...
    1. Again make sure the editor is in the Layout mode.
    2. From the second toolbar down, find and open the Add drop down.
    3. Select Camera.
  12. Setup the scene with the object placement and lighting direction desired. Tip: To reset the editor to something selected press the period key on the numpad. Without a numpad, use View (second toolbar from the top) and select Frame Selected from it. Alternatively, just set the zoom to zoom to the mouse position: Edit (top toolbar), Preferences (from drop down), Navigation (on left menu), Zoom to Mouse Position (In the zoom section). This makes moving around a lot more natural feeling.
  13. Setup the rendering camera...
    1. Go to Rendering tab on the top toolbar
    2. On the right there will be a side-panel open, it should be the Render tab. Confirm that.
    3. Change Render Engine to Cycles.
    4. Look down below in the same tab for the Film section.
    5. Expand it and find the Transparent checkbox and section. Click it so that it has a check mark. This will make the icon's background transparent.
    6. Now, go to the Output tab on the side panel. The tab is just below the current one.
    7. In the Format section set Resolution X to 64. And Y to 64 as well. This will make the icon generated a 64 by 64 pixel image. If a bigger image is desired (e.g. 128x128px) change that here.
  14. Go back to the Layout tab from the top toolbar.
  15. Center your view on the object (numpad period or View > Frame Selected). Adjust it so that the object is how it should be for the icon.
  16. Align the camera to the view...
    1. Make sure the editor is in Layout mode (top toolbar).
    2. Find View from the second from the top toolbar and open the drop down.
    3. Hover Align View to open the sub-menu.
    4. Select Align Active Camera To View.
    5. If the view is slightly off, there is a lock icon on the right side of this panel. Use it to "lock" controls to the camera and tweak it's view.
  17. Now return to the Rendering tab from the top toolbar.
  18. Press the F12 key to start the render. This should complete quickly since 64x64 pixels is a very small render.
  19. A window should popup, Blender Render. This is the icon!
  20. From the top tool bar of this Blender Render window, open the Image drop down.
  21. Select Save As... to save somewhere on the computer.
  22. Return to step 13 and repeat to do larger images if desired.
  23. It's recommended to save the Blender scene too. This will make making a new icon with a small tweak that much easier...
    1. File drop down from top toolbar.
    2. Save As... to save the Blender scene to the computer.

Adding to Unity Scene

The developers explain how to create an item in one of ModKit's read me files (See: Assets/EcoModKit/Docs/README.md), but this guide will explain it below.

Additionally, TheKye on YouTube covers this in their Creating Your First Item and Creating Your First Item Pt 2 videos.

Use those additional resource to help troubleshoot issues with item's icons.

  1. Open Unity.
  2. In the left panel, the Hierarchy tab should be selected.
  3. Select the top-most object there. It should be a scene. If the editor last loaded the Demo scene from the medieval assets, it'll be named Demo.
  4. Right click on this scene and select Add New Scene from the menu.
  5. Right click again on the old scene (Demo) and select Remove Scene.
  6. Let it save if the changes to the old scene are important. Discard if it was open just for exploration's sake.
  7. Right click the new, Untitled scene. Click Save Scene As...
  8. Save it somewhere on the computer and give it a name. Example: WikiDemo.
  9. Delete anything in the scene.
  10. Right click the scene, hover GameObject, and select Create Empty from the sub-menu.
  11. Name this new object Objects.
  12. Select the newly created Objects object from the Hierarchy menu.
  13. On the far right side of the screen, in the Inspector menu, click the Add Component button.
  14. Type in ModkitPrefabContainer. Click on the component from the search to add it. The component now should be listed in the Inspector.
  15. In the Hierarchy panel right click the scene, hover GameObject, and select Create Empty.
  16. Name this new object Items.
  17. Right click the scene, hover GameObject, and select Create Empty.
  18. Name this new object Emoji.
  19. Select the newly created Emoji object, find the Inspector menu (far-right), and click the Add Component button.
  20. Type in ChatEmoteSetOld. Click on the component from the search to add it. That component should now be listed in the Inspector.
  21. Right click the scene, hover GameObject, and select Create Empty.
  22. Name this new object BlockSets.
  23. Select the newly created BlockSets object, find the Inspector menu (far-right), and click Add Component.
  24. Search for BlockSetContainer. Click on the component from the search to add it. The Inspector should now show that component as added.
  25. Go to Assets/EcoModKit/Prefabs in the Unity browser.
  26. Find the prefab ItemTemplate.
  27. Drag it onto the Items object in the Hierarchy panel. It should add it as a child of the Items object.
  28. Right click on the new ItemTemplate object, hover Prefab, and select Unpack Completely.
  29. Right click on the ItemTemplate object and select Rename. Name this what you want the item to be called. Example: MedievalStallItem.
  30. Set this item's background...
    1. Here's the default backgrounds (blue = item, brown = block, green = food):
    2. Download or prepare the background and add it to the Assets folder in Unity.
      1. To follow along lockstep, put the background in a new Assets/WikiDemo folder.
      2. Right click on Assets folder, hover Create, select Folder.
      3. Name the folder WikiDemo.
    3. Configure Unity to use these as sprites...
      1. Select the background(s) added (Ctrl+Click each one).
      2. In the Inspector, find TextureType and change that to Sprite (2D and UI).
      3. Again in the Inspector, find SpriteMode and change that to Single.
      4. Then scroll and go to the bottom of the Inspector and find the Apply button.
      5. This will apply those changes to that file and all other ones highlighted.
    4. Select the item being created (MedievalStallItem).
    5. In the Inspector panel (far-right), scroll and find the Item Template (Script) section.
    6. In here find the Background input. It'll say Background (Image) in it. If clicked that text to reveal and highlight the related object in the Hierarchy panel.
    7. Select the revealed, and highlighted object Background.
    8. In the Inspector panel, scroll and find the Image component section.
    9. Inside that component's section, find Source Image. It'll say Missing (Sprite). Click the ⦿ button to the right.
    10. The Select Sprite popup will show. Make sure the Assets tab is selected, and find the backgrounds desired.
  31. Set this item's foreground...
    1. Copy the item's icon into the Assets folder.
    2. Configure Unity to use it as a sprite (see the previous step's Set this item's background... instructions)
    3. Select the item being created (MedievalStallItem).
    4. In the Inspector panel (far-right), scroll and find the Item Template (Script) section.
    5. In here find the Foreground input. It'll say Foreground (Image) in it. If clicked that text to reveal and highlight the related object in the Hierarchy panel.
    6. Select the revealed, and highlighted object Foreground.
    7. Use the Inspector, find the Image component, within that component find the Source Image input. It will say Missing (Sprite).
    8. Click the ⦿ button to the right of that input.
    9. From the Select Sprite popup, ensure the Assets tab is being searched, and find the icon.

Scripting the Item

Registering the item in the code is as simple as:

using Eco.Core.Items;
using Eco.Gameplay.Items;
using Eco.Shared.Localization;
using Eco.Shared.Serialization;

namespace WikiDemo
{
    [Serialized] // Tells the save/load system this object needs to be serialized.
    [LocDisplayName("Market Stall")] // Defines the localized name of the item.
    [Weight(100)] // Defines how heavy Arrow is.
    [Ecopedia("Work Stations", "Craft Tables", createAsSubPage: true)]
    [LocDescription("A medieval market stall.")] //The tooltip description for the item.
    public partial class MedievalStallItem: Item { }
}

Line 13: The implementation of Item means that Eco will find this and look for Unity assets that matching this class' name, MedivalStallItem. While this doesn't do anything fancy, it completes the first step towards a new workbench.

Checkpoint

This was a lot of setup and steps. Make sure everything is running smoothly by doing the following:

  1. In Unity.
  2. Open the Eco Tools drop down from the top toolbar.
  3. Hover Mod Kit.
  4. Select Build Current Bundle.
  5. A file explorer window will popup. Point it to where you want the newly created bundle to be save.
  6. Copy that bundle into the Eco mod directory, /Eco Server/Mods/UserCode.
  7. Start the server and connect to it.
  8. Test it out by typing /give MedievalStall in chat (or /give whatever your item is named)
  9. The item should appear in the players inventory with a working icon.

This was the longest "leg" of this journey. All the setup is done and the infrastructure is in place. The following sections will just build on what was taught here.

Keep on, keeping on!

Code the Item's Recipe

Time for an easy one, add a block of code to tell the game how to craft the worktable item. Assign to an existing worktable.

Talk about how the Item name in Unity and the class name in code is what joins the items. Must be exactly the same!

Checkpoint

Export, run local, try to craft the item

Create the World Object

Add to Unity Scene

Same as Creating the Item, Add to Unity Scene.

Explore what the ModKit utility World Object Setup does. In Unity editor, top toolbar, Eco Tools > Mod Kit > World Object Setup

Scripting the World Object

Barebones code that registers the world object.

Code that links the Item to this World Object.

Checkpoint

Export and see what it does. Ensure it's not lifting off the ground because of a non-curved shader.

Origin Point Editing

Talk about what it does: the point that the simulation considers this world object to be at.

Show how to move it around using blender.

Final Export

Export.

Package.

Distribute.